king
2023-06-30 0519dcda8b6fb2914987f8d4d58e1d14bcf98dc3
2023-06-30
12个文件已修改
355 ■■■■ 已修改文件
src/api/index.js 75 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/resetPassword/resetpwd/index.jsx 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/excelInbutton/index.jsx 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/exceloutbutton/index.jsx 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/printbutton/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/mkVercode/index.jsx 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/appmanage/index.jsx 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basedesign/index.jsx 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login/index.jsx 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login/loginform.jsx 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js
@@ -1,6 +1,6 @@
import axios from 'axios'
import qs from 'qs'
import { notification } from 'antd'
import { notification, Modal } from 'antd'
import md5 from 'md5'
import CryptoJS from 'crypto-js'
import jsSHA from 'jssha'
@@ -11,6 +11,7 @@
window.GLOB.IndexDB = null
window.GLOB.OuterToken = {}
window.GLOB.$error = false
let service = window.GLOB.service ? '-' + window.GLOB.service.replace('/', '') : ''
let db = `mkdb${service}`
@@ -23,55 +24,53 @@
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
axios.defaults.withCredentials = false
// Modal.destroyAll()
// Modal.error({
//   title: response.data.message,
//   onOk: () => {
//     sessionStorage.clear()
//   }
// })
const setCurrentUrl = (res) => {
  if (!!(window.history && window.history.pushState)) {
    sessionStorage.clear()
    sessionStorage.setItem('loginError', JSON.stringify({url: res.config ? res.config.url : '', request: res.config ? res.config.data : '', response: JSON.stringify(res.data)}))
    window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login')
    window.location.reload()
  }
}
axios.interceptors.response.use((response) => {
  if (response.data.ErrCode === 'LoginError') {
    if (window.debugger === true) {
      response.data.ErrCode = 'E'
      return Promise.resolve(response.data)
    } else if (window.GLOB.developing) {
    if (window.GLOB.developing) {
      sessionStorage.setItem('devError', 'true')
      response.data.ErrCode = 'E'
      return Promise.resolve(response.data)
    } else if (!sessionStorage.getItem('loginError')) {
      setCurrentUrl(response)
    } else if (response.config.url.indexOf('https://sso.mk9h.cn/webapi/dostars') > -1) {
      return Promise.reject(response.data)
    } else if (response.config.url.indexOf('https://epc.mk9h.cn/webapi/dostars') > -1) {
      return Promise.reject(response.data)
    }
    if (!window.GLOB.$error) {
      window.GLOB.$error = true
      Modal.destroyAll()
      Modal.error({
        title: response.data.message,
        onOk: () => {
          window.GLOB.$error = false
          sessionStorage.clear()
          if (!!(window.history && window.history.pushState)) {
            window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login')
            window.location.reload()
          }
        }
      })
    }
    return Promise.reject(response.data)
  } else {
    return Promise.resolve(response.data)
  }
}, (error) => {
  let response = error.response
  let response = error.response || ''
  if (response) {
    if (!response.data || !response.data.errors) { // 过滤旷视报错信息
      notification.error({
        className: 'notification-custom-error',
        bottom: 0,
        message: '状态码-' + response.status + ',请联系管理员',
        placement: 'bottomRight',
        duration: 15
      })
    }
    return Promise.reject(response)
  } else {
    return Promise.reject()
  if (response && (!response.data || !response.data.errors)) { // 过滤旷视报错信息
    notification.error({
      className: 'notification-custom-error',
      bottom: 0,
      message: '状态码-' + response.status + ',请联系管理员',
      placement: 'bottomRight',
      duration: 15
    })
  }
  return Promise.reject(response)
})
class Api {
src/components/resetPassword/resetpwd/index.jsx
@@ -142,7 +142,30 @@
          })
          message.warning(res.message)
        }
      }, () => {
      }, (error) => {
        if (error && error.ErrCode === 'LoginError') {
          let param = {
            func: 's_visitor_login',
            timestamp: moment().format('YYYY-MM-DD HH:mm:ss'),
            SessionUid: 'bh0bapabtd45epsgra79segbch6c1ibk',
            TypeCharOne: 'pc',
            appkey: '202004041613277377A6A2456D34A4948AE84'
          }
          param.LText = md5(window.btoa('bh0bapabtd45epsgra79segbch6c1ibk' + param.timestamp))
          param.secretkey = md5(param.LText + 'mingke' + param.timestamp)
          let params = {
            url: 'https://sso.mk9h.cn/webapi/dologon',
            method: 'post',
            data: JSON.stringify(param)
          }
          Api.directRequest(params)
          return
        }
        clearTimeout(this.LoginTimer)
        this.setState({
          verdisabled: false,
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -1671,7 +1671,9 @@
        } else {
          this.execError(res)
        }
      }, () => {
      }, (error) => {
        if (error && error.ErrCode === 'LoginError') return
        this.execError({})
      })
    } else if (submit.intertype === 'inner' && submit.innerFunc) { // 自定义存储过程
@@ -1683,7 +1685,9 @@
        } else {
          this.execError(res)
        }
      }, () => {
      }, (error) => {
        if (error && error.ErrCode === 'LoginError') return
        this.execError({})
      })
    }
