mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-17 07:55:53 +08:00
商品添加客服
This commit is contained in:
@@ -148,7 +148,7 @@ export function orderStatusList(val) {
|
||||
DELIVERED: "已发货",
|
||||
CANCELLED: "已取消",
|
||||
COMPLETE: "已完成",
|
||||
TAKE: "已完成",
|
||||
TAKE: "待核验",
|
||||
};
|
||||
return orderStatusList[val];
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ http.interceptors.request.use(
|
||||
|
||||
config.params = params;
|
||||
config.header.accessToken = accessToken;
|
||||
console.warn(accessToken);
|
||||
|
||||
/**
|
||||
* jwt 因为安卓以及ios没有window的属性
|
||||
* window.atob()这个函数 base64编码的使用方法就是btoa(),而用于解码的使用方法是atob(),
|
||||
@@ -132,15 +132,10 @@ http.interceptors.request.use(
|
||||
if (accessToken.split(".").length <= 1) {
|
||||
refresh();
|
||||
} else {
|
||||
console.log(
|
||||
JSON.parse(atob(accessToken.split(".")[1])).exp,
|
||||
Math.round(new Date() / 1000)
|
||||
);
|
||||
if (
|
||||
JSON.parse(atob(accessToken.split(".")[1])).exp <
|
||||
JSON.parse(atob(accessToken.split(".")[1].replace(/-/g, '+').replace(/_/g, '/'))).exp <
|
||||
Math.round(new Date() / 1000)
|
||||
) {
|
||||
console.log("过期时间小于当前时间刷新token");
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
@@ -156,6 +151,7 @@ http.interceptors.request.use(
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
async function refresh() {
|
||||
// 本地储存的是过期token了,重新获取
|
||||
const getTokenResult = await refreshToken();
|
||||
|
||||
Reference in New Issue
Block a user