king
2022-04-27 1072f0d4d3390d4b4923f3c7e407731817660780
2022-04-27
7个文件已修改
1个文件已添加
389 ■■■■ 已修改文件
public/options.json 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/index.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/options.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/cardcellList/index.jsx 116 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login/index.jsx 146 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login/logincodeform.jsx 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sso/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/options.json
@@ -1,18 +1,18 @@
{
  "appId": "201912040924165801464FF1788654BC5AC73",
  "appkey": "20191106103859640976D6E924E464D029CF0",
  "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars",
  "appId": "201912101635586033882D350DED94BC08AB8",
  "appkey": "2019120316231227060CDBAFCB3BF4582BBF8",
  "mainSystemApi": "",
  "systemType": "",
  "externalDatabase": "false",
  "externalDatabase": "",
  "lineColor": "",
  "filter": "false",
  "defaultApp": "mk",
  "defaultApp": "",
  "defaultLang": "zh-CN",
  "WXAppID": "",
  "debugger": false,
  "licenseKey": "",
  "probation": "",
  "keepPassword": "true",
  "host": "http://qingqiumarket.cn",
  "service": "MKWMS/"
  "host": "https://css-test.positecgroup.com",
  "service": ""
}
src/api/index.js
@@ -265,6 +265,11 @@
    // Type: 'X' 时
    // param.Password = Utils.formatOptions(password)
    // positecgroup
    if (window.GLOB.appkey === '202011021844144334E823A3011414082AD77') {
      param.svccode = 'oms'
    }
    param.appkey = window.GLOB.appkey || ''
    let url = '/webapi/dologon'
