| | |
| | | syncApp: false, |
| | | loginWays: null, |
| | | touristLogin: false, |
| | | syncing: false |
| | | syncing: false, |
| | | ipAddress: '', |
| | | city: '' |
| | | } |
| | | |
| | | changelang (item) { |
| | |
| | | * @param {Object} param 用户名密码等信息 |
| | | */ |
| | | async loginsubmit (param) { |
| | | const { ipAddress, city } = this.state |
| | | if (options.sysType === 'local' && !window.GLOB.mainSystemApi) { // 业务系统必须设置单点地址 |
| | | Modal.warning({ |
| | | title: '未设置单点服务器地址,请联系管理员!' |
| | |
| | | } |
| | | |
| | | // 登录提交 |
| | | let res = await Api.getusermsg(param.username, param.password) |
| | | let res = await Api.getusermsg(param.username, param.password, false, ipAddress, city) |
| | | if (res.status) { |
| | | sessionStorage.setItem('UserID', res.UserID) |
| | | sessionStorage.setItem('LoginUID', res.LoginUID) |
| | |
| | | } |
| | | |
| | | async phoneloginsubmit (param) { |
| | | const { ipAddress, city } = this.state |
| | | if (options.sysType === 'local' && !window.GLOB.mainSystemApi) { // 业务系统必须设置单点地址 |
| | | Modal.warning({ |
| | | title: '未设置单点服务器地址,请联系管理员!' |
| | |
| | | } |
| | | |
| | | // 登录提交 |
| | | let res = await Api.getphoneusermsg(param.phone, param.vercode) |
| | | let res = await Api.getphoneusermsg(param.phone, param.vercode, false, ipAddress, city) |
| | | if (res.status) { |
| | | sessionStorage.setItem('UserID', res.UserID) |
| | | sessionStorage.setItem('LoginUID', res.LoginUID) |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | // 获取ip及城市信息 |
| | | Api.directRequest('http://epc.mk9h.cn/webapi/iploc', 'get', null, 'true').then(res => { |
| | | if (!res || !res.location) return |
| | | sessionStorage.setItem('city', res.location) |
| | | this.setState({ |
| | | ipAddress: res.ip || '', |
| | | city: res.location |
| | | }) |
| | | }) |
| | | const timeStamp = new Date().getTime() |
| | | const _authUrl = window.location.href.split('#')[0] + 'AuthCode' |
| | | |