mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-10 08:06:44 +08:00
GFRS-2223 【前端】重新投保-撤单、重新支付功能开发---提交人:白金岩
This commit is contained in:
@@ -161,18 +161,22 @@ service.interceptors.request.use(
|
|||||||
|
|
||||||
// token 不存在初始化处理
|
// token 不存在初始化处理
|
||||||
let token = CacheUtils.getLocItem('token')
|
let token = CacheUtils.getLocItem('token')
|
||||||
|
console.log('前端缓存token====>>', token)
|
||||||
if (!token) {
|
if (!token) {
|
||||||
console.log('token====>>', token)
|
console.log('无token====>>', token)
|
||||||
// 设备类型
|
// 设备类型
|
||||||
const target = BusinessCommon.device()
|
const target = BusinessCommon.device()
|
||||||
|
console.log('设备类型---微信:'+target.isWeixin+'; 浏览器:'+target.isChrome)
|
||||||
// 安卓or苹果(非浏览器)
|
// 安卓or苹果(非浏览器)
|
||||||
if (!target.isWeixin && !target.isChrome) {
|
if (!target.isWeixin && !target.isChrome) {
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
const res = await EWebBridge.webCallAppInJs('getToken')
|
const res = await EWebBridge.webCallAppInJs('getToken')
|
||||||
CacheUtils.setLocItem('token', JSON.parse(res).token)
|
CacheUtils.setLocItem('token', JSON.parse(res).token)
|
||||||
|
console.log('原生返回信息===>',JSON.parse(res))
|
||||||
|
console.log('原生返回token===>', JSON.parse(res).token)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log('最终token====>>', CacheUtils.getLocItem('token'))
|
||||||
config.headers['token'] = CacheUtils.getLocItem('token')
|
config.headers['token'] = CacheUtils.getLocItem('token')
|
||||||
// 添加请时间戳
|
// 添加请时间戳
|
||||||
let timeStr = new Date().getTime() + ''
|
let timeStr = new Date().getTime() + ''
|
||||||
|
|||||||
Reference in New Issue
Block a user