@@ -290,6 +295,36 @@
  }
  /**
   * @description 登录二次验证 // positecgroup
   */
  verifycode (verify) {
    let param = {
      certificate: 'certificate',
      captcha: verify.code,
      token: verify.token,
      ati: verify.ati,
      vid: verify.vid,
      uid: verify.uid,
      shopId: verify.shopId,
      loginId: verify.loginId,
      phone: verify.phone,
      sellerNick: verify.sellerNick,
      isRisk: verify.isRisk,
      requestId: verify.requestId,
      riskNum: verify.riskNum,
      username: verify.username
    }
    let url = '/webapi/dologon'
    return axios({
      url,
      method: 'post',
      data: param
    })
  }
  /**
   * @description 获取系统版本信息,启用或更新websql
   */
  getAppVersion (_resolve, _reject) {
src/index.js
@@ -99,9 +99,9 @@
      GLOB.probation = true
      GLOB.systemType = ''
      // GLOB.mainSystemApi = 'https://cloud.positecgroup.com/webapi/dostars'
      GLOB.mainSystemApi = 'https://cloud.positecgroup.com/webapi/dostars'
      GLOB.mainSystemApi = 'http://sso.mk9h.cn/cloud/webapi/dostars'
      // GLOB.mainSystemApi = 'http://sso.mk9h.cn/cloud/webapi/dostars'
      if (GLOB.watermark) {
        GLOB.dataFormat = true
@@ -176,7 +176,7 @@
      }
    }
    if (/^https/.test(window.location.protocol)) { // https转换
    if (/^https/.test(window.location.protocol) || (process.env.NODE_ENV !== 'production' && /^https/.test(config.host))) { // https转换
      let meta = document.createElement('meta')
      meta.content = 'upgrade-insecure-requests'
      meta.httpEquiv = 'Content-Security-Policy'
src/store/options.js
@@ -9,7 +9,7 @@
  sysType: 'bG9j$mkYWw=',
  caId: 'MjAyMDAxMTYxMjMzMzU1MDd$mkGQzkyMzI1Rjk4MDY0QUNGQjQ2Mg==',
  cakey: 'MjAyMDAxMTYxMjQwMDQ2NDM$mk2N0QzODE2MjExNUI0MTc4OTVDMQ==',
  cdomain: 'aHR0cHM6Ly9jbG91$mkZC5tazloLmNu'
  cdomain: 'aHR0cHM6Ly9jbG91ZC5$mkwb3NpdGVjZ3JvdXAuY29t'
}
/**
src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -4,7 +4,7 @@
import { Col, Tooltip, notification } from 'antd'
import moment from 'moment'
// import Api from '@/api'
import Api from '@/api'
import asyncComponent from './asyncButtonComponent'
import asyncElementComponent from '@/utils/asyncComponent'
import { getMark } from '@/utils/utils.js'
@@ -106,68 +106,68 @@
    }
    // positecgroup
    // if (/^sso$/ig.test(url)) {
    //   if (!data.LinkUrl1) {
    //     notification.warning({
    //       top: 92,
    //       message: '链接地址不存在!',
    //       duration: 5
    //     })
    //     return
    //   }
    if (/^sso$/ig.test(url)) {
      if (!data.LinkUrl1) {
        notification.warning({
          top: 92,
          message: '链接地址不存在!',
          duration: 5
        })
        return
      }
    //   let _url = data.LinkUrl1
    //   if (/index\.html/ig.test(_url)) {
    //     _url = _url.replace(/index\.html.*/ig, '')
    //   } else if (!/\/$/ig.test(_url)) {
    //     _url = _url + '/'
    //   }
      let _url = data.LinkUrl1
      if (/index\.html/ig.test(_url)) {
        _url = _url.replace(/index\.html.*/ig, '')
      } else if (!/\/$/ig.test(_url)) {
        _url = _url + '/'
      }
    //   let key = (() => {
    //     let uuid = []
    //     let timestamp = new Date().getTime()
    //     let _options = '0123456789abcdefghigklmnopqrstuv'
    //     for (let i = 0; i < 19; i++) {
    //       uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1))
    //     }
    //     uuid = timestamp + uuid.join('')
    //     return uuid
    //   })()
      let key = (() => {
        let uuid = []
        let timestamp = new Date().getTime()
        let _options = '0123456789abcdefghigklmnopqrstuv'
        for (let i = 0; i < 19; i++) {
          uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1))
        }
        uuid = timestamp + uuid.join('')
        return uuid
      })()
    //   let _param = {
    //     func: 'webapi_scan_binding_key',
    //     binding_type: 'mk',
    //     scan_type: 'toggle',
    //     scan_appkey: data.scan_appkey || '',
    //     id: key
    //   }
      let _param = {
        func: 'webapi_scan_binding_key',
        binding_type: 'mk',
        scan_type: 'toggle',
        scan_appkey: data.scan_appkey || '',
        id: key
      }
  
    //   Api.getSystemConfig(_param).then(res => {
    //     if (!res.status) {
    //       notification.warning({
    //         top: 92,
    //         message: res.message,
    //         duration: 5
    //       })
    //     } else if (res.thd_party_appid && res.thd_party_member_id && res.thd_party_openid) {
    //       let href = _url + 'admin/index.html#/ssologin/' + window.btoa(window.encodeURIComponent(JSON.stringify({
    //         appid: res.thd_party_appid,
    //         memberId: res.thd_party_member_id,
    //         openid: res.thd_party_openid,
    //         key: key
    //       })))
      Api.getSystemConfig(_param).then(res => {
        if (!res.status) {
          notification.warning({
            top: 92,
            message: res.message,
            duration: 5
          })
        } else if (res.thd_party_appid && res.thd_party_member_id && res.thd_party_openid) {
          let href = _url + 'admin/index.html#/ssologin/' + window.btoa(window.encodeURIComponent(JSON.stringify({
            appid: res.thd_party_appid,
            memberId: res.thd_party_member_id,
            openid: res.thd_party_openid,
            key: key
          })))
  
    //       window.open(href)
    //     } else {
    //       notification.warning({
    //         top: 92,
    //         message: '信息缺失,请联系管理员!',
    //         duration: 5
    //       })
    //     }
    //   })
    //   return
    // }
          window.open(href)
        } else {
          notification.warning({
            top: 92,
            message: '信息缺失,请联系管理员!',
            duration: 5
          })
        }
      })
      return
    }
    let Id = ''
    let con = '?'
src/views/login/index.jsx
@@ -17,6 +17,7 @@
const LoginForm = asyncLoadComponent(() => import('./loginform'))
const Resetpwd = asyncLoadComponent(() => import('@/components/header/resetpwd'))
const LoginCloudForm = asyncComponent(() => import('./logincloudform'))
const LoginCodeForm = asyncComponent(() => import('./logincodeform'))
const iszhCN = sessionStorage.getItem('lang') !== 'en-US'
const _href = window.location.href.split('#')[0]
@@ -103,6 +104,16 @@
        localStorage.setItem(_href, window.btoa(window.encodeURIComponent(JSON.stringify({username: param.username, password: param.password}))))
      } else {
        localStorage.removeItem(_href)
      }
      // positecgroup
      if (res.token) {
        this.setState({
          isDisabled: false,
          verify: {...res, $password: param.password},
          codeVisible: true
        })
        return
      }
      let level = localStorage.getItem(_href + 'pwdlevel')
