zuozhengqing
2024-02-05 ecc5079c63e86dd6caba6753b51ed480022bf89b
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.158:8080`
        dev: `//192.168.8.108:8080`
    }
    return loginPathMap[environmentType()]
@@ -64,7 +64,11 @@
  (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
@@ -77,6 +81,18 @@
        window.location = getApsPage()+'/login'
      }
      return Promise.reject(res.data)
    }else if([2036].includes(res.data.code)){
      if (isDev){
        window.location = getApsPage()+'/commonWeb?resetPwd=true'
      }else {
        //   JWT鉴权失效 跳转到登录页
        window.location = getApsPage()+'/commonWeb?resetPwd=true'
      }
      return Promise.reject(res.data)
      // if(window.location.pathname && window.location.pathname !== '/login'){
      //   window.location = window.location.origin+'/login'
      // }
    } else {
      Message({
        message: res.data.msg,