mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-11 16:46:43 +08:00
dev测试token问题
This commit is contained in:
@@ -136,7 +136,7 @@ const service = axios.create({
|
|||||||
|
|
||||||
// request拦截器
|
// request拦截器
|
||||||
service.interceptors.request.use(
|
service.interceptors.request.use(
|
||||||
async config => {
|
config => {
|
||||||
let relativePath = config.url && config.url.split(configApp.API_VERSION)[1]
|
let relativePath = config.url && config.url.split(configApp.API_VERSION)[1]
|
||||||
if (whiteList.includes(relativePath)) {
|
if (whiteList.includes(relativePath)) {
|
||||||
Toast.loading({
|
Toast.loading({
|
||||||
@@ -165,13 +165,11 @@ service.interceptors.request.use(
|
|||||||
if (!token) {
|
if (!token) {
|
||||||
// 设备类型
|
// 设备类型
|
||||||
const target = BusinessCommon.device()
|
const target = BusinessCommon.device()
|
||||||
console.log('设备类型信息:',target)
|
|
||||||
// 安卓or苹果(非浏览器)
|
// 安卓or苹果(非浏览器)
|
||||||
if (target.isAndroid || target.isIphone) {
|
if (target.isAndroid || target.isIphone) {
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
const res = await window.WebViewJavascriptBridge.webCallAppInJs('getToken')
|
const res = EWebBridge.webCallAppInJs('getToken')
|
||||||
console.log('原生返回信息===>', JSON.parse(res))
|
CacheUtils.setLocItem('token', JSON.parse(res).token)
|
||||||
CacheUtils.setLocItem('token', JSON.parse(res).token)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log('最终token====>>', CacheUtils.getLocItem('token'))
|
console.log('最终token====>>', CacheUtils.getLocItem('token'))
|
||||||
|
|||||||
Reference in New Issue
Block a user