From 836a56418f932086e4221cb6c5e6a56f1c0dfecf Mon Sep 17 00:00:00 2001
From: 李 <344137771@qq.com>
Date: Fri, 22 May 2026 15:07:30 +0800
Subject: [PATCH] 1
---
src/service/request.js | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/service/request.js b/src/service/request.js
index a3e8988..77bb6c4 100644
--- a/src/service/request.js
+++ b/src/service/request.js
@@ -31,6 +31,8 @@
if (config.data) {
// config.data = qs.stringify(config.data)
}
+ }else if(config.method == 'get' && config.data){
+ config.params = config.data
}
const userStore = useUserStore()
const TOKEN = userStore.userInfo.token
@@ -46,11 +48,13 @@
config.headers['token'] = TOKEN
// config.params['token'] = TOKEN
}
- config.params['language'] = getStorage('lang') || "en"
+ if(!config.params['not_language']) config.params['language'] = getStorage('lang') || "en"
+
if (config.loading) {
showLoadingToast({ forbidClick: true, duration: 0 })
isClose = true
}
+
return config
}, error => {
return Promise.reject(error)
@@ -77,6 +81,7 @@
case 403: // 登录状态已过期,您可以继续留在该页面,或者重新登录
userStore.userInfo = {}
store.state.user.userInfo = {}
+ showToast({ type: 'warning', message: i18n.global.t('请重新登录')})
router.push({
path: '/login'
})
@@ -96,13 +101,13 @@
logout()
break
case 404:
- showToast({ message: '接口未找到', type: 'fail', duration: 2000 })
+ showToast({ message: i18n.global.t('apiNotFound'), type: 'fail', duration: 2000 })
break
case 415:
- showToast({ message: 'HTTP协议不匹配,请确认', type: 'fail', duration: 2000 })
+ showToast({ message: i18n.global.t('httpMismatch'), type: 'fail', duration: 2000 })
break
case 428:
- showToast({ message: '验证码不合法', type: 'fail', duration: 2000 })
+ showToast({ message: i18n.global.t('invalidVerifyCode'), type: 'fail', duration: 2000 })
break
// case 500:
// showToast({ message: '服务未启动', type: 'fail', duration: 2000 })
@@ -113,11 +118,11 @@
default:
// console.log(error)
if (error.config.url != '/api/api/hobi!getRealtime.action') {
- showToast({ message: i18n.global.t(error.message) || '服务错误', type: 'fail', duration: 2000 })
+ showToast({ message: i18n.global.t(error.message) || i18n.global.t('serviceError'), type: 'fail', duration: 2000 })
}
}
} else {
- showToast({ message: i18n.global.t(error.message) || '服务错误', type: 'fail', duration: 2000 })
+ showToast({ message: i18n.global.t(error.message) || i18n.global.t('serviceError'), type: 'fail', duration: 2000 })
}
return Promise.reject(error)
--
Gitblit v1.9.3