fix:解决srm之前改了域名,处理各种异常状态,跳转也会出现异常等问题。
3个文件已修改
16 ■■■■ 已修改文件
src/common/untils/request.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/common/untils/request.js
@@ -67,10 +67,10 @@
    } else if([2012,2013,2014,2015].includes(res.data.code)){
      if (isDev){
        alert("JWT失效,即将跳转至登录页..")
        window.location = getApsPage()+'/login'
        window.location ='http://'+ getApsPage()+'/login'
      }else {
        //   JWT鉴权失效 跳转到登录页
        window.location = getApsPage()+'/login'
        window.location ='http://'+ getApsPage()+'/login'
      }
      // Message({
      //   message: res.data.msg,
@@ -80,10 +80,10 @@
      return Promise.reject(res.data)
    }else if([2036].includes(res.data.code)){
      if (isDev){
        window.location = getApsPage()+'/commonWeb?resetPwd=true'
        window.location ='http://'+ getApsPage()+'/commonWeb?resetPwd=true'
      }else {
        //   JWT鉴权失效 跳转到登录页
        window.location = getApsPage()+'/commonWeb?resetPwd=true'
        window.location ='http://'+ getApsPage()+'/commonWeb?resetPwd=true'
      }
      return Promise.reject(res.data)
@@ -96,10 +96,10 @@
    if(error.response.status === 401){
      if (isDev){
        alert("JWT失效,即将跳转至登录页..")
        window.location = getApsPage()+'/login'
        window.location ='http://'+ getApsPage()+'/login'
      }else {
        //   JWT鉴权失效 跳转到登录页
        window.location = getApsPage()+'/login'
        window.location ='http://'+ getApsPage()+'/login'
      }
    }
    let { message } = error
src/router/index.js
@@ -101,7 +101,7 @@
// 导出路由 在 main.js 里使用
const createRouter = () =>
  new Router({
    mode: "history",
    mode: "hash",
    // base: window.getServerJson.context,
    scrollBehavior: () => ({ y: 0 }),
    routes: constantRoutes
vue.config.js
@@ -1,6 +1,6 @@
const path = require("path")
// 基础路径 注意发布之前要先修改这里
const publicPath = "/"
const publicPath = "./"
function resolve(dir) {
  return path.join(__dirname, dir)
}