From a72add8a584fc017da11b6f6e05a749ad7f2f4f7 Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期一, 08 七月 2024 17:35:34 +0800
Subject: [PATCH] 1
---
plugins/http.js | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/plugins/http.js b/plugins/http.js
index 58e3162..bbbf997 100644
--- a/plugins/http.js
+++ b/plugins/http.js
@@ -70,7 +70,7 @@
code: 0,
msg: ''
})
- } else if (res.data.code === '3000') {
+ } else if (res.data.code === '3000'||res.data.code === '30000') {
if (Array.isArray(res.data.data)) {
if (res.data.data.length > 0 && res.data.data[0]
.errorMessage) {
@@ -86,7 +86,7 @@
code: parseInt(res.data.code),
msg: res.data.data
})
- } else if (res.data.code === '4000') {
+ } else if (res.data.code === '4000'||res.data.code === '40000') {
message.showToast('系统异常')
} else {
if (res.data.data && typeof res.data.data === 'string') {
@@ -191,7 +191,7 @@
let header = {
Authorization: token ? `Bearer ${token}` : null,
}
- var url = environments.httpBaseUri + '/wxkj/upload/file'
+ var url = environments.httpBaseUri + '/api/upload/oss/file'
if (environments.type == 'prod') {
//需要拼接
var year = utils.toYear(new Date())
@@ -210,11 +210,12 @@
filePath: filePath,
name: 'file',
success: (res) => {
- console.log('res', res)
+ console.log('res debug', res)
message.hideLoading()
if (res.statusCode === 200) {
const obj = JSON.parse(res.data)
- if (obj.code.startsWith('200')) {
+ console.log('res debug2', obj)
+ if (obj.code.startsWith('200')||obj.code==='0') {
resolve({
data: obj.data,
code: 0,
@@ -257,6 +258,7 @@
try {
return await http.uploadTemp(filePath, dto)
} catch (e) {
+ console.log('error',e)
return e
}
},
--
Gitblit v1.9.3