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/index.js | 3 src/menu/datasource/verifycard/utils.jsx | 16 +-- src/tabviews/custom/components/card/cardcellList/index.jsx | 5 src/utils/utils-datamanage.js | 50 +++++++----- src/menu/sysinterface/settingform/simplescript/index.jsx | 2 src/tabviews/custom/components/share/tabtransfer/index.jsx | 5 src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx | 4 src/tabviews/custom/components/group/normal-group/index.jsx | 5 src/templates/zshare/verifycard/index.jsx | 6 src/menu/datasource/verifycard/customscript/index.jsx | 2 src/templates/sharecomponent/settingcalcomponent/verifycard/utils.jsx | 5 + src/tabviews/calendar/index.jsx | 8 + src/tabviews/zshare/actionList/exceloutbutton/index.jsx | 4 + src/menu/components/card/cardcellcomponent/formconfig.jsx | 2 src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx | 2 src/api/index.js | 26 ++++-- src/tabviews/custom/index.jsx | 20 ++++ src/templates/sharecomponent/treesettingcomponent/settingform/utils.jsx | 2 src/templates/zshare/customscript/index.jsx | 2 src/menu/sysinterface/settingform/utils.jsx | 4 src/templates/sharecomponent/settingcomponent/settingform/utils.jsx | 9 + src/utils/utils.js | 14 ++- src/views/login/index.jsx | 19 ++++ 23 files changed, 133 insertions(+), 82 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index a584f47..0beff01 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -177,7 +177,7 @@ /** * @description 鎵嬫満鍙烽獙璇佺爜鐧诲綍 */ - getphoneusermsg (phoneNo, checkcode, isCloud = false) { + getphoneusermsg (phoneNo, checkcode, isCloud = false, ipAddress, city) { let param = { // func: 'webapi_login', mob: phoneNo, @@ -185,7 +185,9 @@ Password: '', check_code: checkcode, way_no: 'sms_vcode', - systemType: options.sysType + systemType: options.sysType, + login_city: city, + login_id_address: ipAddress } param.appkey = window.GLOB.appkey || '' @@ -215,12 +217,14 @@ /** * @description 鐧诲綍绯荤粺, 鑾峰彇鐢ㄦ埛淇℃伅 */ - getusermsg (username, password, isCloud = false) { + getusermsg (username, password, isCloud = false, ipAddress, city) { let param = { // func: 'webapi_login', UserName: username, systemType: options.sysType, - Type: 'S' + Type: 'S', + login_city: city, + login_id_address: ipAddress } // Type: 'S' 鏃� @@ -669,16 +673,18 @@ param.userid = sessionStorage.getItem('CloudUserID') || param.userid || '' param.LoginUID = sessionStorage.getItem('CloudLoginUID') || param.LoginUID || '' } - let url = '/webapi/dostars' - if (param.rduri) { - url = param.rduri - delete param.rduri - } + + // 寰呬紭鍖栵紝澧炲姞鏄惁鏀寔璺ㄥ煙璇锋眰 + // let url = '/webapi/dostars' + // if (param.rduri) { + // url = param.rduri + // delete param.rduri + // } param = this.encryptParam(param) return axios({ - url: `${url}${param.func ? '/' + param.func : ''}`, + url: `/webapi/dostars${param.func ? '/' + param.func : ''}`, method: 'post', data: param }) diff --git a/src/index.js b/src/index.js index acc30d7..fcc809d 100644 --- a/src/index.js +++ b/src/index.js @@ -70,7 +70,6 @@ let GLOB = {} GLOB.appId = config.appId || '' GLOB.lineColor = config.lineColor || '' - GLOB.filter = config.filter || '' if (config.externalDatabase !== false && config.externalDatabase !== 'false' && config.externalDatabase !== undefined) { GLOB.externalDatabase = config.externalDatabase ? `[${config.externalDatabase}]..` : '' @@ -159,7 +158,7 @@ document.title = GLOB.platTitle || '' - if (GLOB.filter === 'true') { + if (config.filter === 'true') { let html = document.getElementsByTagName('html')[0] if (html) { diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx index a83aee1..b81da36 100644 --- a/src/menu/components/card/cardcellcomponent/formconfig.jsx +++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx @@ -117,7 +117,7 @@ min: 0, label: '鍐呭', initVal: card.value || '', - tooltip: '鏂囨湰绫诲瀷锛屼細鏇挎崲鍐呭涓殑@username@鍜孈fullName@銆�', + tooltip: '鏂囨湰绫诲瀷锛屼細鏇挎崲鍐呭涓殑@username@銆丂fullName@銆丂login_city@銆�', required: true }, { diff --git a/src/menu/datasource/verifycard/customscript/index.jsx b/src/menu/datasource/verifycard/customscript/index.jsx index 64d25c7..24e92d2 100644 --- a/src/menu/datasource/verifycard/customscript/index.jsx +++ b/src/menu/datasource/verifycard/customscript/index.jsx @@ -220,7 +220,7 @@ </Col> <Col span={24} className="sqlfield"> <Form.Item label={'鍙敤瀛楁'}> - id, bid, loginuid, sessionuid, userid, username, fullname, appkey, time_id, orderBy, pageSize, pageIndex{usefulFields ? ', ' + usefulFields : ''} + id, bid, loginuid, sessionuid, userid, username, fullname, login_city, appkey, time_id, orderBy, pageSize, pageIndex{usefulFields ? ', ' + usefulFields : ''} </Form.Item> </Col> <Col span={10} style={{width: '43%'}}> diff --git a/src/menu/datasource/verifycard/utils.jsx b/src/menu/datasource/verifycard/utils.jsx index 3497b15..9bb5840 100644 --- a/src/menu/datasource/verifycard/utils.jsx +++ b/src/menu/datasource/verifycard/utils.jsx @@ -30,7 +30,7 @@ _customScript = _customScript.replace(/@\$|\$@/ig, '') if (_customScript) { - _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50) select @ErrorCode='',@retmsg ='' + _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50) select @ErrorCode='',@retmsg ='' ${_customScript} ` } @@ -117,30 +117,24 @@ if (_customScript) { _regoptions.push({ - var: new RegExp('@orderBy', 'ig'), + reg: new RegExp('@login_city@', 'ig'), + }, { reg: new RegExp('@orderBy@', 'ig'), - }) - _regoptions.push({ - var: new RegExp('@UserName', 'ig'), + }, { reg: new RegExp('@UserName@', 'ig'), - }) - _regoptions.push({ - var: new RegExp('@FullName', 'ig'), + }, { reg: new RegExp('@FullName@', 'ig'), }) if (setting.laypage !== 'false') { _regoptions.push({ - var: new RegExp('@pageSize', 'ig'), reg: new RegExp('@pageSize@', 'ig'), }, { - var: new RegExp('@pageIndex', 'ig'), reg: new RegExp('@pageIndex@', 'ig'), }) } _regoptions.forEach(item => { _customScript = _customScript.replace(item.reg, '0') originscript = originscript.replace(item.reg, '0') - originscript = originscript.replace(item.var, '0') }) if (setting.varMark) { diff --git a/src/menu/sysinterface/settingform/simplescript/index.jsx b/src/menu/sysinterface/settingform/simplescript/index.jsx index 0617137..c0d7832 100644 --- a/src/menu/sysinterface/settingform/simplescript/index.jsx +++ b/src/menu/sysinterface/settingform/simplescript/index.jsx @@ -394,7 +394,7 @@ </Col> <Col span={24} className="sqlfield"> <Form.Item label={'鍙敤瀛楁'}> - bid, loginuid, sessionuid, userid, username, fullname, appkey, time_id + bid, loginuid, sessionuid, userid, username, fullname, login_city, appkey, time_id </Form.Item> </Col> {type === 'back' ? <Col span={8} style={{whiteSpace: 'nowrap'}}> diff --git a/src/menu/sysinterface/settingform/utils.jsx b/src/menu/sysinterface/settingform/utils.jsx index 2c7ddce..3cd33d8 100644 --- a/src/menu/sysinterface/settingform/utils.jsx +++ b/src/menu/sysinterface/settingform/utils.jsx @@ -17,13 +17,13 @@ }) if (_customScript) { - _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50) select @ErrorCode='',@retmsg ='' + _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50) select @ErrorCode='',@retmsg ='' ${_customScript} ` } _customScript = _customScript.replace(/@\$|\$@/ig, '') - _customScript = _customScript.replace(/@userName@|@fullName@/ig, `''`) + _customScript = _customScript.replace(/@userName@|@fullName@|@login_city@/ig, `''`) // 澶栬仈鏁版嵁搴撴浛鎹� if (window.GLOB.externalDatabase !== null) { _customScript = _customScript.replace(/@db@/ig, window.GLOB.externalDatabase) diff --git a/src/tabviews/calendar/index.jsx b/src/tabviews/calendar/index.jsx index 149f19d..6141c25 100644 --- a/src/tabviews/calendar/index.jsx +++ b/src/tabviews/calendar/index.jsx @@ -331,6 +331,7 @@ let regoptions = [] let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' + let city = sessionStorage.getItem('city') || '' if (sessionStorage.getItem('isEditState') === 'true') { userName = sessionStorage.getItem('CloudUserName') || '' @@ -346,6 +347,9 @@ } }) regoptions.push({ + reg: new RegExp('@login_city@', 'ig'), + value: city + }, { reg: new RegExp('@userName@', 'ig'), value: userName }, { @@ -383,8 +387,8 @@ param.custom_script = param.custom_script.replace(item.reg, item.value) }) - param.custom_script = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50) - Select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}' + param.custom_script = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50) + Select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}', @login_city='${city}' ${param.custom_script} ` diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index 05b9a24..996c853 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -279,10 +279,11 @@ if (card.datatype === 'static') { val = card.value || '' - if (/@username@|@fullName@/ig.test(val)) { + if (/@username@|@fullName@|@login_city@/ig.test(val)) { let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' - val = val.replace(/@username@/ig, userName).replace(/@fullName@/ig, fullName) + let city = sessionStorage.getItem('city') || '' + val = val.replace(/@username@/ig, userName).replace(/@fullName@/ig, fullName).replace(/@login_city@/ig, city) } } else if (data.hasOwnProperty(card.field)) { val = data[card.field] diff --git a/src/tabviews/custom/components/group/normal-group/index.jsx b/src/tabviews/custom/components/group/normal-group/index.jsx index 9eadab0..d814a27 100644 --- a/src/tabviews/custom/components/group/normal-group/index.jsx +++ b/src/tabviews/custom/components/group/normal-group/index.jsx @@ -152,6 +152,7 @@ let diffUser = false let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' + let city = sessionStorage.getItem('city') || '' if (sessionStorage.getItem('isEditState') === 'true') { userName = sessionStorage.getItem('CloudUserName') || '' @@ -162,8 +163,8 @@ let _script = item.script if (index === 0) { - _script = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50) - select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}' + _script = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50) + select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}', @login_city='${city}' ${_script} ` } diff --git a/src/tabviews/custom/components/share/tabtransfer/index.jsx b/src/tabviews/custom/components/share/tabtransfer/index.jsx index 01d2693..03cbe65 100644 --- a/src/tabviews/custom/components/share/tabtransfer/index.jsx +++ b/src/tabviews/custom/components/share/tabtransfer/index.jsx @@ -167,6 +167,7 @@ let diffUser = false let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' + let city = sessionStorage.getItem('city') || '' if (sessionStorage.getItem('isEditState') === 'true') { userName = sessionStorage.getItem('CloudUserName') || '' @@ -177,8 +178,8 @@ let _script = item.script if (index === 0) { - _script = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50) - select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}' + _script = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50) + select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}', @login_city='${city}' ${_script} ` } diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index a959c60..97b6365 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -157,8 +157,21 @@ inherit.cacheTime = config.cacheTime } - let regs = [] + let userName = sessionStorage.getItem('User_Name') || '' + let fullName = sessionStorage.getItem('Full_Name') || '' + let city = sessionStorage.getItem('city') || '' + if (sessionStorage.getItem('isEditState') === 'true') { + userName = sessionStorage.getItem('CloudUserName') || '' + fullName = sessionStorage.getItem('CloudFullName') || '' + } + + let regs = [ + { reg: /@userName@/ig, value: userName }, + { reg: /@fullName@/ig, value: fullName }, + { reg: /@login_city@/ig, value: city } + ] + if (window.GLOB.externalDatabase !== null) { regs.push({ reg: /@db@/ig, @@ -828,6 +841,7 @@ let diffUser = false let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' + let city = sessionStorage.getItem('city') || '' if (sessionStorage.getItem('isEditState') === 'true') { userName = sessionStorage.getItem('CloudUserName') || '' @@ -838,8 +852,8 @@ let _script = item.script if (index === 0) { - _script = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50) - select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}' + _script = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50) + select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}', @login_city='${city}' ${_script} ` } diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx index ec8f827..121fc6f 100644 --- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx +++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx @@ -614,6 +614,7 @@ let allSearch = Utils.getAllSearchOptions(search) let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' + let city = sessionStorage.getItem('city') || '' if (sessionStorage.getItem('isEditState') === 'true') { userName = sessionStorage.getItem('CloudUserName') || '' @@ -628,6 +629,9 @@ }) regoptions.push({ + reg: new RegExp('@login_city@', 'ig'), + value: city + }, { reg: new RegExp('@userName@', 'ig'), value: userName }, { diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx index 37604b8..26c87fe 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx @@ -49,7 +49,7 @@ } let _sql = `Declare @${btn.sheet} table (${columns.map(item => item.Column + ' ' + item.type).join(',')},jskey nvarchar(50) ) - Declare @UserName nvarchar(50),@FullName nvarchar(50),@ErrorCode nvarchar(50), @retmsg nvarchar(4000),@tbid Nvarchar(512) + Declare @UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50),@ErrorCode nvarchar(50), @retmsg nvarchar(4000),@tbid Nvarchar(512) Select @ErrorCode='', @retmsg='' ` diff --git a/src/templates/sharecomponent/settingcalcomponent/verifycard/utils.jsx b/src/templates/sharecomponent/settingcalcomponent/verifycard/utils.jsx index d9f30b2..da2b30d 100644 --- a/src/templates/sharecomponent/settingcalcomponent/verifycard/utils.jsx +++ b/src/templates/sharecomponent/settingcalcomponent/verifycard/utils.jsx @@ -22,7 +22,7 @@ } if (_customScript) { - _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50) select @ErrorCode='',@retmsg ='' + _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50) select @ErrorCode='',@retmsg ='' ${_customScript} ` } @@ -70,6 +70,9 @@ } _regoptions.push({ + reg: new RegExp('@login_city@', 'ig'), + value: `''` + }, { reg: new RegExp('@userName@', 'ig'), value: `''` }, { diff --git a/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx index c733f72..1096b9c 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx @@ -427,12 +427,12 @@ </Col> {usefulFields ? <Col span={24} className="sqlfield"> <Form.Item label={'鍙敤瀛楁'}> - id, bid, loginuid, sessionuid, userid, username, fullname, appkey, time_id{usefulFields ? ', ' + usefulFields : ''} + id, bid, loginuid, sessionuid, userid, username, fullname, login_city, appkey, time_id{usefulFields ? ', ' + usefulFields : ''} </Form.Item> </Col> : null} {!usefulFields ? <Col span={24} className="sqlfield"> <Form.Item label={'鍙敤瀛楁'}> - id, bid, loginuid, sessionuid, userid, username, fullname, appkey, time_id + id, bid, loginuid, sessionuid, userid, username, fullname, login_city, appkey, time_id </Form.Item> </Col> : null} {!usefulFields ? <Col span={8} style={{whiteSpace: 'nowrap'}}> diff --git a/src/templates/sharecomponent/settingcomponent/settingform/utils.jsx b/src/templates/sharecomponent/settingcomponent/settingform/utils.jsx index 8e159b0..2801901 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/utils.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/utils.jsx @@ -18,7 +18,7 @@ }) if (_customScript) { - _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50) select @ErrorCode='',@retmsg ='' + _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50) select @ErrorCode='',@retmsg ='' ${_customScript} ` } @@ -49,6 +49,9 @@ }) _regoptions.push({ + reg: new RegExp('@login_city@', 'ig'), + value: `''` + }, { reg: new RegExp('@userName@', 'ig'), value: `''` }, { @@ -130,13 +133,13 @@ }) if (_customScript) { - _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50) select @ErrorCode='',@retmsg ='' + _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50) select @ErrorCode='',@retmsg ='' ${_customScript} ` } _customScript = _customScript.replace(/@\$|\$@/ig, '') - _customScript = _customScript.replace(/@userName@|@fullName@/ig, `''`) + _customScript = _customScript.replace(/@userName@|@fullName@|@login_city@/ig, `''`) // 澶栬仈鏁版嵁搴撴浛鎹� if (window.GLOB.externalDatabase !== null) { _customScript = _customScript.replace(/@db@/ig, window.GLOB.externalDatabase) diff --git a/src/templates/sharecomponent/treesettingcomponent/settingform/utils.jsx b/src/templates/sharecomponent/treesettingcomponent/settingform/utils.jsx index 3ff821a..721c7c9 100644 --- a/src/templates/sharecomponent/treesettingcomponent/settingform/utils.jsx +++ b/src/templates/sharecomponent/treesettingcomponent/settingform/utils.jsx @@ -18,7 +18,7 @@ }) if (_customScript) { - _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50) select @ErrorCode='',@retmsg ='' + _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50) select @ErrorCode='',@retmsg ='' ${_customScript} ` } diff --git a/src/templates/zshare/customscript/index.jsx b/src/templates/zshare/customscript/index.jsx index b7c3ecb..a69270f 100644 --- a/src/templates/zshare/customscript/index.jsx +++ b/src/templates/zshare/customscript/index.jsx @@ -374,7 +374,7 @@ </Col> <Col span={24} className="sqlfield"> <Form.Item label={'鍙敤瀛楁'}> - id, bid, loginuid, sessionuid, userid, username, fullname, appkey, time_id, orderBy{setting.laypage === 'true' ? ', pageSize, pageIndex': ''}{usefulFields ? ', ' + usefulFields : ''} + id, bid, loginuid, sessionuid, userid, username, fullname, login_city, appkey, time_id, orderBy{setting.laypage === 'true' ? ', pageSize, pageIndex': ''}{usefulFields ? ', ' + usefulFields : ''} </Form.Item> </Col> <Col span={10} className="quick-add"> diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx index f963206..a3a388e 100644 --- a/src/templates/zshare/verifycard/index.jsx +++ b/src/templates/zshare/verifycard/index.jsx @@ -609,9 +609,9 @@ resolve(_fields) } }).then(_fields => { - let _usefulfields = ['BID', 'ID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey', 'UserName', 'FullName', 'BillCode', 'BVoucher', 'FIBVoucherDate', 'FiYear', 'ModularDetailCode'] - let _declare = ['@UserName nvarchar(50)', '@FullName nvarchar(50)', '@ErrorCode nvarchar(50)', '@retmsg nvarchar(4000)', '@BillCode nvarchar(50)', '@BVoucher nvarchar(50)', '@FIBVoucherDate nvarchar(50)', '@FiYear nvarchar(50)', '@ModularDetailCode nvarchar(50)'] - let _select = ['@UserName=\'\'', '@FullName=\'\'', '@ErrorCode=\'\'', '@retmsg=\'\'', '@BillCode=\'\'', '@BVoucher=\'\'', '@FIBVoucherDate=\'\'', '@FiYear=\'\'', '@ModularDetailCode=\'\''] + let _usefulfields = ['BID', 'ID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey', 'UserName', 'FullName', 'login_city', 'BillCode', 'BVoucher', 'FIBVoucherDate', 'FiYear', 'ModularDetailCode'] + let _declare = ['@UserName nvarchar(50)', '@FullName nvarchar(50)', '@login_city nvarchar(50)', '@ErrorCode nvarchar(50)', '@retmsg nvarchar(4000)', '@BillCode nvarchar(50)', '@BVoucher nvarchar(50)', '@FIBVoucherDate nvarchar(50)', '@FiYear nvarchar(50)', '@ModularDetailCode nvarchar(50)'] + let _select = ['@UserName=\'\'', '@FullName=\'\'', '@login_city=\'\'', '@ErrorCode=\'\'', '@retmsg=\'\'', '@BillCode=\'\'', '@BVoucher=\'\'', '@FIBVoucherDate=\'\'', '@FiYear=\'\'', '@ModularDetailCode=\'\''] let fieldArr = _usefulfields.map(_f => _f.toLowerCase()) let hasBid = false diff --git a/src/utils/utils-datamanage.js b/src/utils/utils-datamanage.js index 6ee7623..f684846 100644 --- a/src/utils/utils-datamanage.js +++ b/src/utils/utils-datamanage.js @@ -91,6 +91,7 @@ let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' + let city = sessionStorage.getItem('city') || '' if (sessionStorage.getItem('isEditState') === 'true') { userName = sessionStorage.getItem('CloudUserName') || '' @@ -101,8 +102,8 @@ let _customScript = '' if (setting.customScript) { - _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50) - Select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}' + _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50) + Select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}', @login_city='${city}' ${setting.customScript} ` } @@ -110,14 +111,6 @@ let regoptions = null if (setting.queryType === 'statistics' || _customScript) { let allSearch = Utils.getAllSearchOptions(search) - let userName = sessionStorage.getItem('User_Name') || '' - let fullName = sessionStorage.getItem('Full_Name') || '' - - if (sessionStorage.getItem('isEditState') === 'true') { - userName = sessionStorage.getItem('CloudUserName') || '' - fullName = sessionStorage.getItem('CloudFullName') || '' - } - regoptions = allSearch.map(item => { return { reg: new RegExp('@' + item.key + '@', 'ig'), @@ -125,6 +118,9 @@ } }) regoptions.push({ + reg: new RegExp('@login_city@', 'ig'), + value: `'${city}'` + }, { reg: new RegExp('@userName@', 'ig'), value: `'${userName}'` }, { @@ -228,9 +224,18 @@ let _dataresource = setting.dataresource let _customScript = '' + let userName = sessionStorage.getItem('User_Name') || '' + let fullName = sessionStorage.getItem('Full_Name') || '' + let city = sessionStorage.getItem('city') || '' + + if (sessionStorage.getItem('isEditState') === 'true') { + userName = sessionStorage.getItem('CloudUserName') || '' + fullName = sessionStorage.getItem('CloudFullName') || '' + } if (setting.customScript) { - _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000) select @ErrorCode='',@retmsg ='' + _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50) + Select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}', @login_city='${city}' ${setting.customScript} ` } @@ -238,13 +243,6 @@ let regoptions = null if (setting.queryType === 'statistics' || _customScript) { let allSearch = Utils.getAllSearchOptions(search) - let userName = sessionStorage.getItem('User_Name') || '' - let fullName = sessionStorage.getItem('Full_Name') || '' - - if (sessionStorage.getItem('isEditState') === 'true') { - userName = sessionStorage.getItem('CloudUserName') || '' - fullName = sessionStorage.getItem('CloudFullName') || '' - } regoptions = allSearch.map(item => { return { @@ -253,6 +251,9 @@ } }) regoptions.push({ + reg: new RegExp('@login_city@', 'ig'), + value: `'${city}'` + }, { reg: new RegExp('@userName@', 'ig'), value: `'${userName}'` }, { @@ -368,6 +369,7 @@ let sql = '' let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' + let city = sessionStorage.getItem('city') || '' if (sessionStorage.getItem('isEditState') === 'true') { userName = sessionStorage.getItem('CloudUserName') || '' @@ -382,8 +384,8 @@ if (sql) { sql = `/*鍓嶇疆鑴氭湰*/ - declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50) - Select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}' + declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50) + Select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}', @login_city='${city}' ${sql} aaa: if @ErrorCode!='' @@ -398,6 +400,9 @@ } }) regoptions.push({ + reg: new RegExp('@login_city@', 'ig'), + value: `'${city}'` + }, { reg: new RegExp('@userName@', 'ig'), value: `'${userName}'` }, { @@ -446,14 +451,15 @@ let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' + let city = sessionStorage.getItem('city') || '' if (sessionStorage.getItem('isEditState') === 'true') { userName = sessionStorage.getItem('CloudUserName') || '' fullName = sessionStorage.getItem('CloudFullName') || '' } - let _prevCustomScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50) - Select @ErrorCode='',@retmsg='',@UserName='${userName}', @FullName='${fullName}' + let _prevCustomScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50) + Select @ErrorCode='',@retmsg='',@UserName='${userName}', @FullName='${fullName}', @login_city='${city}' ${errSql} ` let _backCustomScript = ` diff --git a/src/utils/utils.js b/src/utils/utils.js index 72edafc..87e45c3 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -752,6 +752,7 @@ let keys = ['delete', 'drop', 'insert', 'truncate', 'update'] let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' + let city = sessionStorage.getItem('city') || '' if (sessionStorage.getItem('isEditState') === 'true') { userName = sessionStorage.getItem('CloudUserName') || '' @@ -985,9 +986,9 @@ _sql = ` /* 绯荤粺鐢熸垚 */ declare @${sheet} table (${declarefields.join(',')},jskey nvarchar(50),BID nvarchar(50) ) - Declare @UserName nvarchar(50),@FullName nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@tbid Nvarchar(512) + Declare @UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@tbid Nvarchar(512) - Select @ErrorCode='', @retmsg='', @UserName='${userName}', @FullName='${fullName}' + Select @ErrorCode='', @retmsg='', @UserName='${userName}', @FullName='${fullName}', @login_city='${city}' ${_initCustomScript} ` _sqlInsert = `Insert into @${sheet} (${fields},jskey,BID)` @@ -1020,9 +1021,9 @@ _sql = ` /* 绯荤粺鐢熸垚 */ declare @${sheet} table (jskey nvarchar(50)) - Declare @UserName nvarchar(50),@FullName nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@tbid Nvarchar(512) + Declare @UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@tbid Nvarchar(512) - Select @ErrorCode='', @retmsg='', @UserName='${userName}', @FullName='${fullName}' + Select @ErrorCode='', @retmsg='', @UserName='${userName}', @FullName='${fullName}', @login_city='${city}' ` } @@ -1207,7 +1208,7 @@ _declarefields = ',' + _declarefields } _sql = `/* 绯荤粺鐢熸垚 */ - Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50), @UserName nvarchar(50),@FullName nvarchar(50),@ModularDetailCode nvarchar(50)${_declarefields} + Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50), @UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50),@ModularDetailCode nvarchar(50)${_declarefields} ` // 琛ㄥ崟鍙橀噺璧嬪�� @@ -1241,6 +1242,7 @@ let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' + let city = sessionStorage.getItem('city') || '' if (sessionStorage.getItem('isEditState') === 'true') { userName = sessionStorage.getItem('CloudUserName') || '' @@ -1250,7 +1252,7 @@ // 鍒濆鍖栧嚟璇佸強鐢ㄦ埛淇℃伅瀛楁 _sql += ` /* 鍑瘉鍙婄敤鎴蜂俊鎭垵濮嬪寲璧嬪�� */ - select @BVoucher='',@FIBVoucherDate='',@FiYear='',@ErrorCode='',@retmsg='',@UserName='${userName}', @FullName='${fullName}', @BillCode='', @ModularDetailCode='' + select @BVoucher='',@FIBVoucherDate='',@FiYear='',@ErrorCode='',@retmsg='',@UserName='${userName}', @FullName='${fullName}', @login_city='${city}', @BillCode='', @ModularDetailCode='' ` if (retmsg) { 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