src/common/untils/request.js
@@ -33,7 +33,7 @@
        prod:`//${window.location.hostname}:9080`,
        test:`//192.168.20.119:9080`,
        // 想跳到本地启动的登录页的话需要把dev改成你本地项目路径
        dev: `//192.168.20.124:8081`
        dev: `//192.168.8.111:8081`
    }
    return loginPathMap[environmentType()]
@@ -64,13 +64,18 @@
  (res) => {
    /* //对响应数据做些事 */
    if (res.data.code === 200) {
      return res.data ? res.data : {}
      if(res.config.IsHeader){
        return res;
      }else{
        return res.data ? res.data : {}
      }
    } else if (res.data.code === 700001 || res.data.code === 700005) {
      console.log("客户名称重复")
      return res
    } else if([2012,2013,2014,2015].includes(res.data.code)){
      if (isDev){
          alert("JWT失效")
        alert("JWT失效")
        // window.location = getApsPage()+'/'
      }else {
        //   JWT鉴权失效 跳转到登录页
        window.location = getApsPage()+'/login'
@@ -86,6 +91,16 @@
    }
  },
  (error) => {
    if (error.response.status === 401){
      if (isDev){
        alert("JWT失效")
        // window.location = getApsPage()+'/'
      }else {
        //   JWT鉴权失效 跳转到登录页
        window.location = getApsPage()+'/login'
      }
    }
    let { message } = error
    if (message === "Network Error") {
      message = "后端接口连接异常"