mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 14:10:27 +08:00
解决 request code不存在问题
This commit is contained in:
parent
c63d374565
commit
beb5cc2ed0
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "front-next",
|
"name": "front-next",
|
||||||
"version": "5.2.1",
|
"version": "5.2.2",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite --host",
|
"dev": "vite --host",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
|
@ -103,6 +103,10 @@ axios.interceptors.response.use(
|
|||||||
|
|
||||||
const { code, data, message } = res.data;
|
const { code, data, message } = res.data;
|
||||||
|
|
||||||
|
if (!code) {
|
||||||
|
return res.data;
|
||||||
|
}
|
||||||
|
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case 1000:
|
case 1000:
|
||||||
return data;
|
return data;
|
||||||
|
@ -352,12 +352,10 @@ async function httpRequest(req: any, item?: any) {
|
|||||||
update();
|
update();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
if (mode == "local") {
|
|
||||||
ElMessage.error(err.message);
|
ElMessage.error(err.message);
|
||||||
item.error = err.message;
|
item.error = err.message;
|
||||||
emit("error", item);
|
emit("error", item);
|
||||||
reject(err);
|
reject(err);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user