From eba06cc3df5f5736d3310b3b57dfc7243f41134a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 01 八月 2024 15:39:12 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/api/index.js | 21 ++++----------------- 1 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 78cdb4f..18c6f41 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -103,23 +103,10 @@ wxAccessToken (appId, domain = '') { let _url = domain || window.GLOB.baseurl - return new Promise(resolve => { - if (window.GLOB.accessToken.appId === appId && window.GLOB.accessToken.accessTime && (parseInt(new Date().getTime() / 1000) - window.GLOB.accessToken.accessTime < 30)) { - resolve(window.GLOB.accessToken) - } else { - window.GLOB.accessToken = {appId} - axios({ - url: _url + 'wechat/getaccesstoken', - method: 'post', - data: JSON.stringify({app_id: appId}) - }).then(res => { - if (res.access_token) { - window.GLOB.accessToken.accessTime = parseInt(new Date().getTime() / 1000) - window.GLOB.accessToken.access_token = res.access_token - } - resolve(res) - }) - } + return axios({ + url: _url + 'wechat/getaccesstoken', + method: 'post', + data: JSON.stringify({app_id: appId}) }) } -- Gitblit v1.8.0