任务半成品

This commit is contained in:
砂糖
2025-07-11 18:05:05 +08:00
parent 561601910f
commit 0246dc128c
12 changed files with 2376 additions and 43 deletions

View File

@@ -10,7 +10,14 @@ const baseUrl = 'http://110.41.139.73:8080'
const request = config => {
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false
config.header = config.header || {}
// 合并 header优先 config.header
config.header = Object.assign({
'Content-Type': 'application/json;charset=UTF-8',
'Accept': 'application/json, text/plain, */*',
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
'Content-Language': 'zh_CN',
'User-Agent': uni.getStorageSync('userAgent') || 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0'
}, config.header || {})
if (getToken() && !isToken) {
config.header['Authorization'] = 'Bearer ' + getToken()
}