修改点发票开始之前提交版本
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const preCacheKeyClearFetch = 'storage:clear:fetch:'
|
||||
|
||||
import Api from '@/common/js/api.js'
|
||||
uni.pro.interceptor('request', {
|
||||
config(paramOptions) {
|
||||
let options = Object.assign({}, paramOptions)
|
||||
@@ -39,7 +39,9 @@ async function request(options) {
|
||||
}
|
||||
options.header = {
|
||||
userId: uni.getStorageSync('userId'),
|
||||
minitype:uni.getStorageSync('Type'),
|
||||
minitype: uni.getStorageSync('Type'),
|
||||
fatoken: uni.getStorageSync('token'),
|
||||
isnew: 'isnew',
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
let res = await uni.pro.request(options)
|
||||
@@ -59,18 +61,13 @@ async function request(options) {
|
||||
}
|
||||
if (res.code == 400) {
|
||||
return Promise.reject(res.message)
|
||||
} else if (res.code == 401) {
|
||||
uni.showToast({
|
||||
title: res.message || res.msg,
|
||||
icon: "none",
|
||||
success: () => {
|
||||
uni.cache.clear();
|
||||
uni.removeStorageSync("token");
|
||||
uni.removeStorageSync("userId");
|
||||
uni.removeStorageSync('myLoginName')
|
||||
uni.pro.redirectTo("login/login");
|
||||
}
|
||||
} else if (res.code == 405) {
|
||||
let token = await Api.h5encryption({
|
||||
store_id: uni.cache.get('userId')
|
||||
})
|
||||
if (token.code == 1) {
|
||||
uni.cache.set('token', token.data.token);
|
||||
}
|
||||
} else if (res.code == 482) {
|
||||
let nowTime = new Date() / 1000 | 0
|
||||
let offset = parseInt(res.message) - parseInt(nowTime);
|
||||
|
||||
Reference in New Issue
Block a user