From 20c751a7b5335a057895ddb910f1ae7970d15537 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?lemon=E6=A9=AA?= <17633066053@163.com>
Date: Thu, 24 Jun 2021 17:59:03 +0800
Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E6=B7=BB=E5=8A=A0=E5=AE=A2?=
=?UTF-8?q?=E6=9C=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
manifest.json | 4 ++--
pages/product/goods.vue | 4 ++--
utils/filters.js | 2 +-
utils/request.js | 10 +++-------
4 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/manifest.json b/manifest.json
index 82bd99e..852b56d 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,8 +2,8 @@
"name" : "lili商城",
"appid" : "__UNI__C100675",
"description" : "",
- "versionName" : "4.0.20",
- "versionCode" : 4000020,
+ "versionName" : "4.0.21",
+ "versionCode" : 4000021,
"transformPx" : false,
"app-plus" : {
"compatible" : {
diff --git a/pages/product/goods.vue b/pages/product/goods.vue
index ec6ec8d..d754e77 100644
--- a/pages/product/goods.vue
+++ b/pages/product/goods.vue
@@ -166,10 +166,10 @@
店铺
-
+
购物车
diff --git a/utils/filters.js b/utils/filters.js
index 5e87135..daa53c5 100644
--- a/utils/filters.js
+++ b/utils/filters.js
@@ -148,7 +148,7 @@ export function orderStatusList(val) {
DELIVERED: "已发货",
CANCELLED: "已取消",
COMPLETE: "已完成",
- TAKE: "已完成",
+ TAKE: "待核验",
};
return orderStatusList[val];
}
diff --git a/utils/request.js b/utils/request.js
index 2b03fbf..e34f826 100644
--- a/utils/request.js
+++ b/utils/request.js
@@ -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();