mirror of
https://gitee.com/chu1204505056/vue-admin-beautiful.git
synced 2025-04-06 03:58:00 +08:00
修复request.js异常拦截的bug,请务必更新
This commit is contained in:
parent
22e54f1f92
commit
6291db9dea
@ -45,7 +45,7 @@
|
||||
"axios": "^0.19.2",
|
||||
"better-scroll": "^1.15.2",
|
||||
"clipboard": "^2.0.6",
|
||||
"codemirror": "^5.55.0",
|
||||
"codemirror": "^5.56.0",
|
||||
"core-js": "^3.6.5",
|
||||
"dayjs": "^1.8.29",
|
||||
"echarts": "^4.8.0",
|
||||
|
@ -1,6 +1,6 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
export function getPublicKey(data) {
|
||||
export function getPublicKey() {
|
||||
return request({
|
||||
url: "/publicKey",
|
||||
method: "post",
|
||||
|
@ -79,7 +79,7 @@ module.exports = {
|
||||
//是否开启登录拦截
|
||||
loginInterception: true,
|
||||
//是否开启登录RSA加密
|
||||
loginRSA: false,
|
||||
loginRSA: true,
|
||||
//是否依据mock数据生成webstorm HTTP Request请求文件
|
||||
httpRequestFile: false,
|
||||
//intelligence和all两种方式,前者后端权限只控制permissions不控制view文件的import(前后端配合,减轻后端工作量),all方式完全交给后端前端只负责加载
|
||||
|
@ -76,21 +76,20 @@ service.interceptors.response.use(
|
||||
}
|
||||
const { status, data, config } = response;
|
||||
const { code, msg } = data;
|
||||
let codeVerification = false;
|
||||
let codeVerification = "";
|
||||
|
||||
if (isNumber(successCode)) {
|
||||
codeVerification = code !== successCode;
|
||||
codeVerification = successCode;
|
||||
}
|
||||
if (isArray(successCode)) {
|
||||
for (let i = 0; i < successCode.length; i++) {
|
||||
if (code === i) {
|
||||
codeVerification = code !== i;
|
||||
if (code === successCode[i]) {
|
||||
codeVerification = successCode[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (codeVerification) {
|
||||
if (code != codeVerification) {
|
||||
switch (code) {
|
||||
case invalidCode:
|
||||
errorMsg(msg || `后端接口${code}异常`);
|
||||
|
@ -173,7 +173,7 @@
|
||||
});
|
||||
setTimeout(() => {
|
||||
window.open("https://github.com/chuzhixin/vue-admin-beautiful");
|
||||
}, 30000);
|
||||
}, 100000);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user