king
2024-02-03 06a670976e2145a10ea05207041d3cf3164cd380
src/api/index.js
@@ -711,7 +711,7 @@
    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]
@@ -821,7 +821,7 @@
      param = this.encryptParam(param)
      axios({
        url: token.interface,
        url: `${token.interface}${param.func ? '/' + param.func : ''}`,
        method: 'post',
        data: JSON.stringify(param)
      }).then(res => {
@@ -870,7 +870,7 @@
          param = this.encryptParam(param)
          axios({
            url: token.interface,
            url: `${token.interface}${param.func ? '/' + param.func : ''}`,
            method: 'post',
            data: JSON.stringify(param)
          }).then(res => {
@@ -900,7 +900,7 @@
   * @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') || ''
@@ -925,7 +925,25 @@
      }
    }
    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