From 262087d13f140f68768d4a311b188f8d035e9cf4 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 19 九月 2022 14:10:16 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/index.js | 7 ++----- src/api/index.js | 13 +++++++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index a57ff74..36b5bc1 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -858,9 +858,22 @@ param = this.encryptParam(param) if (login) { + let time = +sessionStorage.getItem(rduri) + let c_time = Math.round(new Date().getTime() / 1000) + + if (time && c_time - time <= 60) { + sessionStorage.setItem(rduri, c_time) + return axios({ + url: `${url}${param.func ? '/' + param.func : ''}`, + method: 'post', + data: param + }) + } + return new Promise((resolve, reject) => { this.getTouristMsg('login_check', rduri).then(res => { if (res.status) { + sessionStorage.setItem(rduri, c_time) axios({ url: `${url}${param.func ? '/' + param.func : ''}`, method: 'post', diff --git a/src/index.js b/src/index.js index 909a4bf..c9434c0 100644 --- a/src/index.js +++ b/src/index.js @@ -204,14 +204,11 @@ } if (process.env.NODE_ENV === 'production') { // 鐢ㄤ簬鏍¢獙鏄惁瀛樺湪寮�鍙戞潈闄� - let _service = window.location.href.replace(/(\/admin)?\/index.html(.*)|(\/admin)?\/#(.*)/ig, '').replace(new RegExp(document.location.origin + '/?', 'ig'), '') - GLOB.linkurl = _href - if (!/index.html/ig.test(GLOB.linkurl)) { - GLOB.linkurl = GLOB.linkurl + 'index.html' - } + let _service = window.location.href.replace(/\/admin(.*)/ig, '').replace(new RegExp(document.location.origin + '/?', 'ig'), '') GLOB.service = _service ? _service + '/' : '' GLOB.host = window.location.host + (_service ? '_' + _service : '') GLOB.baseurl = document.location.origin + '/' + GLOB.service + GLOB.linkurl = GLOB.baseurl + 'index.html' } else { GLOB.linkurl = '' GLOB.location = config.host -- Gitblit v1.8.0