@@ -512,10 +523,10 @@
        Api.getSystemConfig(_param).then(res => {
          if (res.status) {
            // positecgroup
            // res.Banner = res.Banner ? res.Banner.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''
            // res.doclogo = res.doclogo ? res.doclogo.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''
            // res.indexlogo = res.indexlogo ? res.indexlogo.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''
            // res.loginlogo = res.loginlogo ? res.loginlogo.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''
            res.Banner = res.Banner ? res.Banner.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''
            res.doclogo = res.doclogo ? res.doclogo.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''
            res.indexlogo = res.indexlogo ? res.indexlogo.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''
            res.loginlogo = res.loginlogo ? res.loginlogo.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''
            let _url = _href + 'system'
            let systemMsg = {
@@ -624,32 +635,32 @@
            }
            // positecgroup
            // if (res.users_upt === 'true' && window.GLOB.systemType === 'production') {
            //   Api.getLocalConfig ({
            //     func: 's_Get_local_u_deleted',
            //     users_upt_date: res.users_upt_date,
            //     userid: result.UserID,
            //     LoginUID: result.LoginUID
            //   }).then(localres => {
            //     if (!localres.status) return
            //     Api.getSystemConfig({
            //       func: 's_get_sso_u_create',
            //       user_ids: localres.user_ids,
            //       user_ids_local: localres.user_ids_local,
            //       users_upt_date: localres.users_upt_date,
            //       userid: result.UserID,
            //       LoginUID: result.LoginUID
            //     }).then(ssores => {
            //       if (!ssores.status) return
            //       Api.getLocalConfig ({
            //         func: 's_get_local_u_create',
            //         user_ids_local: ssores.user_ids_local,
            //         userid: result.UserID,
            //         LoginUID: result.LoginUID
            //       })
            //     })
            //   })
            // }
            if (res.users_upt === 'true' && window.GLOB.systemType === 'production') {
              Api.getLocalConfig ({
                func: 's_Get_local_u_deleted',
                users_upt_date: res.users_upt_date,
                userid: result.UserID,
                LoginUID: result.LoginUID
              }).then(localres => {
                if (!localres.status) return
                Api.getSystemConfig({
                  func: 's_get_sso_u_create',
                  user_ids: localres.user_ids,
                  user_ids_local: localres.user_ids_local,
                  users_upt_date: localres.users_upt_date,
                  userid: result.UserID,
                  LoginUID: result.LoginUID
                }).then(ssores => {
                  if (!ssores.status) return
                  Api.getLocalConfig ({
                    func: 's_get_local_u_create',
                    user_ids_local: ssores.user_ids_local,
                    userid: result.UserID,
                    LoginUID: result.LoginUID
                  })
                })
              })
            }
          } else {
            message.warning(res.message)
          }
@@ -753,6 +764,66 @@
        }
      })
    })
  }
  codeSubmit = () => {
    const { verify } = this.state
    this.codeRef.handleConfirm().then(res => {
      this.setState({
        codeLoading: true
      })
      Api.verifycode({...verify, code: res.code}).then(result => {
        this.setState({
          codeVisible: false,
          codeLoading: false
        })
        if (result.verifyResult === 'success') {
          let level = localStorage.getItem(_href + 'pwdlevel')
          if (level) {
            let visible = false
            let tip = '密码强度不够,请修改密码!'
            if (verify.$password.length < 8) {
              visible = true
            } else if (level === 'letter_num' && /^([^0-9]*|[^a-zA-Z]*)$/.test(verify.$password)) {
              visible = true
            } else if ((level === 'char_num' || level === 'char_num_90') && /^([^0-9]*|[^a-zA-Z]*|[^!@#$%^&*()_]*)$/.test(verify.$password)) {
              visible = true
            } else if (level === 'char_num_90' && verify.modifydate) {
              let s = (new Date().getTime() - new Date(verify.modifydate).getTime()) / (1000 * 24 * 60 * 60)
              if (!isNaN(s) && s > 90) {
                visible = true
                tip = '您已90天未修改密码,请更换密码后使用!'
              }
            }
            if (visible) {
              message.warning(tip)
              this.setState({
                isDisabled: false,
                visible: true
              })
              return
            }
          }
          let _history = sessionStorage.getItem('history')
          if (_history) {
            sessionStorage.removeItem('history')
            // 查看是否为其他页面跳转,路径存在时,跳回原页面
            this.props.history.replace(_history)
          } else {
            this.props.history.replace('/main')
          }
        } else {
          notification.warning({
            top: 92,
            message: '验证码无效,请重新登录!',
            duration: 5
          })
        }
      })
    }, () => {})
  }
  resetPwdSubmit = () => {
@@ -862,12 +933,27 @@
          cancelText={this.state.dict['login.cancel']}
          visible={this.state.visible}
          onOk={this.resetPwdSubmit}
          maskClosable={false}
          confirmLoading={this.state.resetLoading}
          onCancel={() => this.setState({visible: false, resetLoading: false})}
          destroyOnClose
        >
          <Resetpwd wrappedComponentRef={(inst) => this.formRef = inst} resetPwdSubmit={this.resetPwdSubmit}/>
        </Modal>
        {/* 二次验证 */}
        <Modal
          title="二次验证"
          okText={this.state.dict['login.ok']}
          cancelText={this.state.dict['login.cancel']}
          visible={this.state.codeVisible}
          onOk={this.codeSubmit}
          maskClosable={false}
          confirmLoading={this.state.codeLoading}
          onCancel={() => this.setState({codeVisible: false, codeLoading: false})}
          destroyOnClose
        >
          <LoginCodeForm verify={this.state.verify} wrappedComponentRef={(inst) => this.codeRef = inst} handleSubmit={this.codeSubmit}/>
        </Modal>
      </div>
    )
  }
src/views/login/logincodeform.jsx
New file
@@ -0,0 +1,62 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Input } from 'antd'
import './index.scss'
class CodeForm extends Component {
  static propTpyes = {
    handleSubmit: PropTypes.func,
    verify: PropTypes.object
  }
  state = {}
  handleConfirm = () => {
    // 表单提交时检查输入值是否正确
    return new Promise((resolve, reject) => {
      this.props.form.validateFieldsAndScroll((err, values) => {
        if (!err) {
          resolve(values)
        } else {
          reject(err)
        }
      })
    })
  }
  componentDidMount () {
    const input = document.getElementById('code')
    if (input) {
      input.focus()
    }
  }
  render() {
    const { verify } = this.props
    const { getFieldDecorator } = this.props.form
    let phone = verify.phone
    phone = phone.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2')
    return (
      <Form style={{margin: '0px 10px'}}>
        <Form.Item label="手机号" labelCol={{style: {width: '33%'}}} wrapperCol={{style: {display: 'inline-block', width: '55%'}}}>
          {phone}
        </Form.Item>
        <Form.Item label="验证码" help={<span style={{fontSize: '12px'}}>信息已发送,请查看手机短信。</span>} labelCol={{style: {verticalAlign: 'top',width: '33%'}}} wrapperCol={{style: {display: 'inline-block', width: '55%'}}}>
          {getFieldDecorator('code', {
            initialValue: '',
            rules: [
              {
                required: true,
                message: '请输入验证码!',
              }
            ]
          })(<Input onPressEnter={(e) => {this.props.handleSubmit()}} placeholder="验证码" />)}
        </Form.Item>
      </Form>
    )
  }
}
export default Form.create()(CodeForm)
src/views/sso/index.jsx
@@ -66,10 +66,10 @@
    Api.getSystemConfig(_param).then(res => {
      if (res.status) {
        // positecgroup
        // res.Banner = res.Banner ? res.Banner.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''
        // res.doclogo = res.doclogo ? res.doclogo.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''
        // res.indexlogo = res.indexlogo ? res.indexlogo.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''
        // res.loginlogo = res.loginlogo ? res.loginlogo.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''
        res.Banner = res.Banner ? res.Banner.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''
        res.doclogo = res.doclogo ? res.doclogo.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''
        res.indexlogo = res.indexlogo ? res.indexlogo.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''
        res.loginlogo = res.loginlogo ? res.loginlogo.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''
        const _href = window.location.href.split('#')[0]
        let _url = _href + 'system'