|
@@ -54,27 +54,21 @@ class HttpRequest {
|
|
|
title: '加载中',
|
|
|
mask: true
|
|
|
})
|
|
|
- // 添加token
|
|
|
|
|
|
+ config.header.appId = 'wx628f62793fdf5251'
|
|
|
+
|
|
|
+ // 添加token
|
|
|
// #ifdef H5
|
|
|
const token = '6288d39b-ed8e-4e67-9dac-796ee30eb5e4'
|
|
|
+ config.header.token = token
|
|
|
// #endif
|
|
|
|
|
|
// #ifdef MP-WEIXIN
|
|
|
- const token = uni.getStorageSync('userInfo')
|
|
|
- // #endif
|
|
|
- config.header.appId = 'wx628f62793fdf5251'
|
|
|
- if (token) {
|
|
|
- config.header = config.header || {}
|
|
|
-
|
|
|
- // #ifdef H5
|
|
|
- config.header.token = token
|
|
|
- // #endif
|
|
|
-
|
|
|
- // #ifdef MP-WEIXIN
|
|
|
+ const userInfo = uni.getStorageSync('userInfo')
|
|
|
+ if (userInfo) {
|
|
|
config.header.token = userInfo.token
|
|
|
- // #endif
|
|
|
}
|
|
|
+ // #endif
|
|
|
|
|
|
// 记录请求开始时间(用于计算请求耗时)
|
|
|
config.metadata = { startTime: new Date() }
|