From 69d182c8cee63fb850a001b0edf4b613e8aa01c2 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 02 四月 2021 17:58:35 +0800 Subject: [PATCH] 2021-04-02 --- src/views/login/index.jsx | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx index 4d1f7eb..e444436 100644 --- a/src/views/login/index.jsx +++ b/src/views/login/index.jsx @@ -40,7 +40,9 @@ syncApp: false, loginWays: null, touristLogin: false, - syncing: false + syncing: false, + ipAddress: '', + city: '' } changelang (item) { @@ -75,6 +77,7 @@ * @param {Object} param 鐢ㄦ埛鍚嶅瘑鐮佺瓑淇℃伅 */ async loginsubmit (param) { + const { ipAddress, city } = this.state if (options.sysType === 'local' && !window.GLOB.mainSystemApi) { // 涓氬姟绯荤粺蹇呴』璁剧疆鍗曠偣鍦板潃 Modal.warning({ title: '鏈缃崟鐐规湇鍔″櫒鍦板潃锛岃鑱旂郴绠$悊鍛橈紒' @@ -83,7 +86,7 @@ } // 鐧诲綍鎻愪氦 - 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) @@ -145,6 +148,7 @@ } async phoneloginsubmit (param) { + const { ipAddress, city } = this.state if (options.sysType === 'local' && !window.GLOB.mainSystemApi) { // 涓氬姟绯荤粺蹇呴』璁剧疆鍗曠偣鍦板潃 Modal.warning({ title: '鏈缃崟鐐规湇鍔″櫒鍦板潃锛岃鑱旂郴绠$悊鍛橈紒' @@ -153,7 +157,7 @@ } // 鐧诲綍鎻愪氦 - 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) @@ -198,6 +202,15 @@ } 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' -- Gitblit v1.8.0