| | |
| | | |
| | | return Promise.reject(response.data) |
| | | } else { |
| | | if (response.config.requestId) { |
| | | response.data.$requestId = response.config.requestId |
| | | } |
| | | return Promise.resolve(response.data) |
| | | } |
| | | }, (error) => { |
| | |
| | | |
| | | this.getSystemConfig(param).then(res => { |
| | | if (!res.status) { |
| | | reject() |
| | | reject(res.message) |
| | | return |
| | | } |
| | | |
| | |
| | | |
| | | CacheUtils.updateIndexDBversion({version: res.app_version || '1.00', createDate: curTime}) |
| | | |
| | | resolve() |
| | | resolve(list) |
| | | }) |
| | | }, () => { |
| | | reject() |
| | |
| | | * @description 获取业务通用接口 |
| | | * 访问 'https://sso.mk9h.cn/webapi/dostars'或云端时,传入userid、LoginUID |
| | | */ |
| | | 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') || '' |
| | |
| | | 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 |
| | |
| | | return axios({ |
| | | url: `${url}${param.func ? '/' + param.func : ''}`, |
| | | method: 'post', |
| | | data: JSON.stringify(param) |
| | | data: JSON.stringify(param), |
| | | requestId |
| | | }) |
| | | } |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @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', |
| | |
| | | appkey: window.GLOB.appkey || '' |
| | | } |
| | | |
| | | let id = Utils.getuuid() |
| | | sql = sql.replace(/@time_id@/ig, `'${id}'`) |
| | | sql = sql.replace(/@time_id@/ig, `'${Utils.getuuid()}'`) |
| | | sql = sql.replace(/@ID@/ig, `'${Utils.getuuid()}'`) |
| | | sql = sql.replace(/@BID@/ig, `'${Utils.getuuid()}'`) |
| | | sql = sql.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID')}'`) |
| | | 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(/@datam@/ig, `''`) |
| | | |
| | | if (window.GLOB.externalDatabase !== null) { |
| | | sql = sql.replace(/@db@/ig, window.GLOB.externalDatabase) |
| | | } |