From 91e232bb0b910f3670bdbccd65cc218d55e1eda9 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 06 十二月 2022 16:08:20 +0800 Subject: [PATCH] Merge branch 'develop' --- src/api/index.js | 54 ++++++++++++++++++++++++++++++------------------------ 1 files changed, 30 insertions(+), 24 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 2623ef3..8a542d5 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -32,7 +32,7 @@ axios.defaults.withCredentials = false axios.interceptors.request.use((config) => { - if (config.url.includes('LoginAndRedirect') || config.url.includes('getjsonresult') || config.url.includes('wxNativePay')) { + if (/LoginAndRedirect|getjsonresult|wxNativePay|postek/ig.test(config.url)) { config.data = qs.stringify(config.data) } else if (/\/doupload|\/dopreload|\/upload/.test(config.url)) { config.headers = { 'Content-Type': 'multipart/form-data' } @@ -219,7 +219,8 @@ timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), SessionUid: _SessionUid, TypeCharOne: 'pc', - kei_id: window.btoa(window.encodeURIComponent(window.GLOB.host)) + kei_id: window.btoa(window.encodeURIComponent(window.GLOB.host)), + appkey: window.GLOB.appkey || '' } let url = '/webapi/dologon/s_visitor_login' @@ -253,8 +254,6 @@ param.v_type = param.v_type || 'Y' param.secretkey = md5(param.LText + solt + param.timestamp) - param.appkey = window.GLOB.appkey || '' - return axios({ url: url, method: 'post', @@ -277,10 +276,9 @@ login_city: city, login_id_address: ipAddress, kei_id: window.btoa(window.encodeURIComponent(window.GLOB.host)), - device_id: localStorage.getItem('SessionUid') + device_id: localStorage.getItem('SessionUid'), + appkey: window.GLOB.appkey || '' } - - param.appkey = window.GLOB.appkey || '' let url = '/webapi/dologon' if (isCloud) { @@ -314,10 +312,10 @@ login_city: city, login_id_address: ipAddress, kei_id: window.btoa(window.encodeURIComponent(window.GLOB.host)), - device_id: localStorage.getItem('SessionUid') + device_id: localStorage.getItem('SessionUid'), + timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), + appkey: window.GLOB.appkey || '' } - - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') let sys_datetime = sessionStorage.getItem('sys_datetime') let app_datetime = sessionStorage.getItem('app_datetime') @@ -342,20 +340,17 @@ // Type: 'X' 鏃� // param.Password = Utils.formatOptions(password) - param.appkey = window.GLOB.appkey || '' let url = '/webapi/dologon' if (isCloud) { param.debug = 'Y' if (options.cloudServiceApi) { - // url = options.cloudServiceApi.replace(/\/webapi(.*)/, '/webapi/dologon') param.rduri = options.cloudServiceApi.replace(/\/webapi(.*)/, '/webapi/dologon') } } else if (window.GLOB.mainSystemApi) { if (options.sysType !== 'cloud' && window.GLOB.systemType !== 'production') { param.linkurl = window.GLOB.linkurl } - // url = window.GLOB.mainSystemApi.replace(/\/webapi(.*)/, '/webapi/dologon') param.rduri = window.GLOB.mainSystemApi.replace(/\/webapi(.*)/, '/webapi/dologon') } @@ -802,12 +797,15 @@ delete param.rduri } - let _param = JSON.parse(JSON.stringify(param)) // 缂撳瓨鏍¢獙锛屽幓闄ゆ椂闂村拰鍔犲瘑瀛楃 - delete _param.timestamp - delete _param.secretkey - delete _param.open_key - _param = JSON.stringify(_param) - _param = md5(_param) + let _param = '' + if (cache) { + _param = JSON.parse(JSON.stringify(param)) // 缂撳瓨鏍¢獙锛屽幓闄ゆ椂闂村拰鍔犲瘑瀛楃 + delete _param.timestamp + delete _param.secretkey + delete _param.open_key + _param = JSON.stringify(_param) + _param = md5(_param) + } if (cache && window.GLOB.CacheMap.has(_param)) { return Promise.resolve(window.GLOB.CacheMap.get(_param)) @@ -891,17 +889,17 @@ UserName: token.username, systemType: options.sysType, login_city: sessionStorage.getItem('city') || '', - device_id: localStorage.getItem('SessionUid') + device_id: token.appkey || '', + timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), + Type: token.publicKey, + appkey: token.appkey || '' } - _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - - _param.Type = token.publicKey let shaObj = new jsSHA('SHA-1', 'TEXT') shaObj.update(token.password) _param.Password = shaObj.getHash('HEX').toUpperCase() _param.Password = md5(token.privateKey + token.username + _param.Password + _param.timestamp) - _param.appkey = token.appkey || '' + let url = token.interface.replace(/\/webapi(.*)/, '/webapi/dologon') if (token.ssoInterface) { @@ -1186,6 +1184,14 @@ }) } + postekPrint (data) { + return axios({ + url: 'http://127.0.0.1:888/postek/print', + method: 'post', + data: data + }) + } + // /** // * @description 鏂囦欢涓婁紶 // */ -- Gitblit v1.8.0