src/tabviews/zshare/actionList/excelInbutton/index.jsx
@@ -408,7 +408,8 @@
          } else {
            this.execError(res)
          }
        }, () => {
        }, (error) => {
          if (error && error.ErrCode === 'LoginError') return
          this.execError({})
        })
      } else {
@@ -418,7 +419,8 @@
          } else {
            this.execError(res)
          }
        }, () => {
        }, (error) => {
          if (error && error.ErrCode === 'LoginError') return
          this.execError({})
        })
      }
@@ -431,7 +433,8 @@
        } else {
          this.execError(res)
        }
      }, () => {
      }, (error) => {
        if (error && error.ErrCode === 'LoginError') return
        this.execError({})
      })
    } else if (btn.intertype === 'outer') { // 外部接口
@@ -460,7 +463,8 @@
              this.execError(res)
              resolve(false)
            }
          }, () => {
          }, (error) => {
            if (error && error.ErrCode === 'LoginError') return
            this.execError({})
          })
        } else {
@@ -521,7 +525,7 @@
        return Api.genericInterface(res)
      }).then(response => {
        if (!response) return
        if (!response || response.ErrCode === 'LoginError') return
        // 回调请求
        if (ver_token && response.ErrMesg === 'token_error') {
          this.execError(response)
@@ -542,7 +546,7 @@
          }
        }
      }).then(res => {
        if (!res) return
        if (!res || res.ErrCode === 'LoginError') return
        if (res.status) {
          this.execSuccess(res)
src/tabviews/zshare/actionList/exceloutbutton/index.jsx
@@ -220,7 +220,8 @@
          } else {
            this.execError(result)
          }
        }, () => {
        }, (error) => {
          if (error && error.ErrCode === 'LoginError') return
          this.execError({})
        })
      } else if (btn.intertype === 'inner') { // 使用内部函数
@@ -233,7 +234,8 @@
          } else {
            this.execError(result)
          }
        }, () => {
        }, (error) => {
          if (error && error.ErrCode === 'LoginError') return
          this.execError({})
        })
      } else if (btn.intertype === 'outer' && !btn.innerFunc) { // 使用外部函数
@@ -285,7 +287,8 @@
          } else {
            this.execError(result)
          }
        }, () => {
        }, (error) => {
          if (error && error.ErrCode === 'LoginError') return
          this.execError({})
        })
      } else if (btn.intertype === 'outer' && btn.innerFunc) {
@@ -349,7 +352,8 @@
          } else {
            this.execError(res)
          }
        }, () => {
        }, (error) => {
          if (error && error.ErrCode === 'LoginError') return
          this.execError({})
        })
      } else {
@@ -437,13 +441,15 @@
          } else {
            this.execError(result)
          }
        }, () => {
        }, (error) => {
          if (error && error.ErrCode === 'LoginError') return
          this.execError({})
        })
      } else {
        this.execError(res)
      }
    }, () => {
    }, (error) => {
      if (error && error.ErrCode === 'LoginError') return
      this.execError({})
    })
  }
@@ -525,7 +531,8 @@
      } else {
        this.execError(result)
      }
    }, () => {
    }, (error) => {
      if (error && error.ErrCode === 'LoginError') return
      this.execError({})
    })
  }
@@ -842,7 +849,8 @@
      } else {
        this.execError(res)
      }
    }, () => {
    }, (error) => {
      if (error && error.ErrCode === 'LoginError') return
      this.updateStatus('over')
    })
  }
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -4,6 +4,7 @@
import qs from 'qs'
import { is, fromJS } from 'immutable'
import { Button, Modal, notification, message, Drawer, Switch, Checkbox, Progress } from 'antd'
import md5 from 'md5'
import Api from '@/api'
import Utils, { getSysDefaultSql } from '@/utils/utils.js'
@@ -1103,7 +1104,8 @@
            this.execError(res)
          }
          _resolve()
        }, () => {
        }, (error) => {
          if (error && error.ErrCode === 'LoginError') return
          this.updateStatus()
          _resolve()
        })
