| | |
| | | param.sign = md5(values) |
| | | param.t = new Date().getTime(); |
| | | |
| | | ['arr_field', 'LText_field', 'custom_script', 'LText1', 'LText', 'LText2', 'DateCount'].forEach(key => { |
| | | ['arr_field', 'custom_script', 'LText', 'DateCount'].forEach(key => { |
| | | if (param[key]) { |
| | | let val = param[key] |
| | | delete param[key] |
| | |
| | | param = this.encryptParam(param) |
| | | |
| | | axios({ |
| | | url: token.interface, |
| | | url: `${token.interface}${param.func ? '/' + param.func : ''}`, |
| | | method: 'post', |
| | | data: JSON.stringify(param) |
| | | }).then(res => { |
| | |
| | | param = this.encryptParam(param) |
| | | |
| | | axios({ |
| | | url: token.interface, |
| | | url: `${token.interface}${param.func ? '/' + param.func : ''}`, |
| | | method: 'post', |
| | | data: JSON.stringify(param) |
| | | }).then(res => { |
| | |
| | | * @description 获取业务通用接口 |
| | | * 访问 'https://sso.mk9h.cn/webapi/dostars'或云端时,传入userid、LoginUID |
| | | */ |
| | | genericInterface (param) { |
| | | genericInterface (param, script = '', position) { |
| | | param.userid = param.userid || sessionStorage.getItem('UserID') || '' |
| | | param.lang = param.lang || sessionStorage.getItem('lang') || '' |
| | | param.SessionUid = localStorage.getItem('SessionUid') || '' |
| | |
| | | } |
| | | } |
| | | |
| | | if (param.$login) { |
| | | 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) |
| | | |
| | | if (promise instanceof Promise) { |
| | | return promise |
| | | } |
| | | } catch (e) { |
| | | console.warn(e) |
| | | } |
| | | |
| | | return Promise.resolve({ |
| | | status: false, |
| | | message: '自定义脚本执行错误', |
| | | ErrCode: 'E' |
| | | }) |
| | | } else if (param.$login) { |
| | | let rduri = param.rduri || '' |
| | | |
| | | delete param.$login |