diff --git a/package.json b/package.json index b898c8b..3a621f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "front-next", - "version": "5.2.1", + "version": "5.2.2", "scripts": { "dev": "vite --host", "build": "vite build", diff --git a/src/cool/service/request.ts b/src/cool/service/request.ts index 8051862..35aa43b 100644 --- a/src/cool/service/request.ts +++ b/src/cool/service/request.ts @@ -103,6 +103,10 @@ axios.interceptors.response.use( const { code, data, message } = res.data; + if (!code) { + return res.data; + } + switch (code) { case 1000: return data; diff --git a/src/modules/upload/components/index.vue b/src/modules/upload/components/index.vue index 34d6974..a1e35bf 100644 --- a/src/modules/upload/components/index.vue +++ b/src/modules/upload/components/index.vue @@ -352,12 +352,10 @@ async function httpRequest(req: any, item?: any) { update(); }) .catch((err) => { - if (mode == "local") { - ElMessage.error(err.message); - item.error = err.message; - emit("error", item); - reject(err); - } + ElMessage.error(err.message); + item.error = err.message; + emit("error", item); + reject(err); }); }