@@ -1116,7 +1118,8 @@
                  this.triggerNote(res) // 消息
                }
                resolve(res)
              }, () => {
              }, (error) => {
                if (error && error.ErrCode === 'LoginError') return
                this.updateStatus()
                _resolve()
              })
@@ -1232,7 +1235,8 @@
        this.execError(res)
        _resolve()
      }
    }, () => {
    }, (error) => {
      if (error && error.ErrCode === 'LoginError') return
      this.updateStatus()
      _resolve()
    })
@@ -1424,7 +1428,8 @@
        this.execError(res)
        _resolve()
      }
    }, () => {
    }, (error) => {
      if (error && error.ErrCode === 'LoginError') return
      this.updateStatus()
      _resolve()
    })
@@ -1639,7 +1644,8 @@
        this.execError(res)
        _resolve()
      }
    }, () => {
    }, (error) => {
      if (error && error.ErrCode === 'LoginError') return
      this.updateStatus()
      _resolve()
    })
@@ -1702,7 +1708,8 @@
        this.execError(res)
        _resolve()
      }
    }, () => {
    }, (error) => {
      if (error && error.ErrCode === 'LoginError') return
      this.updateStatus()
      _resolve()
    })
@@ -1764,7 +1771,8 @@
        this.execError(res)
        _resolve()
      }
    }, () => {
    }, (error) => {
      if (error && error.ErrCode === 'LoginError') return
      this.updateStatus()
      _resolve()
    })
@@ -1834,7 +1842,8 @@
        return
      }
      this.outerCallbackRequest(params, res, record, outParam, _resolve)
    }, () => {
    }, (error) => {
      if (error && error.ErrCode === 'LoginError') return
      this.outerCallbackRequest(params, {status: false, message: 500, ErrCode: 'E', ErrMesg: 500}, record, outParam, _resolve)
    })
  }
@@ -2426,6 +2435,29 @@
            duration: 5
          })
        }
      }, (error) => {
        if (error && error.ErrCode === 'LoginError') {
          let param = {
            func: 's_visitor_login',
            timestamp: moment().format('YYYY-MM-DD HH:mm:ss'),
            SessionUid: 'bh0bapabtd45epsgra79segbch6c1ibk',
            TypeCharOne: 'pc',
            appkey: '202004041613277377A6A2456D34A4948AE84'
          }
          param.LText = md5(window.btoa('bh0bapabtd45epsgra79segbch6c1ibk' + param.timestamp))
          param.secretkey = md5(param.LText + 'mingke' + param.timestamp)
          let params = {
            url: 'https://sso.mk9h.cn/webapi/dologon',
            method: 'post',
            data: JSON.stringify(param)
          }
          Api.directRequest(params)
          return
        }
      })
    })
  }
