From 9e716f3bd30820a08757845b592db73363faa48c Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 25 四月 2022 14:53:37 +0800 Subject: [PATCH] 2022-04-25 --- src/api/index.js | 32 +++++++++++++++++++++++--------- 1 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 08baa38..a542dfc 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -48,7 +48,7 @@ } sessionStorage.clear() - sessionStorage.setItem('loginError', JSON.stringify({request: res.config ? res.config.data : '', response: JSON.stringify(res.data)})) + sessionStorage.setItem('loginError', JSON.stringify({url: res.config ? res.config.url : '', request: res.config ? res.config.data : '', response: JSON.stringify(res.data)})) window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login') window.location.reload() } @@ -59,7 +59,7 @@ if (window.debugger === true) { response.data.ErrCode = 'E' return Promise.resolve(response.data) - } else { + } else if (!sessionStorage.getItem('loginError')) { setCurrentUrl(response) } } else { @@ -153,7 +153,8 @@ func: 's_visitor_login', timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), SessionUid: _SessionUid, - TypeCharOne: 'pc' + TypeCharOne: 'pc', + kei_id: window.btoa(window.encodeURIComponent(window.GLOB.host)) } param.LText = md5(window.btoa(_SessionUid + param.timestamp)) @@ -195,7 +196,9 @@ way_no: 'sms_vcode', systemType: options.sysType, login_city: city, - login_id_address: ipAddress + login_id_address: ipAddress, + kei_id: window.btoa(window.encodeURIComponent(window.GLOB.host)), + device_id: localStorage.getItem('SessionUid') } param.appkey = window.GLOB.appkey || '' @@ -232,7 +235,9 @@ systemType: options.sysType, Type: 'S', login_city: city, - login_id_address: ipAddress + login_id_address: ipAddress, + kei_id: window.btoa(window.encodeURIComponent(window.GLOB.host)), + device_id: localStorage.getItem('SessionUid') } param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') @@ -403,6 +408,7 @@ CacheUtils.updateWebSqlversion('1.00', curTime) CacheUtils.clearIndexDBConfig() CacheUtils.updateIndexDBversion({version: '1.00', createDate: curTime}) + CacheUtils.clearFuncs(options.sysType) } /** @@ -478,7 +484,7 @@ param.lang = param.lang || sessionStorage.getItem('lang') || '' param.SessionUid = localStorage.getItem('SessionUid') || '' param.LoginUID = param.LoginUID || sessionStorage.getItem('LoginUID') || '' - param.appkey = window.GLOB.appkey || '' + param.appkey = param.appkey || window.GLOB.appkey let url = '/webapi/dostars' if (sessionStorage.getItem('isEditState') === 'true' && options.cloudServiceApi) { // 缂栬緫鐘舵�侊紝涓斿瓨鍦ㄤ簯绔湴鍧� @@ -665,7 +671,15 @@ } }) param.sign = md5(values) - param.t = new Date().getTime() + param.t = new Date().getTime(); + + ['arr_field', 'LText_field', 'custom_script', 'LText1', 'LText', 'LText2', 'DateCount'].forEach(key => { + if (param[key]) { + let val = param[key] + delete param[key] + param[key] = val + } + }) return param } @@ -675,7 +689,7 @@ * @param {Object} param 璇锋眰鍙傛暟 * @param {Boolean} SSO 鏄惁涓哄崟鐐圭櫥褰曞湴鍧� */ - getSystemCacheConfig (param) { + getSystemCacheConfig (param, cache = true) { param.userid = param.userid || sessionStorage.getItem('UserID') || '' param.lang = param.lang || sessionStorage.getItem('lang') || '' param.SessionUid = localStorage.getItem('SessionUid') || '' @@ -695,7 +709,7 @@ _param = JSON.stringify(_param) _param = md5(_param) - if (window.GLOB.CacheMap.has(_param)) { + if (cache && window.GLOB.CacheMap.has(_param)) { return Promise.resolve(window.GLOB.CacheMap.get(_param)) } else { param = this.encryptParam(param) -- Gitblit v1.8.0