king
2024-01-18 162440a345abe2432df48b933bb858e6f1b56449
src/api/index.js
@@ -834,7 +834,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') || ''
@@ -859,7 +859,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