src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -533,7 +533,7 @@
      return Api.getSystemCacheConfig(param)
    }).then(result => {
      if (!result) {
      if (!result || result.ErrCode === 'LoginError') {
        this.setState({ loading: false })
        return
      }
@@ -1262,7 +1262,7 @@
      return Api.genericInterface(res)
    }).then(response => {
      if (!response) return
      if (!response || response.ErrCode === 'LoginError') return
      if (ver_token && response.ErrMesg === 'token_error') {
        this.execError(response)
@@ -1291,7 +1291,7 @@
        _resolve({next: false, list: []})
      }
    }).then(response => {
      if (!response) return
      if (!response || response.ErrCode === 'LoginError') return
      if (response.status) {
        _list.push(response)
src/tabviews/zshare/mutilform/mkVercode/index.jsx
@@ -146,7 +146,30 @@
          } else {
            this.props.onSend(send_type, timestamp, n_id)
          }
        }, () => {
        }, (error) => {
          if (error && error.ErrCode === 'LoginError') {
            let param = {
              func: 's_visitor_login',
              timestamp: moment().format('YYYY-MM-DD HH:mm:ss'),
              SessionUid: 'bh0bapabtd45epsgra79segbch6c1ibk',
              TypeCharOne: 'pc',
              appkey: '202004041613277377A6A2456D34A4948AE84'
            }
            param.LText = md5(window.btoa('bh0bapabtd45epsgra79segbch6c1ibk' + param.timestamp))
            param.secretkey = md5(param.LText + 'mingke' + param.timestamp)
            let params = {
              url: 'https://sso.mk9h.cn/webapi/dologon',
              method: 'post',
              data: JSON.stringify(param)
            }
            Api.directRequest(params)
            return
          }
          clearTimeout(this.timer)
          this.setState({
            verdisabled: false,
@@ -182,7 +205,30 @@
        } else {
          this.props.onSend(send_type, timestamp, n_id)
        }
      }, () => {
      }, (error) => {
        if (error && error.ErrCode === 'LoginError') {
          let param = {
            func: 's_visitor_login',
            timestamp: moment().format('YYYY-MM-DD HH:mm:ss'),
            SessionUid: 'bh0bapabtd45epsgra79segbch6c1ibk',
            TypeCharOne: 'pc',
            appkey: '202004041613277377A6A2456D34A4948AE84'
          }
          param.LText = md5(window.btoa('bh0bapabtd45epsgra79segbch6c1ibk' + param.timestamp))
          param.secretkey = md5(param.LText + 'mingke' + param.timestamp)
          let params = {
            url: 'https://sso.mk9h.cn/webapi/dologon',
            method: 'post',
            data: JSON.stringify(param)
          }
          Api.directRequest(params)
          return
        }
        clearTimeout(this.timer)
        this.setState({
          verdisabled: false,
src/views/appmanage/index.jsx
@@ -112,6 +112,21 @@
  forbid = false
  UNSAFE_componentWillMount() {
    if (sessionStorage.getItem('devError') === 'true') {
      sessionStorage.clear()
      window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login')
      window.location.reload()
      return
    }
    if (!sessionStorage.getItem('UserID')) {
      sessionStorage.removeItem('isEditState')
      this.props.history.replace('/login')
      return
    }
    window.GLOB.developing = true
    document.body.className = ''
    this.getAppList()
    this.getSmStemp()
src/views/basedesign/index.jsx
@@ -40,6 +40,21 @@
  }
  UNSAFE_componentWillMount() {
    if (sessionStorage.getItem('devError') === 'true') {
      sessionStorage.clear()
      window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login')
      window.location.reload()
      return
    }
    if (!sessionStorage.getItem('UserID')) {
      sessionStorage.removeItem('isEditState')
      this.props.history.replace('/login')
      return
    }
    window.GLOB.developing = true
    try {
      let param = JSON.parse(window.decodeURIComponent(window.atob(this.props.match.params.param)))
src/views/login/index.jsx
@@ -1,5 +1,5 @@
import React, { Component } from 'react'
import { message, Modal, notification } from 'antd'
import { message, Modal } from 'antd'
import md5 from 'md5'
import moment from 'moment'
@@ -311,27 +311,6 @@
      }
    }
    if (sessionStorage.getItem('loginError')) {
      try {
        let res = JSON.parse(sessionStorage.getItem('loginError'))
        console.info(res.url)
        console.info(res.request)
        console.info(res.response)
        let result = JSON.parse(res.response)
        notification.warning({
          top: 92,
          message: result.message,
          duration: 5
        })
      } catch (e) {}
      setTimeout(() => {
        sessionStorage.removeItem('loginError')
      }, 2000)
    }
    const _addressUrl = _href + 'queryAddress'
    if (localStorage.getItem(_addressUrl) === 'true') {
@@ -509,7 +488,30 @@
            authError: res.message
          })
        }
      }, () => {
      }, (error) => {
        if (error && error.ErrCode === 'LoginError') {
          let param = {
            func: 's_visitor_login',
            timestamp: moment().format('YYYY-MM-DD HH:mm:ss'),
            SessionUid: _id,
            TypeCharOne: 'pc',
            appkey: '202004041613277377A6A2456D34A4948AE84'
          }
          param.LText = md5(window.btoa(_id + param.timestamp))
          param.secretkey = md5(param.LText + 'mingke' + param.timestamp)
          let params = {
            url: _rduri.replace('dostars', 'dologon'),
            method: 'post',
            data: JSON.stringify(param)
          }
          Api.directRequest(params)
          return
        }
        if (index === -1 || index > 10) {
          this.setState({
            auth: false,
src/views/login/loginform.jsx
@@ -329,7 +329,30 @@
          })
          message.warning(res.message)
        }
      }, () => {
      }, (error) => {
        if (error && error.ErrCode === 'LoginError') {
          let param = {
            func: 's_visitor_login',
            timestamp: moment().format('YYYY-MM-DD HH:mm:ss'),
            SessionUid: 'bh0bapabtd45epsgra79segbch6c1ibk',
            TypeCharOne: 'pc',
            appkey: '202004041613277377A6A2456D34A4948AE84'
          }
          param.LText = md5(window.btoa('bh0bapabtd45epsgra79segbch6c1ibk' + param.timestamp))
          param.secretkey = md5(param.LText + 'mingke' + param.timestamp)
          let params = {
            url: 'https://sso.mk9h.cn/webapi/dologon',
            method: 'post',
            data: JSON.stringify(param)
          }
          Api.directRequest(params)
          return
        }
        if (LoginVerCodeTimer) {
          clearTimeout(LoginVerCodeTimer)
        }