From ed719ec5d86d3373ee95df8262eba3f456f94d60 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 12 六月 2024 17:28:09 +0800 Subject: [PATCH] 2024-06-12 --- src/api/index.js | 38 +++++++++++++++++++++++++++----------- 1 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 27f1e1f..fcf4748 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -57,6 +57,9 @@ return Promise.reject(response.data) } else { + if (response.config.requestId) { + response.data.$requestId = response.config.requestId + } return Promise.resolve(response.data) } }, (error) => { @@ -398,7 +401,7 @@ this.getSystemConfig(param).then(res => { if (!res.status) { - reject() + reject(res.message) return } @@ -438,7 +441,7 @@ CacheUtils.updateIndexDBversion({version: res.app_version || '1.00', createDate: curTime}) - resolve() + resolve(list) }) }, () => { reject() @@ -834,7 +837,7 @@ * @description 鑾峰彇涓氬姟閫氱敤鎺ュ彛 * 璁块棶 'https://sso.mk9h.cn/webapi/dostars'鎴栦簯绔椂锛屼紶鍏serid銆丩oginUID */ - genericInterface (param, script = '', position) { + genericInterface (param, script = '', position, requestId = '') { param.userid = param.userid || sessionStorage.getItem('UserID') || '' param.lang = param.lang || sessionStorage.getItem('lang') || '' param.SessionUid = localStorage.getItem('SessionUid') || '' @@ -862,8 +865,8 @@ if (script) { try { // eslint-disable-next-line - let func = new Function('axios', 'Api', 'param', 'position', 'systemType', script) - let promise = func(axios, this, param, position, window.GLOB.systemType) + let func = new Function('axios', 'Api', 'param', 'position', 'systemType', 'notification', script) + let promise = func(axios, this, param, position, window.GLOB.systemType, notification) if (promise instanceof Promise) { return promise @@ -947,7 +950,8 @@ return axios({ url: `${url}${param.func ? '/' + param.func : ''}`, method: 'post', - data: JSON.stringify(param) + data: JSON.stringify(param), + requestId }) } } @@ -1057,6 +1061,21 @@ }) } + /** + * @description 寰俊鏀粯閫�娆� + */ + setRefund (orderId) { + let _param = new FormData() + _param.append('out_biz_no', orderId) + + return axios({ + url: '/wxpay/wxRefund', + headers: { 'Content-Type': 'multipart/form-data' }, + method: 'post', + data: _param + }) + } + postekPrint (data) { return axios({ url: 'http://127.0.0.1:888/postek/print', @@ -1068,7 +1087,7 @@ /** * @description sql妫�楠� */ - sDebug (sql, rduri = null) { + sDebug (sql) { let param = { func: 's_debug_sql', exec_type: window.GLOB.execType || 'y', @@ -1087,6 +1106,7 @@ sql = sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid')}'`) sql = sql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID')}'`) sql = sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey}'`) + sql = sql.replace(/@lang@/ig, `'${sessionStorage.getItem('lang')}'`) // sql = sql.replace(/@datam@/ig, `''`) if (window.GLOB.externalDatabase !== null) { @@ -1103,10 +1123,6 @@ param = this.encryptParam(param) let url = '/webapi/dostars' - - if (rduri) { - url = rduri - } let timer = setTimeout(() => { let _param = { -- Gitblit v1.8.0