Commit 111412f7 authored by 邓晓峰's avatar 邓晓峰

fix: fix role

parent b9e40121
......@@ -5,10 +5,10 @@ module.exports = {
'/CityInterface': {
// target: 'http://192.168.10.151:8055',
// target: 'https://panda-water.cn',
// target: 'https://panda-water.com',
target: 'https://panda-water.com',
// target: 'http://192.168.19.103:8112',
// target: 'http://192.168.12.8:8098',
target: 'http://192.168.10.20:8888',
// target: 'http://192.168.10.20:8888',
changeOrigin: true,
headers: {
'Access-Control-Allow-Origin': '*'
......@@ -20,9 +20,9 @@ module.exports = {
'/cityinterface': {
// target: 'http://192.168.10.151:8055',
// target: 'https://panda-water.cn',
// target: 'https://panda-water.com',
target: 'https://panda-water.com',
// target: 'http://192.168.12.8:8098',
target: 'http://192.168.10.20:8888',
// target: 'http://192.168.10.20:8888',
changeOrigin: true,
headers: {
'Access-Control-Allow-Origin': '*'
......@@ -33,10 +33,10 @@ module.exports = {
},
'/Publish': {
// target: 'http://192.168.12.8:8098',
target: 'http://192.168.10.20:8888',
// target: 'http://192.168.10.20:8888',
// target: 'http://192.168.10.151:8055',
// target: 'https://panda-water.cn',
// target: 'https://panda-water.com',
target: 'https://panda-water.com',
changeOrigin: true,
headers: {
'Access-Control-Allow-Origin': '*'
......
......@@ -3,10 +3,10 @@ module.exports = {
'/CityInterface': {
// target: 'http://192.168.10.151:8055',
// target: 'https://panda-water.cn',
// target: 'https://panda-water.com',
target: 'https://panda-water.com',
// target: 'http://192.168.19.103:8112',
// target: 'http://192.168.12.8:8098',
target: 'http://192.168.10.20:8888',
// target: 'http://192.168.10.20:8888',
changeOrigin: true,
headers: {
'Access-Control-Allow-Origin': '*',
......@@ -18,9 +18,9 @@ module.exports = {
'/cityinterface': {
// target: 'http://192.168.10.151:8055',
// target: 'https://panda-water.cn',
// target: 'https://panda-water.com',
target: 'https://panda-water.com',
// target: 'http://192.168.12.8:8098',
target: 'http://192.168.10.20:8888',
// target: 'http://192.168.10.20:8888',
changeOrigin: true,
headers: {
'Access-Control-Allow-Origin': '*',
......@@ -31,10 +31,10 @@ module.exports = {
},
'/Publish': {
// target: 'http://192.168.12.8:8098',
target: 'http://192.168.10.20:8888',
// target: 'http://192.168.10.20:8888',
// target: 'http://192.168.10.151:8055',
// target: 'https://panda-water.cn',
// target: 'https://panda-water.com',
target: 'https://panda-water.com',
changeOrigin: true,
headers: {
'Access-Control-Allow-Origin': '*',
......
......@@ -231,9 +231,9 @@
}
},
"@ant-design/react-slick": {
"version": "0.27.11",
"resolved": "https://g.civnet.cn:4873/@ant-design%2freact-slick/-/react-slick-0.27.11.tgz",
"integrity": "sha512-KPJ1lleHW11bameFauI77Lb9N7O/4ulT1kplVdRQykWLv3oKVSGKVaekC3DM/Z0MYmKfCXCucpFnfgGMEHNM+w==",
"version": "0.27.14",
"resolved": "https://g.civnet.cn:4873/@ant-design%2freact-slick/-/react-slick-0.27.14.tgz",
"integrity": "sha1-oQgsRzTlfHupxB0DU3X1v1d/O14=",
"dev": true,
"requires": {
"@babel/runtime": "^7.10.4",
......@@ -2048,6 +2048,12 @@
"integrity": "sha512-5a6wqoJV/xEdbRNKVo6I4hO3VjyDq//8q2f9I6PBAvMesJHFauXDorcNCsr9RzvsZnaWi5NYCcfyqP1QeFHFbw==",
"dev": true
},
"@ctrl/tinycolor": {
"version": "3.1.7",
"resolved": "https://g.civnet.cn:4873/@ctrl%2ftinycolor/-/tinycolor-3.1.7.tgz",
"integrity": "sha1-FYX2dimIIAKp+OFaKUHJpDIb+Aw=",
"dev": true
},
"@emotion/is-prop-valid": {
"version": "0.7.3",
"resolved": "https://g.civnet.cn:4873/@emotion%2fis-prop-valid/-/is-prop-valid-0.7.3.tgz",
......@@ -7941,14 +7947,14 @@
"dev": true
},
"antd": {
"version": "4.7.3",
"resolved": "https://g.civnet.cn:4873/antd/-/antd-4.7.3.tgz",
"integrity": "sha512-WrI3exgD0UpTgxotEXlZcMGvEK3ehHVxz28SVWujDGJWZC1L87Mze4W6yVTrVRBfTlwkFsp/7W2Pb7whs3yPag==",
"version": "4.8.5",
"resolved": "https://g.civnet.cn:4873/antd/-/antd-4.8.5.tgz",
"integrity": "sha1-6wr4FUpt/7BwwBazRNS0m2kQzk8=",
"dev": true,
"requires": {
"@ant-design/colors": "^4.0.5",
"@ant-design/colors": "^5.0.0",
"@ant-design/css-animation": "^1.7.2",
"@ant-design/icons": "^4.2.1",
"@ant-design/icons": "^4.3.0",
"@ant-design/react-slick": "~0.27.0",
"@babel/runtime": "^7.11.2",
"array-tree-filter": "^2.1.0",
......@@ -7957,7 +7963,6 @@
"lodash": "^4.17.20",
"moment": "^2.25.3",
"omit.js": "^2.0.2",
"raf": "^3.4.1",
"rc-animate": "~3.1.0",
"rc-cascader": "~1.4.0",
"rc-checkbox": "~2.3.0",
......@@ -7965,29 +7970,28 @@
"rc-dialog": "~8.4.0",
"rc-drawer": "~4.1.0",
"rc-dropdown": "~3.2.0",
"rc-field-form": "~1.13.0",
"rc-image": "~3.2.1",
"rc-field-form": "~1.17.0",
"rc-image": "~4.0.0",
"rc-input-number": "~6.1.0",
"rc-mentions": "~1.5.0",
"rc-menu": "~8.8.2",
"rc-motion": "^2.2.0",
"rc-menu": "~8.10.0",
"rc-motion": "^2.4.0",
"rc-notification": "~4.5.2",
"rc-pagination": "~3.1.0",
"rc-picker": "~2.3.0",
"rc-picker": "~2.4.1",
"rc-progress": "~3.1.0",
"rc-rate": "~2.8.2",
"rc-rate": "~2.9.0",
"rc-resize-observer": "^0.2.3",
"rc-select": "~11.4.0",
"rc-slider": "~9.5.2",
"rc-slider": "~9.6.1",
"rc-steps": "~4.1.0",
"rc-switch": "~3.2.0",
"rc-table": "~7.10.0",
"rc-table": "~7.11.0",
"rc-tabs": "~11.7.0",
"rc-textarea": "~0.3.0",
"rc-tooltip": "~5.0.0",
"rc-tree": "~3.10.0",
"rc-tree": "~3.11.0",
"rc-tree-select": "~4.1.1",
"rc-trigger": "~5.0.3",
"rc-upload": "~3.3.1",
"rc-util": "^5.1.0",
"scroll-into-view-if-needed": "^2.2.25",
......@@ -7995,12 +7999,26 @@
},
"dependencies": {
"@ant-design/colors": {
"version": "4.0.5",
"resolved": "https://g.civnet.cn:4873/@ant-design%2fcolors/-/colors-4.0.5.tgz",
"integrity": "sha512-3mnuX2prnWOWvpFTS2WH2LoouWlOgtnIpc6IarWN6GOzzLF8dW/U8UctuvIPhoboETehZfJ61XP+CGakBEPJ3Q==",
"version": "5.0.0",
"resolved": "https://g.civnet.cn:4873/@ant-design%2fcolors/-/colors-5.0.0.tgz",
"integrity": "sha1-Rrc7TMaTWzX8i4RVXo5CyM/BkOY=",
"dev": true,
"requires": {
"tinycolor2": "^1.4.1"
"@ctrl/tinycolor": "^3.1.6"
}
},
"@ant-design/icons": {
"version": "4.3.0",
"resolved": "https://g.civnet.cn:4873/@ant-design%2ficons/-/icons-4.3.0.tgz",
"integrity": "sha1-Qg4M1SdIbA/lf4ExDWgZUPxM+s8=",
"dev": true,
"requires": {
"@ant-design/colors": "^5.0.0",
"@ant-design/icons-svg": "^4.0.0",
"@babel/runtime": "^7.11.2",
"classnames": "^2.2.6",
"insert-css": "^2.0.0",
"rc-util": "^5.0.1"
}
},
"lodash": {
......@@ -8334,9 +8352,9 @@
"dev": true
},
"async-validator": {
"version": "3.4.0",
"resolved": "https://g.civnet.cn:4873/async-validator/-/async-validator-3.4.0.tgz",
"integrity": "sha512-VrFk4eYiJAWKskEz115iiuCf9O0ftnMMPXrOFMqyzGH2KxO7YwncKyn/FgOOP+0MDHMfXL7gLExagCutaZGigA==",
"version": "3.5.1",
"resolved": "https://g.civnet.cn:4873/async-validator/-/async-validator-3.5.1.tgz",
"integrity": "sha1-zWK5aIskZfSEIOJ620d2CrG1VZ8=",
"dev": true
},
"asynckit": {
......@@ -9426,6 +9444,12 @@
}
}
},
"child_process": {
"version": "1.0.2",
"resolved": "https://g.civnet.cn:4873/child_process/-/child_process-1.0.2.tgz",
"integrity": "sha1-sffn/HPSXn/R1FWtyU4UODAYK1o=",
"dev": true
},
"chokidar": {
"version": "2.1.8",
"resolved": "https://g.civnet.cn:4873/chokidar/-/chokidar-2.1.8.tgz",
......@@ -11328,9 +11352,9 @@
"dev": true
},
"dayjs": {
"version": "1.9.4",
"resolved": "https://g.civnet.cn:4873/dayjs/-/dayjs-1.9.4.tgz",
"integrity": "sha512-ABSF3alrldf7nM9sQ2U+Ln67NRwmzlLOqG7kK03kck0mw3wlSSEKv/XhKGGxUjQcS57QeiCyNdrFgtj9nWlrng==",
"version": "1.9.6",
"resolved": "https://g.civnet.cn:4873/dayjs/-/dayjs-1.9.6.tgz",
"integrity": "sha1-bwx312rB/2NyDdEZfly4e2eUPXA=",
"dev": true
},
"debug": {
......@@ -14298,6 +14322,12 @@
"readable-stream": "^2.0.0"
}
},
"fs": {
"version": "0.0.1-security",
"resolved": "https://g.civnet.cn:4873/fs/-/fs-0.0.1-security.tgz",
"integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=",
"dev": true
},
"fs-extra": {
"version": "8.1.0",
"resolved": "https://g.civnet.cn:4873/fs-extra/-/fs-extra-8.1.0.tgz",
......@@ -22472,9 +22502,9 @@
"dev": true
},
"qiankun": {
"version": "2.3.1",
"resolved": "https://g.civnet.cn:4873/qiankun/-/qiankun-2.3.1.tgz",
"integrity": "sha1-m51lVqAEeHqAnPg7Z/9IajuG3Yc=",
"version": "2.2.4-1",
"resolved": "https://g.civnet.cn:4873/qiankun/-/qiankun-2.2.4-1.tgz",
"integrity": "sha512-kReBEeS4ZB9wPlfk4kqEd+lxkqR3AfTxr9GVuosu0ObLiqFUAwzy5EvgRF1ayjced2j7laDw/e913ERNxPI6uw==",
"dev": true,
"requires": {
"@babel/runtime": "^7.10.5",
......@@ -22618,9 +22648,9 @@
}
},
"rc-align": {
"version": "4.0.8",
"resolved": "https://g.civnet.cn:4873/rc-align/-/rc-align-4.0.8.tgz",
"integrity": "sha512-2sRUkmB8z4UEXzaS+lDHzXMoR8HrtKH9nn2yHlHVNyUTnaucjMFbdEoCk+hO1g7cpIgW0MphG8i0EH2scSesfw==",
"version": "4.0.9",
"resolved": "https://g.civnet.cn:4873/rc-align/-/rc-align-4.0.9.tgz",
"integrity": "sha1-RtiAHEoTn/amWtFnTo786smPhfI=",
"dev": true,
"requires": {
"@babel/runtime": "^7.10.1",
......@@ -22727,9 +22757,9 @@
}
},
"rc-field-form": {
"version": "1.13.0",
"resolved": "https://g.civnet.cn:4873/rc-field-form/-/rc-field-form-1.13.0.tgz",
"integrity": "sha512-kxhclPHizffWscGU5w/zkyKAadRHEX0RGm80kE/ULV2Qxof7xF4FaCh/TOownPvUnaH8YrkwapUvvxtBSroJGw==",
"version": "1.17.2",
"resolved": "https://g.civnet.cn:4873/rc-field-form/-/rc-field-form-1.17.2.tgz",
"integrity": "sha1-gbCdMg+bRVZzhnvzofWyqsD9ChU=",
"dev": true,
"requires": {
"@babel/runtime": "^7.8.4",
......@@ -22738,9 +22768,9 @@
}
},
"rc-image": {
"version": "3.2.2",
"resolved": "https://g.civnet.cn:4873/rc-image/-/rc-image-3.2.2.tgz",
"integrity": "sha512-8D1pj4qTdC93IfeTPstGFBwpDRZPC565emm4VevrtyFoD9QHBF6kp9kOtzk0JAmbybLAQuX4GGNcwoc7tbZ9Zw==",
"version": "4.0.1",
"resolved": "https://g.civnet.cn:4873/rc-image/-/rc-image-4.0.1.tgz",
"integrity": "sha512-1GxjwgtONtJjlvd7sM9VSLTAlDQhkqHI0wl72YSDpdm24w5zmDsTYLgTNh/vToFa9qAml10Gaidy03qpkTAQ+A==",
"dev": true,
"requires": {
"@ant-design/icons": "^4.2.2",
......@@ -22776,9 +22806,9 @@
}
},
"rc-menu": {
"version": "8.8.3",
"resolved": "https://g.civnet.cn:4873/rc-menu/-/rc-menu-8.8.3.tgz",
"integrity": "sha512-C9sT0SBXmUbVWRUseXASousacRVPnOm5aXdyJR569WIvZwbs2IncpGNmAcft1R5ZuFE3Y+SZZ5FYvtGtbCzkIQ==",
"version": "8.10.0",
"resolved": "https://g.civnet.cn:4873/rc-menu/-/rc-menu-8.10.0.tgz",
"integrity": "sha1-8U/2RWBzvPKWA9qBh3RUOnPkTpI=",
"dev": true,
"requires": {
"@babel/runtime": "^7.10.1",
......@@ -22786,16 +22816,16 @@
"mini-store": "^3.0.1",
"omit.js": "^2.0.0",
"rc-motion": "^2.0.1",
"rc-trigger": "^5.0.4",
"rc-trigger": "^5.1.2",
"rc-util": "^5.0.1",
"resize-observer-polyfill": "^1.5.0",
"shallowequal": "^1.1.0"
}
},
"rc-motion": {
"version": "2.3.4",
"resolved": "https://g.civnet.cn:4873/rc-motion/-/rc-motion-2.3.4.tgz",
"integrity": "sha1-af4TE3VO4edG5C7JceNhy8dVRW4=",
"version": "2.4.1",
"resolved": "https://g.civnet.cn:4873/rc-motion/-/rc-motion-2.4.1.tgz",
"integrity": "sha1-Mj9HyGNeayvAy6LfrSX8QVtY4dw=",
"dev": true,
"requires": {
"@babel/runtime": "^7.11.1",
......@@ -22816,9 +22846,9 @@
}
},
"rc-pagination": {
"version": "3.1.1",
"resolved": "https://g.civnet.cn:4873/rc-pagination/-/rc-pagination-3.1.1.tgz",
"integrity": "sha512-8chFRHXRXRhdPO2Tlmm4hnA/1FnO2hYSoop6FaukQ9/IaCugsVVcXo7OqZ03YJY+aWQLtS6tDsb+sAapCCmljw==",
"version": "3.1.2",
"resolved": "https://g.civnet.cn:4873/rc-pagination/-/rc-pagination-3.1.2.tgz",
"integrity": "sha1-q16s2cUfhp41DSJFBkur6RvB8EY=",
"dev": true,
"requires": {
"@babel/runtime": "^7.10.1",
......@@ -22826,9 +22856,9 @@
}
},
"rc-picker": {
"version": "2.3.3",
"resolved": "https://g.civnet.cn:4873/rc-picker/-/rc-picker-2.3.3.tgz",
"integrity": "sha512-ah4ucCnAs8ss7GgV7sF7MGgRlyfP4753z+OjnF4X7cIrntygklQqiFDBZYS02RX773vhJ+jc6AbyoR7hI4aGng==",
"version": "2.4.2",
"resolved": "https://g.civnet.cn:4873/rc-picker/-/rc-picker-2.4.2.tgz",
"integrity": "sha1-6dU/Uc92i7GfcCTQAo9zAI/OUWM=",
"dev": true,
"requires": {
"@babel/runtime": "^7.10.1",
......@@ -22852,9 +22882,9 @@
}
},
"rc-rate": {
"version": "2.8.2",
"resolved": "https://g.civnet.cn:4873/rc-rate/-/rc-rate-2.8.2.tgz",
"integrity": "sha512-f9T/D+ZwWQrWHkpidpQbnXpnVMGMC4eSRAkwuu88a8Qv1C/9LNc4AErazoh8tpnZBFqq19F3j0Glv+sDgkfEig==",
"version": "2.9.1",
"resolved": "https://g.civnet.cn:4873/rc-rate/-/rc-rate-2.9.1.tgz",
"integrity": "sha1-5Dy5XE65CiweCxbsZhTYxDUwpzE=",
"dev": true,
"requires": {
"@babel/runtime": "^7.10.1",
......@@ -22890,9 +22920,9 @@
}
},
"rc-slider": {
"version": "9.5.4",
"resolved": "https://g.civnet.cn:4873/rc-slider/-/rc-slider-9.5.4.tgz",
"integrity": "sha512-24goJnWhmWi0ojNZMoPSMni2wh73IPqEK0TJh7rWn10hPLLKgG8x3KRR0g4uUdCS9APHyosqxGXUIJKGydJXVg==",
"version": "9.6.4",
"resolved": "https://g.civnet.cn:4873/rc-slider/-/rc-slider-9.6.4.tgz",
"integrity": "sha1-Ga85rSKSfeL21STgoU87HPF7plk=",
"dev": true,
"requires": {
"@babel/runtime": "^7.10.1",
......@@ -22925,9 +22955,9 @@
}
},
"rc-table": {
"version": "7.10.4",
"resolved": "https://g.civnet.cn:4873/rc-table/-/rc-table-7.10.4.tgz",
"integrity": "sha1-GUjcCeeTn13pw25ANDbr7qo98aA=",
"version": "7.11.2",
"resolved": "https://g.civnet.cn:4873/rc-table/-/rc-table-7.11.2.tgz",
"integrity": "sha1-B/3o5jI+J8btP1NKNdrkE+ghLVE=",
"dev": true,
"requires": {
"@babel/runtime": "^7.10.1",
......@@ -22938,9 +22968,9 @@
}
},
"rc-tabs": {
"version": "11.7.0",
"resolved": "https://g.civnet.cn:4873/rc-tabs/-/rc-tabs-11.7.0.tgz",
"integrity": "sha512-nYwQcgML2drM0iau4aa6HI4qyyZSW0WpspCAtO5KGjXwHzUJcvv3qgLVuoQOWQaDDHXkI9Jj8U7Y/Hcrdyj1Kw==",
"version": "11.7.1",
"resolved": "https://g.civnet.cn:4873/rc-tabs/-/rc-tabs-11.7.1.tgz",
"integrity": "sha1-wj/FPlm9i3JQgYoaKbyhiWRQ15s=",
"dev": true,
"requires": {
"@babel/runtime": "^7.11.2",
......@@ -22949,7 +22979,19 @@
"rc-dropdown": "^3.1.3",
"rc-menu": "^8.6.1",
"rc-resize-observer": "^0.2.1",
"rc-util": "^5.0.0"
"rc-util": "^5.5.0"
},
"dependencies": {
"rc-util": {
"version": "5.5.0",
"resolved": "https://g.civnet.cn:4873/rc-util/-/rc-util-5.5.0.tgz",
"integrity": "sha1-djIby1wS8B9Cv/m5cfFw/xlQblo=",
"dev": true,
"requires": {
"react-is": "^16.12.0",
"shallowequal": "^1.1.0"
}
}
}
},
"rc-textarea": {
......@@ -22975,9 +23017,9 @@
}
},
"rc-tree": {
"version": "3.10.0",
"resolved": "https://g.civnet.cn:4873/rc-tree/-/rc-tree-3.10.0.tgz",
"integrity": "sha512-kf7J/f2E2T8Kfta3/1BIg65AzTmXOgOjn0KOpvD3KI/gqkfKMRKUS1ybkxW39JUPpKwdeOHFnYH+nFFMq7tkfg==",
"version": "3.11.0",
"resolved": "https://g.civnet.cn:4873/rc-tree/-/rc-tree-3.11.0.tgz",
"integrity": "sha1-h+3wGEK9iKBVGeMN1zEr7j9+Jhg=",
"dev": true,
"requires": {
"@babel/runtime": "^7.10.1",
......@@ -22988,9 +23030,9 @@
}
},
"rc-tree-select": {
"version": "4.1.2",
"resolved": "https://g.civnet.cn:4873/rc-tree-select/-/rc-tree-select-4.1.2.tgz",
"integrity": "sha512-2tRwZ4ChY+BarVKHoPR65kSZtopgwKCig6ngJiiTVgYfRdAhfdQp2j2+L8YW9TkosYGmwgTOhmlphlG3QNy7Pg==",
"version": "4.1.3",
"resolved": "https://g.civnet.cn:4873/rc-tree-select/-/rc-tree-select-4.1.3.tgz",
"integrity": "sha1-H4i3v0ZlL5lizkJfh2Co+JH7W3g=",
"dev": true,
"requires": {
"@babel/runtime": "^7.10.1",
......@@ -23001,16 +23043,28 @@
}
},
"rc-trigger": {
"version": "5.0.9",
"resolved": "https://g.civnet.cn:4873/rc-trigger/-/rc-trigger-5.0.9.tgz",
"integrity": "sha1-aVbDGrGi3vZfBjCVfqdb2qSyzEw=",
"version": "5.1.2",
"resolved": "https://g.civnet.cn:4873/rc-trigger/-/rc-trigger-5.1.2.tgz",
"integrity": "sha1-8PibuiMYaZ5wRJK92yBQbs2PiRY=",
"dev": true,
"requires": {
"@babel/runtime": "^7.11.2",
"classnames": "^2.2.6",
"rc-align": "^4.0.0",
"rc-motion": "^2.0.0",
"rc-util": "^5.3.4"
"rc-util": "^5.5.0"
},
"dependencies": {
"rc-util": {
"version": "5.5.0",
"resolved": "https://g.civnet.cn:4873/rc-util/-/rc-util-5.5.0.tgz",
"integrity": "sha1-djIby1wS8B9Cv/m5cfFw/xlQblo=",
"dev": true,
"requires": {
"react-is": "^16.12.0",
"shallowequal": "^1.1.0"
}
}
}
},
"rc-upload": {
......@@ -140,7 +140,7 @@
"@commitlint/config-conventional": "^9.1.2",
"@umijs/hooks": "^1.9.3",
"add-asset-html-webpack-plugin": "3.1.3",
"antd": "^4.5.3",
"antd": "^4.8.5",
"axios": "^0.19.2",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.0.1",
......@@ -152,6 +152,7 @@
"babel-plugin-styled-components": "1.10.0",
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
"bcore": "^0.0.22",
"child_process": "^1.0.2",
"circular-dependency-plugin": "5.0.2",
"classnames": "^2.2.6",
"compare-versions": "3.4.0",
......@@ -178,6 +179,7 @@
"eslint-plugin-redux-saga": "1.0.0",
"express": "^4.17.1",
"file-loader": "3.0.1",
"fs": "0.0.1-security",
"html-loader": "0.5.5",
"html-webpack-plugin": "3.2.0",
"http-proxy-middleware": "^1.0.5",
......
......@@ -12,18 +12,21 @@ const API = {
GET_ALL_GROUPS_INFO_FORUSER:
'CityInterface/rest/Services/Portal.svc/AuthorityManage/GetAllGroupsInfoForUser',
GET_WEATHER: '/CityInterface/rest/services/CountyProduct.svc/GetWeather',
SEND_MESSAGE_CODE: 'CityInterface/rest/services/portal.svc/SendMessVerificationCode'
};
export default vm => {
vm.getConfig = (
data = { client: params.getParams('client') || 'city', ts: Date.now() },
config = {}
config = {},
) => vm.get(API.GET_CONFIG, data, config).then(res => Promise.resolve(res));
vm.generateToken = (data = {}, config = {}) =>
vm.get(API.GENERATE_TOKEN, data, config).then(res => Promise.resolve(res));
vm.getWebSiteConfig = (data = {}, config = {}) =>
vm.get(API.GET_WEB_SITE_CONFIG, data, config).then(res => Promise.resolve(res));
vm
.get(API.GET_WEB_SITE_CONFIG, data, config)
.then(res => Promise.resolve(res));
vm.getUserInfo = (data = {}, config = {}) =>
vm.get(API.GET_USER_INFO, data, config).then(res => Promise.resolve(res));
......@@ -46,4 +49,6 @@ export default vm => {
vm.getWeather = (data = {}, config) =>
vm.get(API.GET_WEATHER, data, config).then(res => Promise.resolve(res));
vm.sendMessVerificationCode = (data = {}, config ={}) => vm.get(API.SEND_MESSAGE_CODE, data, config).then(res => Promise.resolve(res));
};
......@@ -17,7 +17,8 @@ var API = {
GET_LOGS: '/CityInterface/rest/services/portal.svc/OMMonitor/SaveLoginInfo',
GET_CITY: 'https://pv.sohu.com/cityjson?ie=utf-8',
GET_ALL_GROUPS_INFO_FORUSER: 'CityInterface/rest/Services/Portal.svc/AuthorityManage/GetAllGroupsInfoForUser',
GET_WEATHER: '/CityInterface/rest/services/CountyProduct.svc/GetWeather'
GET_WEATHER: '/CityInterface/rest/services/CountyProduct.svc/GetWeather',
SEND_MESSAGE_CODE: 'CityInterface/rest/services/portal.svc/SendMessVerificationCode'
};
var _default = function _default(vm) {
......@@ -99,6 +100,14 @@ var _default = function _default(vm) {
return Promise.resolve(res);
});
};
vm.sendMessVerificationCode = function () {
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
return vm.get(API.SEND_MESSAGE_CODE, data, config).then(function (res) {
return Promise.resolve(res);
});
};
};
exports["default"] = _default;
\ No newline at end of file
......@@ -16,7 +16,6 @@ const Authorized = ({
/>
),
}) => {
debugger
const childrenRender = typeof children === 'undefined' ? null : children;
const dom = check(authority, flatMenu, childrenRender, noMatch);
return <>{dom}</>;
......
......@@ -9,7 +9,6 @@ const checkPermissions = (
target,
Exception,
) => {
debugger;
const filterPath = [
{ name: '/', path: '/' },
{ name: 'civbase', path:`/civbase/?client=${window.globalConfig.client}` },
......@@ -38,7 +37,6 @@ const checkPermissions = (
};
function check(authority, flatMenu, target, Exception) {
debugger;
return checkPermissions(
authority,
flatMenu,
......
......@@ -56,7 +56,6 @@ export default class PromiseRender extends React.Component {
}
render() {
debugger
const { } = this.state;
const { ok, error, promise, ...rest } = this.props;
return component ? (
......
......@@ -40,7 +40,6 @@ var checkPermissions = function checkPermissions(authority, flatMenu, currentAut
};
function check(authority, flatMenu, target, Exception) {
debugger;
return checkPermissions(authority, flatMenu, _renderAuthorize.CURRENT, target, Exception);
}
......
......@@ -180,7 +180,7 @@ class CitySelector extends React.Component {
)
}
} else {
debugger
let flg1 = false
for (var k = 0; k < siteOption.length; k++) {
if (siteOption[k].city.indexOf(item.address) > -1) {
......@@ -235,14 +235,13 @@ class CitySelector extends React.Component {
}
handleChangeTab = (activeKey) => {
debugger
this.setState({
activeIndex: activeKey
})
}
selectCityHandle = (event, item, status) => {
debugger
event.persist();
this.setState({
......@@ -252,7 +251,6 @@ class CitySelector extends React.Component {
}
districtHandle = (event, item, status) => {
debugger
event.persist();
this.setState({
districtCurrentItem: item
......
......@@ -46,6 +46,13 @@
color: @primary-color;
vertical-align: top;
background: rgba(255, 255, 255, 0.85);
width: 36px;
height: 36px;
border-radius: 50%;
box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
transition: box-shadow .1s linear,opacity .4s linear;
background-position: center;
overflow: hidden;
}
}
}
......
......@@ -51,7 +51,6 @@ const SearchPanel = props => {
}
const handlerMore = (event) => {
debugger
event.persist && event.persist()
event && event.nativeEvent.stopImmediatePropagation()
setVisible(true)
......
......@@ -243,7 +243,6 @@ function () {
password: password,
onSuccess: this.onMQTTConnect.bind(this),
onFailure: function onFailure(e) {
debugger;
console.log(e);
}
};
......
......@@ -1309,8 +1309,6 @@ function onMessageArrived(message) {
ClientImpl.prototype._on_socket_message = function (event) {
debugger;
this._trace("Client._on_socket_message", event.data);
var messages = this._deframeMessages(event.data);
......
......@@ -179,7 +179,6 @@ class Notifier {
password: password,
onSuccess: this.onMQTTConnect.bind(this),
onFailure: function(e) {
debugger;
console.log(e);
},
};
......
......@@ -1219,7 +1219,6 @@ function onMessageArrived(message) {
* @ignore
*/
ClientImpl.prototype._on_socket_message = function (event) {
debugger
this._trace("Client._on_socket_message", event.data);
var messages = this._deframeMessages(event.data);
for (var i = 0; i < messages.length; i+=1) {
......
......@@ -66,7 +66,7 @@ const menuExtraRender = currentRoutes => {
<a style={{ display: 'flex', alignItems: 'center' }}>
<img
src={`http://panda-water.cn/web4/${currentRoutes &&
currentRoutes.extData.icon}`}
currentRoutes.extData && currentRoutes.extData.icon}`}
style={{ width: '20px', height: '20px' }}
/>
<span
......@@ -225,7 +225,6 @@ const BasicLayout = props => {
pathname: '/',
},
} = props;
document.title= props.global && props.global.title;
const basename = getBaseName();
const history = useHistory();
const [pathname, setPathname] = useState(props.location.pathname);
......@@ -306,7 +305,7 @@ const BasicLayout = props => {
fixSiderbar={true}
onMenuHeaderClick={event => handleLogo(event)}
onCollapse={collapse => handleMenuCollapse(collapse)}
menuExtraRender={extraRender.render}
menuExtraRender={props.menu.length > 0 ? extraRender.render: null}
rightContentRender={() => <RightContent {...props}/>}
headerContentRender={() => headerContentRender.render}
menu={{
......
......@@ -56,7 +56,6 @@ class Site {
}, {
ignoreSite: true
}).then(res => {
debugger
if(res && res.say.errMsg === '' && res.say.statusCode === ERR_OK) {
const result = res.getMe;
let city = self.weatherCity;
......@@ -427,7 +426,6 @@ class Site {
}
handEnd = (event, item) => {
debugger
event.persist();
const self = this;
if(item) {
......
import React from 'react';
import React, {
useCallback,
useEffect,
useState,
} from 'react';
import {
Button,
Form,
Input,
} from 'antd';
import omit from 'omit.js';
import styles from './index.less';
import LoginContext from './LoginContext';
import ItemMap from './map';
......@@ -29,6 +36,8 @@ const getFormItemOptions = ({
};
const LoginItem = props => {
const [count, setCount] = useState(props.countDown || 0);
const [timing, setTiming] = useState(false);
const {
onChange,
customProps,
......@@ -36,9 +45,47 @@ const LoginItem = props => {
rules,
name,
type,
getCaptchaButtonText,
getCaptchaSecondText,
updateActive,
tabUtil,
...restProps
} = props;
const onGetCaptcha = useCallback((mobile) => {
Http.sendMessVerificationCode({
phoneNumber: mobile
}, {
ignoreSite: true,
cacheBust: true
}).then(res => {
if(res) {
console.log(res)
setTiming(true);
}
}).catch(error => {
message.error("获取验证码失败")
})
}, []);
useEffect(() => {
let interval = 0;
const { countDown } = props;
if (timing) {
interval = window.setInterval(() => {
setCount((preSecond) => {
if (preSecond <= 1) {
setTiming(false);
clearInterval(interval);
return countDown || 60;
}
return preSecond - 1;
});
}, 1000);
}
return () => clearInterval(interval);
}, [timing]);
if (!name) {
return null;
}
......@@ -46,6 +93,34 @@ const LoginItem = props => {
const options = getFormItemOptions(props);
const otherProps = restProps || {};
if(type === 'Captcha') {
const inputProps = omit(otherProps, ['onGetCaptcha', 'countDown']);
return (
<FormItem shouldUpdate>
{({ getFieldValue, validateFields }) => (
<>
<FormItem name={name} {...options}>
<Input {...customProps} {...inputProps} />
</FormItem>
<Button
disabled={timing}
className={styles.getCaptcha}
size="large"
onClick={() => {
validateFields(['mobile'])
const value = getFieldValue('mobile');
onGetCaptcha(value);
}}
>
{timing ? `${count} 秒` : '获取验证码'}
</Button>
</>
)}
</FormItem>
)
}
return (
<FormItem name={name} {...options}>
<Input {...customProps} {...otherProps} />
......
......@@ -16,16 +16,22 @@
}
}
.getCaptcha {
color: @primary-6;
font-weight: 400;
cursor: pointer;
font-size: 12px;
width: auto;
padding: 0!important;
height: auto!important;
border: none!important;
}
.desc {
width: 88px;
font-size: 20px;
margin-bottom: 15px;
}
.getCaptcha {
display: block;
width: 100%;
}
.icon {
margin-left: 16px;
......
......@@ -51,6 +51,7 @@ export default {
size: 'large',
prefix: <MobileTwoTone className={styles.prefixIcon} />,
placeholder: 'mobile number',
id: 'mobile',
},
rules: [
{
......@@ -58,7 +59,7 @@ export default {
message: '请输入手机号码!',
},
{
pattern: /^1[34578]\d{9}$/,
pattern: /^0?1([38][0-9]|4[5-9]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/,
message: '输入手机号码格式错误!',
},
],
......
......@@ -6,7 +6,7 @@ const WxLogin = props => {
let url = `https://open.weixin.qq.com/connect/qrconnect?appid=${props.appid}&scope=${props.scope}&redirect_uri=${props.redirect_uri}&state=${props.state}&login_type=jssdk&self_redirect=${self_redirect}&styletype=${props.styletype || ''}&sizetype=${props.sizetype || ''}&bgcolor=${props.bgcolor|| ''}&rst=${props.rst || ''}`;
url += props.style ? "&stylle=" + props.style: "";
url += props.href ? "&href=" + props.href: "";
return <iframe frameBorder="0" allowTransparency="true" scrolling="no" width="250px" height="250px" src={url}></iframe>
return <iframe frameBorder="0" scrolling="no" width="250px" height="245px" src={url}></iframe>
}
export default WxLogin;
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _antd = require("antd");
var _jsBase = require("js-base64");
var _jsCookie = _interopRequireDefault(require("js-cookie"));
var _sha = _interopRequireDefault(require("sha1"));
var _SlideVerify = _interopRequireDefault(require("../../../components/SlideVerify"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _readOnlyError(name) { throw new Error("\"" + name + "\" is read-only"); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
var Login =
/*#__PURE__*/
function () {
function Login(props, callback) {
_classCallCheck(this, Login);
this.events = window.share.event;
this.globalConfig = props.global;
this.updateConfig = props.updateConfig;
this.createContext = props.createContext;
this.history = props.history;
this.callback = callback;
this.hasTry = false; // this.init();
}
_createClass(Login, [{
key: "init",
value: function init() {
this.loginFailed = false;
this.guid = Math.round(Math.random() * 10000 + Date.now()).toString(16);
this.redirect_state = _jsCookie["default"].get('redirect_state');
var token = this.globalConfig.initToken || _jsCookie["default"].get('token');
var self = this;
if (!!token) {
this.globalConfig.token = token;
Http.getUserInfo({
token: this.globalConfig.token,
subOID: 'subOID',
site: this.getLocalSiteBytoken(token),
'request.preventCache': Date.now()
}, {
ignoreSite: true
}).then(function (response) {
if (response && !response.errMsg) {
self.globalConfig.userInfo = {};
if (response.Groups && response.Groups instanceof Array && response.Groups.length) {
self.globalConfig.userInfo.Groups = response.Groups;
}
self.globalConfig.userInfo = Object.assign({}, response, self.globalConfig.userInfo);
self.updateConfig && self.updateConfig(self.globalConfig);
self.getUserInfoAndConfig();
}
});
}
}
}, {
key: "writeLogs",
value: function writeLogs() {
if (this.globalConfig.userInfo.UserImge === '') {
// _config.userInfo.UserImge = __webpack_public_path__ + "assets/images/icon/熊猫新2.png";
this.globalConfig.userInfo.UserImge = 'https://panda-water.cn/web4/assets/images/icon/熊猫新2.png';
}
if (this.globalConfig.userInfo.site) {
Http.writeLogs({
origin: window.location.origin,
client: this.globalConfig.client,
site: this.globalConfig.userInfo && this.globalConfig.userInfo.site ? this.globalConfig.userInfo.site : '',
loginName: this.globalConfig.userInfo && this.globalConfig.userInfo.fullName ? this.globalConfig.userInfo.fullName : ''
})["catch"](function (error) {
console.log(error);
});
}
}
}, {
key: "getIndustry",
value: function getIndustry(flag, token, _getIndustry) {
var _this2 = this;
this.globalConfig.userInfo.Industries = new Array();
if (this.globalConfig.userInfo.Groups && this.globalConfig.userInfo.Groups.length) {
this.globalConfig.userInfo.Groups.forEach(function (group) {
if (group.industry && _this2.globalConfig.userInfo.Industries.indexOf(group.industry) < 0) _this2.globalConfig.userInfo.Industries.push(group.industry);
});
}
if (!flag && this.isSignIn && this.globalConfig.userInfo.Industries.length && this.globalConfig.userInfo.Industries.length > 1) {
this.createContext(this); //console.log('云平台');
this.history.push('/industry');
return false;
}
this.getWebConfig(token, _getIndustry);
}
}, {
key: "getWebConfig",
value: function getWebConfig(token, getIndustry) {
var _this3 = this;
var self = this;
Http.getWebSiteConfig({
client: this.globalConfig.client,
token: token,
'request.preventCache': Date.now()
}).then(function (response) {
if (response && response.length > 0) {
self.globalConfig = Object.assign(self.globalConfig, response.shift(), {
theme: self.globalConfig.theme,
menu: self.globalConfig.menu,
style: self.globalConfig.style
});
self.updateConfig && self.updateConfig(self.globalConfig);
self.getProjectItems().then(function (res) {
window.subSysCfg = {};
response.forEach(function (item) {
window.subSysCfg[item.client] = item;
});
if (!!self.globalConfig.isShared) {
self.globalConfig.mode = 'single';
self.globalConfig.style = 'sandbox';
self.globalConfig.uiwidgets = [self.globalConfig.shareWidget];
self.globalConfig.widgets = [];
} // this.events.removeAllListeners('loginSuccess')
// this.events.removeAllListeners('toggleIndustry')
// window.share.event = this.events;
if (self.globalConfig.userInfo.site && self.globalConfig.userInfo.site.length > 0) {
Http.getWebSiteConfig({
client: self.globalConfig.client,
token: token,
'request.preventCache': Date.now()
}, {
ignoreSite: true
}).then(function (response) {
if (response && response.length > 0) {
var mainConf = response.shift();
if (mainConf.homepage) self.globalConfig.homepage = mainConf.homepage;
if (mainConf.bannerLogo) self.globalConfig.bannerLogo = mainConf.bannerLogo;
if (mainConf.logo) self.globalConfig.logo = mainConf.logo;
if (mainConf.mdi) self.globalConfig.mdi = mainConf.mdi;
if (mainConf.menu) self.globalConfig.menu = mainConf.menu;
if (mainConf.shortcutIcon) self.globalConfig.shortcutIcon = mainConf.shortcutIcon;
}
self.updateConfig && self.updateConfig(self.globalConfig);
getIndustry ? self.events.emit('toggleIndustry') : self.events.emit('loginSuccess');
window.share.event = self.events;
self.callback && self.callback();
});
} else {
//loginSuccess
self.updateConfig && self.updateConfig(self.globalConfig);
getIndustry ? self.events.emit('toggleIndustry') : self.events.emit('loginSuccess');
window.share.event = self.events;
self.callback && self.callback();
}
});
} else {
if (_this3.goLogin()) {
return false;
}
_this3.handleLoginError();
console.log('获取网络配置失败');
}
})["catch"](function (error) {
console.log(error);
_this3.handleLoginError();
console.log('获取网络配置失败');
});
}
}, {
key: "getProjectItems",
value: function getProjectItems() {
var MAX_BOTTOM = 0;
var isScale = false;
var widgetIndex = -1;
this.globalConfig.uiwidgets.map(function (item, index) {
if (parseInt(item['bottom']) > MAX_BOTTOM) {
MAX_BOTTOM = parseInt(item['bottom']);
}
if (!isScale && item.url.toLowerCase().indexOf('widgets/zoom') > -1) isScale = true;
if (widgetIndex == -1 && item.url.indexOf('ToggleProject/ToggleProject') > -1) widgetIndex = index;
});
var layers = this.globalConfig.mapsettings.layers;
if (layers.length === 0) {
widgetIndex != -1 && this.globalConfig.uiwidgets.splice(widgetIndex, 1);
return Promise.resolve({});
}
var layer = layers[0];
if (!layer.id) {
layer.layerType = 'dynamic';
} else {
layer.layerType = 'PipenetLayer';
}
if (layers.length > 1 && widgetIndex == -1) {
this.globalConfig.uiwidgets.push({
bottom: isScale ? MAX_BOTTOM + 70 : MAX_BOTTOM + 35,
config: '',
label: '方案切换',
right: 15,
url: 'product/webgisPanda/ToggleProject/ToggleProject'
});
}
if (layer.areaName) this.globalConfig.mapsettings.areasettings.areaName = layer.areaName;
if (layer.backgroundColor) this.globalConfig.mapsettings.areasettings.backgroundColor = layer.backgroundColor;
if (layer.boundColor) this.globalConfig.mapsettings.areasettings.boundColor = layer.boundColor;
if (layer.boundWidth) this.globalConfig.mapsettings.areasettings.boundWidth = layer.boundWidth;
if (Number.isInteger(parseInt(layer.backgroundOpacity))) {
this.globalConfig.mapsettings.areasettings.backgroundOpacity = layer.backgroundOpacity;
}
if (layer.extent) this.globalConfig.mapsettings.areasettings.extent = layer.extent;
if (layer.basemaps && layer.basemaps.length > 0) this.globalConfig.mapsettings.basemaps = layer.basemaps;
this.updateConfig && this.updateConfig(this.globalConfig);
return Promise.resolve({});
}
}, {
key: "handleLoginError",
value: function handleLoginError() {
_jsCookie["default"].set(this.globalConfig.client, '', {
path: '/'
});
_jsCookie["default"].set('token', '', {
path: '/'
});
_jsCookie["default"].set('site', '', {
path: '/'
});
_jsCookie["default"].set('loginMode', '', {
path: '/'
});
_jsCookie["default"].set('redirect_state', '', {
path: '/'
});
this.loginFailed = true;
}
}, {
key: "goLogin",
value: function goLogin() {
if (this.globalConfig.style === 'ios' && this.globalConfig.loginTemplate === 'IOSCloud.html') {
window.location.href = window.location.origin + '/#login';
return true;
} else {
return false;
}
}
}, {
key: "isRememberPWD",
value: function isRememberPWD(status) {
this.isRememberPWD = status;
}
}, {
key: "getLocalSiteBytoken",
value: function getLocalSiteBytoken(tk) {
var sStr = localStorage.getItem('loginSite'),
s = null;
if (sStr) {
var sObj = JSON.parse(sStr);
if (sObj && sObj[tk]) {
s = sObj[tk];
}
}
return s;
}
}, {
key: "loginByDD",
value: function loginByDD() {
var gotoUrl = 'https://oapi.dingtalk.com/connect/oauth2/sns_authorize?appid=dingoakne99srqra6hldv2&response_type=code&scope=snsapi_login&state=STATE&redirect_uri=' + encodeURIComponent(window.location.href);
var obj = DDLogin({
id: 'login_container',
"goto": encodeURIComponent(gotoUrl),
style: 'border:none;background-color:#FFFFFF;',
width: '365',
height: '400'
});
var handleMessage = function handleMessage(event) {
var origin = event.origin;
console.log('origin', event.origin);
if (origin == 'https://login.dingtalk.com') {
//判断是否来自ddLogin扫码事件。
var loginTmpCode = event.data;
var redirectUrl = 'https://oapi.dingtalk.com/connect/oauth2/sns_authorize?appid=dingoakne99srqra6hldv2&response_type=code&scope=snsapi_login&state=STATE&redirect_uri=' + encodeURIComponent(window.location.href) + '&loginTmpCode=' + loginTmpCode; //获取到loginTmpCode后就可以在这里构造跳转链接进行跳转了
window.location.href = redirectUrl;
}
};
if (typeof window.addEventListener != 'undefined') {
window.addEventListener('message', handleMessage, false);
} else if (typeof window.attachEvent != 'undefined') {
window.attachEvent('onmessage', handleMessage);
}
}
}, {
key: "ddLoginIn",
value: function ddLoginIn(code) {
var _this4 = this;
Http.getOA({
query: {
TmpAuthCode: code
},
cacheBust: true
}).then(function (response) {
if (response && response.data && response.data.getMe) {
var tk = response.data.getMe[0].token;
_this4.globalConfig.token = tk;
var url = window.location.href; //获取当前页面的url
if (url.indexOf('&code') != -1) {
//判断是否存在参数
url = (_readOnlyError("url"), url.replace(/(\&code|#)[^'"]*/, '')); //去除参数
window.history.pushState({}, 0, url);
}
_this4.isSignIn = true;
_this4.getUserInfoAndConfig();
} else {
_this4.handleLoginError(); // msgUtils.fault("登录失败,请检查用户名或密码");
// msgUtils.fault("登录失败," + error.message);
_this4.hasTry = true; //已经输错过密码
}
});
}
}, {
key: "otherLoginIn",
value: function otherLoginIn(usr, pwd) {
var _this5 = this;
var uesrName = (0, _jsBase.decode)(usr.substring(0, usr.length - 3)),
password = (0, _jsBase.decode)(pwd.substring(0, pwd.length - 3));
Http.generateToken({
query: {
f: 'json',
expiration: this.globalConfig.expiration,
//token过期时间(单位:秒)
client: 'referer',
username: uesrName,
password: (0, _sha["default"])(password).toUpperCase(),
referer: this.globalConfig.client,
skipMenuTest: 1
},
cacheBust: true
}).then(function (response) {
if (response && response.data && response.data.token) {
var tk = response.data.token; // token一天不过期
_this5.globalConfig.token = tk;
request(userInfoUrl, {
query: {
token: tk,
subOID: 'subOID',
site: _this5.getLocalSiteBytoken(tk)
},
cacheBust: true,
ignoreSite: true
}).then(function (response) {
if (response && response.data && response.data.errMsg) {
this.globalConfig.userInfo = {};
if (response.data.Groups && response.data.Groups instanceof Array && response.data.Groups.length) {
this.globalConfig.userInfo.Groups = response.data.Groups;
}
this.getUserInfoAndConfig();
}
});
} else {
_this.handleLoginError(); // msgUtils.fault("登录失败,请检查用户名或密码");
msgUtils.fault('登录失败,' + error.message);
_this.hasTry = true; //已经输错过密码
}
});
}
}, {
key: "getUserInfoAndConfig",
value: function getUserInfoAndConfig(failCallback, flag, industry) {
var token = this.globalConfig.token;
var site = _jsCookie["default"].get('site');
var self = this;
var _industrySite = null;
if (industry) {
var userInfo = self.globalConfig.userInfo && self.globalConfig.userInfo.Groups && self.globalConfig.userInfo.Groups instanceof Array ? self.globalConfig.userInfo.Groups.find(function (enter) {
return enter.industry === industry;
}) : null;
if (userInfo) {
self.globalConfig.userInfo = {
site: userInfo.site ? userInfo.site : "",
Groups: self.globalConfig.userInfo.Groups
};
_industrySite = userInfo.site ? userInfo.site : null;
}
} else if (!!site && self.isSignIn) {
self.globalConfig.userInfo = {
site: decodeURIComponent((0, _jsBase.decode)(site)),
Groups: self.globalConfig.userInfo && self.globalConfig.userInfo.Groups && self.globalConfig.userInfo.Groups instanceof Array ? self.globalConfig.userInfo.Groups : null
};
}
self.updateConfig && self.updateConfig(self.globalConfig);
if (this.isSignIn || !!industry) {
Http.getUserInfo({
token: token,
subOID: 'subOID',
industry: industry,
site: _industrySite ? _industrySite : this.getLocalSiteBytoken(token),
'request.preventCache': Date.now()
}, {
ignoreSite: true
}).then(function (response) {
try {
if (response && !response.errMsg) {
self.globalConfig.userInfo = response; // Object.assign(
// {},
// response,
// self.globalConfig.userInfo,
// {
// site: response.site === "" ? "": self.globalConfig.userInfo.site
// }
// );
// Cookies.set('site', this.globalConfig.userInfo.site);
console.log("self.globalConfig.userInfo", self.globalConfig.userInfo);
self.writeLogs();
self.getIndustry(flag, token, industry);
} else {
if (self.goLogin()) {
return false;
}
self.handleLoginError(failCallback);
}
self.updateConfig && self.updateConfig(self.globalConfig);
} catch (error) {
if (self.goLogin()) {
return false;
}
self.handleLoginError(failCallback);
console.log(error);
}
})["catch"](function (error) {
if (self.goLogin()) {
return false;
}
self.handleLoginError(failCallback);
console.log(error);
});
} else {
try {
self.writeLogs();
self.getIndustry(flag, token);
} catch (error) {
if (self.goLogin()) {
return false;
}
self.handleLoginError(failCallback);
console.log(error);
}
}
}
}, {
key: "login",
value: function login(usr, pwd, userPhone, isRememberPWD) {
var _this6 = this;
this.events.removeAllListeners('loginError');
var self = this;
Http.generateToken({
f: 'json',
expiration: this.globalConfig.expiration,
//token过期时间(单位:秒)
client: 'referer',
username: usr,
password: (0, _sha["default"])(pwd).toUpperCase(),
referer: this.globalConfig.client,
skipMenuTest: 1,
userPhone: userPhone,
'request.preventCache': Date.now()
}, {
ignoreSite: true
}).then(function (response) {
if (response && response.token) {
var token = response.token;
_jsCookie["default"].set('token', token);
var exp = 86400000;
_this6.globalConfig.token = token;
if (isRememberPWD) {
_jsCookie["default"].set(_this6.globalConfig.client, token, {
expires: exp / (24 * 60 * 60 * 1000),
path: '/'
});
_jsCookie["default"].set('token', token, {
expires: exp / (24 * 60 * 60 * 1000),
path: '/'
});
}
_this6.isSignIn = true;
_this6.updateConfig && _this6.updateConfig(_this6.globalConfig);
_this6.getUserInfoAndConfig();
} else {
self.hasTry = true;
self.events.emit('loginError', response);
_antd.message.error(response.error.message);
self.callback && self.callback(false);
}
})["catch"](function (error) {
self.hasTry = true;
self.handleLoginError();
self.events.emit('loginError', error.message);
_antd.message.error("登录服务异常");
console.log('登录失败', error.message);
});
}
}, {
key: "loginHandler",
value: function loginHandler(user, pwd, userPhone, isRememberPWD, ref) {
var self = this;
if (user && pwd) {
if (self.loginFailed && self.captchaObj) {
self.captchaObj.verify();
} else {
if (self.hasTry) {
self.slideVerify(ref, function () {
self.login(user, pwd, userPhone, isRememberPWD);
});
} else {
self.login(user, pwd, userPhone, isRememberPWD);
}
}
}
}
}, {
key: "slideVerify",
value: function slideVerify(ref, _onSuccess, onFail, onRefresh) {
this.events.emit('loginVisible', true);
if (this.renderVerify) {
this.renderVerify.destroy();
}
this.renderVerify = new _SlideVerify["default"]();
this.renderVerify.render({
container: ref.current,
onSuccess: function onSuccess() {
_onSuccess && _onSuccess();
}
});
}
}, {
key: "getCaptcha",
value: function getCaptcha(event, form) {
event.persist();
event.stopPropagation(); // const reg = /^0?1([38][0-9]|4[5-9]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/.test(phone);
// if(!reg.test(phone)) {
// }
try {
setTimeout(function () {
form.validateFields(['mobile']);
}, 1000);
} catch (errorInfo) {
console.log('Failed:', errorInfo);
} // Http.sendMessVerificationCode({
// phoneNumber: phoneNumber
// }, {
// ignoreSite: true,
// cacheBust: true
// }).then(res => {
// if(res) {
// console.log(res)
// }
// }).catch(error => {
// message.error("获取验证码失败")
// })
}
}]);
return Login;
}();
var _default = Login;
exports["default"] = _default;
\ No newline at end of file
......@@ -9,6 +9,7 @@ import React, {
import {
Alert,
Checkbox,
Form,
Modal,
Popover,
} from 'antd';
......@@ -77,8 +78,9 @@ const useRenderQcode = (props) => {
break;
case "Android":
if(firstValue[1] && firstValue[1].replace(/ /g, "").length > 0) {
element.push(
<div className={classNames(styles["quickMark-single"], "miniIOT-single")} key={index}>
<div className={classNames(styles["quickMark-single"], "Android-single")} key={index}>
<Popover placement="top" content={<QRCode value={firstValue[1].replace(/{ip}/ig, props.ip || window.location.host)}/>}>
<div className={styles['icon-Container']}>
<span className={styles.Android}></span>
......@@ -87,10 +89,12 @@ const useRenderQcode = (props) => {
</Popover>
</div>
)
}
break;
case "iPhone":
if(firstValue[1] && firstValue[1].replace(/ /g, "").length > 0) {
element.push(
<div className={classNames(styles["quickMark-single"], "miniIOT-single")} key={index}>
<div className={classNames(styles["quickMark-single"], "iphone-single")} key={index}>
<Popover placement="top" content={<QRCode value={firstValue[1].replace(/{ip}/ig, props.ip || window.location.host)}/>}>
<div className={styles['icon-Container']}>
<span className={styles.Wechat}></span>
......@@ -99,11 +103,14 @@ const useRenderQcode = (props) => {
</Popover>
</div>
)
}
break;
default:
if(item && item.replace(/ /g, "").length > 0) {
const indexIndex = element.findIndex(item => item.props.className.indexOf('Android-single') > -1);
element.splice(indexIndex, 1);
element.push(
<div className={classNames(styles["quickMark-single"], "miniIOT-single")} key={index}>
<div className={classNames(styles["quickMark-single"], "Android-single")} key={index}>
<Popover placement="top" content={<QRCode value={item.replace(/{ip}/ig, props.ip || window.location.host)}/>}>
<div className={styles['icon-Container']}>
<span className={styles.Android}></span>
......@@ -121,8 +128,9 @@ const useRenderQcode = (props) => {
}
const Account = props => {
return (
<LoginForm onSubmit={props.onSubmit}>
<LoginForm onSubmit={props.onSubmit} ref={props.formRef}>
{props.status === 'error' && props.type === 'account' && !props.submitting && (
<LoginMessage content="账户或密码错误" />
)}
......@@ -180,17 +188,34 @@ const IOTQRCode = () => {
}
const Phone = props => {
const [form] = Form.useForm();
return (
<LoginForm onSubmit={props.onSubmit}>
<LoginForm form={form} onSubmit={props.onSubmit}>
{props.status === 'error' && props.type === 'account' && !props.submitting && (
<LoginMessage content="账户或密码错误" />
)}
<Mobile name="phone" placeholder="请输入手机号码" />
<Captcha name="captcha"/>
<div className={styles.captcha}>
获取短信验证码
</div>
<Submit loading={props.submitting}>登录</Submit>
<Mobile name="mobile"
placeholder="请输入手机号码"
/>
<Captcha
name="captcha"
placeholder="请输入短信验证码"
countDown={60}
getCaptchaButtonText=""
getCaptchaSecondText="秒"
autocomplete="off"
rules={[
{
required: true,
message: '请输入短信验证码!',
},
]}/>
{/* <Button type="text" className={styles.captcha} tabIndex="-1"
onClick={(event) => {
props.action.getCaptcha(event, form)
}}>
获取短信验证码</Button> */}
<Submit loading={props.submitting} style={{marginTop: '0px'}}>登录</Submit>
</LoginForm>
)
}
......@@ -201,7 +226,6 @@ const IotComponent = props => {
const handlerType = (type) => {
props.setType(Display[type])
}
return (
<div className={styles.wechatQRcode}>
{
......@@ -228,9 +252,10 @@ const Login = props => {
const sliVerify = useRef();
const verifyModal = useRef();
const loginFormRef = useRef();
const formRef = useRef(null);
const footerRef = useRef();
const [status, setStatus ] = useState('normal');
const [autoLogin, setAutoLogin] = useState(true);
const [autoLogin, setAutoLogin] = useState(false);
const [submitting, setSubmitting] = useState(false);
const [currentDate, setCurrentDate] = useState({});
const [type, setType] = useState('Account');
......@@ -313,6 +338,30 @@ const Login = props => {
setSubmitting(false);
}, [visible])
const renderAddons = useRenderQcode(props.global)
const renderPlatform = () => {
const template = props.global.loginTemplate;
const params = {
fromRef:formRef,
type:type,
setType:setType,
status:status,
submitting:submitting,
autoLogin:autoLogin,
setAutoLogin:setAutoLogin,
action:action,
onSubmit:handleSubmit,
}
switch(template) {
case "DarkCloud.html":
case "Dark.html":
return <Account {...params}/>
case "Dark - IOTMultiLogin.html":
return <IotComponent {...params}/>
default:
return <Account {...params}/>
break;
}
}
return (
<div className={styles.main}>
<video
......@@ -377,14 +426,9 @@ const Login = props => {
<img src="https://panda-water.cn/web4/assets/images/login/dark/login.png" />
</div>
<div className={styles['login-form']}>
<IotComponent
type={type}
setType={setType}
status={status}
submitting={submitting}
autoLogin={autoLogin}
setAutoLogin={setAutoLogin}
onSubmit={handleSubmit}/>
{
renderPlatform()
}
</div>
</div>
</div>
......
......@@ -416,7 +416,6 @@ class Login {
});
}
getUserInfoAndConfig(failCallback, flag, industry) {
debugger
const token = this.globalConfig.token;
const site = Cookies.get('site');
const self = this;
......@@ -467,14 +466,15 @@ class Login {
.then(response => {
try {
if (response && !response.errMsg) {
self.globalConfig.userInfo = Object.assign(
{},
response,
self.globalConfig.userInfo,
{
site: response.site === "" ? "": self.globalConfig.userInfo.site
}
);
self.globalConfig.userInfo = response
// Object.assign(
// {},
// response,
// self.globalConfig.userInfo,
// {
// site: response.site === "" ? "": self.globalConfig.userInfo.site
// }
// );
// Cookies.set('site', this.globalConfig.userInfo.site);
console.log("self.globalConfig.userInfo", self.globalConfig.userInfo)
self.writeLogs();
......@@ -600,6 +600,35 @@ class Login {
})
}
getCaptcha(event, form) {
event.persist();
event.stopPropagation()
// const reg = /^0?1([38][0-9]|4[5-9]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/.test(phone);
// if(!reg.test(phone)) {
// }
try {
setTimeout(() => {
form.validateFields(['mobile'])
}, 1000)
} catch (errorInfo) {
console.log('Failed:', errorInfo);
}
// Http.sendMessVerificationCode({
// phoneNumber: phoneNumber
// }, {
// ignoreSite: true,
// cacheBust: true
// }).then(res => {
// if(res) {
// console.log(res)
// }
// }).catch(error => {
// message.error("获取验证码失败")
// })
}
}
export default Login;
......@@ -7,7 +7,6 @@ let Authorized = RenderAuthorize(getAuthority());
// Reload the rights component
const reloadAuthorized = () => {
debugger
Authorized = RenderAuthorize(getAuthority());
};
......
......@@ -17,7 +17,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
var Authorized = (0, _Authorized["default"])((0, _authority.getAuthority)()); // Reload the rights component
var reloadAuthorized = function reloadAuthorized() {
debugger;
Authorized = (0, _Authorized["default"])((0, _authority.getAuthority)());
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment