Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivWeb
Commits
eb77df5d
Commit
eb77df5d
authored
Dec 18, 2024
by
周宏民
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pref: 部分登录页支持验证码
parent
d287e259
Pipeline
#94743
passed with stages
Changes
7
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
98 additions
and
88 deletions
+98
-88
web5Config.json
public/web5Config.json
+6
-3
index.js
src/pages/user/login/template/project/dazu/index.js
+23
-14
index.js
src/pages/user/login/template/project/miLe/index.js
+37
-46
index.js
src/pages/user/login/template/project/ruiyun/index.js
+2
-1
index.js
src/pages/user/login/template/project/suzhou/index.js
+4
-2
index.js
src/pages/user/login/template/water/index.js
+13
-11
water.js
src/pages/user/login/template/water/water.js
+13
-11
No files found.
public/web5Config.json
View file @
eb77df5d
{
{
"loginTemplate"
:
[
"loginTemplate"
:
[
{
{
"title"
:
"Dark"
"title"
:
"Dark"
,
"isVerificationCode"
:
true
},
},
{
{
"title"
:
"Water"
"title"
:
"Water"
,
"isVerificationCode"
:
true
},
},
{
{
"title"
:
"Water2"
"title"
:
"Water2"
...
@@ -46,7 +48,8 @@
...
@@ -46,7 +48,8 @@
"title"
:
"项目 - 德庆"
"title"
:
"项目 - 德庆"
},
},
{
{
"title"
:
"项目 - 瑞云"
"title"
:
"项目 - 瑞云"
,
"isVerificationCode"
:
true
},
},
{
{
"title"
:
"项目 - 大悟"
"title"
:
"项目 - 大悟"
...
...
src/pages/user/login/template/project/dazu/index.js
View file @
eb77df5d
...
@@ -14,27 +14,27 @@ import { actionCreators } from '@/containers/App/store';
...
@@ -14,27 +14,27 @@ import { actionCreators } from '@/containers/App/store';
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
QueueAnim
from
'rc-queue-anim'
;
import
QueueAnim
from
'rc-queue-anim'
;
import
QRCode
from
'qrcode.react'
;
import
defaultSetting
from
'../../../../../../../config/defaultSetting'
;
import
defaultSetting
from
'../../../../../../../config/defaultSetting'
;
import
LoginAction
from
'../../../login'
;
import
LoginAction
from
'../../../login'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
import
Account
from
'../../../js/useAccount'
;
import
Account
from
'../../../js/useAccount'
;
import
{
defaultApp
}
from
'../../../../../../micro'
;
import
{
defaultApp
}
from
'../../../../../../micro'
;
import
logo
from
'./images/logo.png'
;
import
logo
from
'./images/logo.png'
;
import
qrcodePng
from
'./images/1.png'
import
qrcodePng
from
'./images/1.png'
;
import
QRCode
from
'qrcode.react'
;
import
loginTitlePng
from
'./images/text.png'
;
import
loginTitlePng
from
'./images/text.png'
;
const
PopOvercontent
=
()
=>
{
const
PopOvercontent
=
()
=>
{
const
qrcodes
=
window
.
globalConfig
&&
window
.
globalConfig
.
qrcode
;
const
qrcodes
=
window
.
globalConfig
&&
window
.
globalConfig
.
qrcode
;
if
(
qrcodes
)
{
if
(
qrcodes
)
{
return
<
QRCode
value
=
{
qrcodes
}
/>
;
return
<
QRCode
value
=
{
qrcodes
}
/>
;
}
}
return
<
span
>
手持
APP
下载未配置
<
/span>
;
return
<
span
>
手持
APP
下载未配置
<
/span>
;
}
}
;
const
Login
=
forwardRef
((
props
,
_ref
)
=>
{
const
Login
=
forwardRef
((
props
,
_ref
)
=>
{
const
isValidate
=
(
window
?.
globalConfig
?.
isVerification
||
0
)
*
1
===
1
;
const
{
isVerificationCode
,
isVerification
,
verificationCodeType
}
=
window
.
globalConfig
;
const
isValidate
=
(
isVerification
||
0
)
*
1
===
1
||
isVerificationCode
;
const
sliVerify
=
useRef
();
const
sliVerify
=
useRef
();
const
videoRef
=
useRef
();
const
videoRef
=
useRef
();
const
loginFormRef
=
useRef
();
const
loginFormRef
=
useRef
();
...
@@ -54,7 +54,9 @@ const Login = forwardRef((props, _ref) => {
...
@@ -54,7 +54,9 @@ const Login = forwardRef((props, _ref) => {
/* eslint-disable */
/* eslint-disable */
action
&&
action
&&
(
type
===
'Account'
(
type
===
'Account'
?
action
.
loginHandlerValidate
(
values
.
userName
,
values
.
password
,
null
,
autoLogin
,
sliVerify
,
values
?.
validate
)
?
isValidate
?
action
.
loginHandlerValidate
(
values
.
userName
,
values
.
password
,
null
,
autoLogin
,
'none'
,
values
?.
validate
)
:
action
.
loginHandler
(
values
.
userName
,
values
.
password
,
null
,
autoLogin
,
sliVerify
)
:
type
===
'Mobile'
:
type
===
'Mobile'
?
action
.
phoneLoginFormHandler
(
values
.
mobile
,
values
.
captcha
)
?
action
.
phoneLoginFormHandler
(
values
.
mobile
,
values
.
captcha
)
:
null
);
:
null
);
...
@@ -214,15 +216,17 @@ const Login = forwardRef((props, _ref) => {
...
@@ -214,15 +216,17 @@ const Login = forwardRef((props, _ref) => {
{
renderPlatform
()}
{
renderPlatform
()}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
Popover
content
=
{
PopOvercontent
}
title
=
"扫码下载APP"
placement
=
'right'
overlayClassName
=
{
'popover-style'
}
>
<
Popover
<
img
src
=
{
qrcodePng
}
alt
=
"APP"
className
=
{
styles
[
'qrcode-box'
]}
/
>
content
=
{
PopOvercontent
}
title
=
"扫码下载APP"
placement
=
"right"
overlayClassName
=
{
'popover-style'
}
>
<
img
src
=
{
qrcodePng
}
alt
=
"APP"
className
=
{
styles
[
'qrcode-box'
]}
/
>
<
/Popover
>
<
/Popover
>
<
/div
>
<
/div
>
<
/QueueAnim
>
<
/QueueAnim
>
<
div
key
=
"loginheader"
className
=
{
classnames
(
styles
[
'login-header'
])}
>
<
div
key
=
"loginheader"
className
=
{
classnames
(
styles
[
'login-header'
])}
>
<
QueueAnim
type
=
"left"
>
<
QueueAnim
type
=
"left"
>
<
div
key
=
"logintitle"
className
=
{
styles
[
'left-title'
]}
>
<
div
key
=
"logintitle"
className
=
{
styles
[
'left-title'
]}
>
...
@@ -242,7 +246,12 @@ const Login = forwardRef((props, _ref) => {
...
@@ -242,7 +246,12 @@ const Login = forwardRef((props, _ref) => {
<
/div
>
<
/div
>
<
/QueueAnim
>
<
/QueueAnim
>
<
/div
>
<
/div
>
<
div
className
=
{
styles
[
'copyright'
]}
>
Copyright
©重庆泽足水务投资建设有限公司
All
Rights
Reserved
<
a
target
=
"_blank"
id
=
"IndexCaseNumber"
href
=
"https://beian.miit.gov.cn"
>
渝
ICP
备
20000008
号
-
2
<
/a></
div
>
<
div
className
=
{
styles
[
'copyright'
]}
>
Copyright
©重庆泽足水务投资建设有限公司
All
Rights
Reserved
{
' '
}
<
a
target
=
"_blank"
id
=
"IndexCaseNumber"
href
=
"https://beian.miit.gov.cn"
>
渝
ICP
备
20000008
号
-
2
<
/a
>
<
/div
>
<
/div
>
<
/div
>
)
:
null
}
)
:
null
}
{
videoShow
?
(
{
videoShow
?
(
...
...
src/pages/user/login/template/project/miLe/index.js
View file @
eb77df5d
...
@@ -26,7 +26,8 @@ const renderQRCode = props => {
...
@@ -26,7 +26,8 @@ const renderQRCode = props => {
};
};
const
MiLeLogin
=
forwardRef
((
props
,
_ref
)
=>
{
const
MiLeLogin
=
forwardRef
((
props
,
_ref
)
=>
{
const
isValidate
=
(
window
?.
globalConfig
?.
isVerification
||
0
)
*
1
===
1
;
const
{
isVerificationCode
,
isVerification
,
verificationCodeType
}
=
window
.
globalConfig
;
const
isValidate
=
(
isVerification
||
0
)
*
1
===
1
||
isVerificationCode
;
const
sliVerify
=
useRef
();
const
sliVerify
=
useRef
();
const
loginFormRef
=
useRef
();
const
loginFormRef
=
useRef
();
const
formRef
=
useRef
(
null
);
const
formRef
=
useRef
(
null
);
...
@@ -47,14 +48,9 @@ const MiLeLogin = forwardRef((props, _ref) => {
...
@@ -47,14 +48,9 @@ const MiLeLogin = forwardRef((props, _ref) => {
/* eslint-disable */
/* eslint-disable */
action &&
action &&
(type === 'Account'
(type === 'Account'
? action.loginHandlerValidate(
? isValidate
values.userName,
? action.loginHandlerValidate(values.userName, values.password, null, autoLogin, 'none', values?.validate)
values.password,
: action.loginHandler(values.userName, values.password, null, autoLogin, sliVerify)
null,
autoLogin,
sliVerify,
values?.validate,
)
: type === 'Mobile'
: type === 'Mobile'
? action.phoneLoginFormHandler(values.mobile, values.captcha)
? action.phoneLoginFormHandler(values.mobile, values.captcha)
: null);
: null);
...
@@ -97,7 +93,7 @@ const MiLeLogin = forwardRef((props, _ref) => {
...
@@ -97,7 +93,7 @@ const MiLeLogin = forwardRef((props, _ref) => {
action && action.events && action.events.removeAllListeners('loginVisible');
action && action.events && action.events.removeAllListeners('loginVisible');
action && action.events && action.events.removeAllListeners('loginHomePage');
action && action.events && action.events.removeAllListeners('loginHomePage');
action && action.events && action.events.removeAllListeners('loginIndustry');
action && action.events && action.events.removeAllListeners('loginIndustry');
}
}
;
}, [props.loginMode]);
}, [props.loginMode]);
useEffect(() => {
useEffect(() => {
...
@@ -125,48 +121,47 @@ const MiLeLogin = forwardRef((props, _ref) => {
...
@@ -125,48 +121,47 @@ const MiLeLogin = forwardRef((props, _ref) => {
const handleWeek = () => {
const handleWeek = () => {
const weekOfDay = Number(moment().format('E'));
const weekOfDay = Number(moment().format('E'));
let weekDayName = ''
let weekDayName = ''
;
switch (weekOfDay) {
switch (weekOfDay) {
case 1:
case 1:
weekDayName = '周一'
weekDayName = '周一'
;
break
break
;
case 2:
case 2:
weekDayName = '周二'
weekDayName = '周二'
;
break
break
;
case 3:
case 3:
weekDayName = '周三'
weekDayName = '周三'
;
break
break
;
case 4:
case 4:
weekDayName = '周四'
weekDayName = '周四'
;
break
break
;
case 5:
case 5:
weekDayName = '周五'
weekDayName = '周五'
;
break
break
;
case 6:
case 6:
weekDayName = '周六'
weekDayName = '周六'
;
break
break
;
case 0:
case 0:
weekDayName = '周日'
weekDayName = '周日'
;
break
break
;
default:
default:
weekDayName = ''
weekDayName = '';
}
return weekDayName
}
}
return weekDayName;
};
useEffect(() => {
useEffect(() => {
const timer = setInterval(() => {
const timer = setInterval(() => {
setDateObj({
setDateObj({
curTime: moment().format('HH:mm:ss'),
curTime: moment().format('HH:mm:ss'),
week: handleWeek(),
week: handleWeek(),
date: moment().format('YYYY/MM/DD')
date: moment().format('YYYY/MM/DD')
,
});
});
}, 1000);
}, 1000);
return () => {
return () => {
clearInterval(timer);
clearInterval(timer);
};
};
}, [])
}, []);
return (
return (
<HelmetProvider>
<HelmetProvider>
...
@@ -184,9 +179,7 @@ const MiLeLogin = forwardRef((props, _ref) => {
...
@@ -184,9 +179,7 @@ const MiLeLogin = forwardRef((props, _ref) => {
{renderPlatform()}
{renderPlatform()}
</div>
</div>
</div>
</div>
{
{qrcodes.length > 0 && qrcodes[0] ? (
qrcodes.length > 0 && qrcodes[0]
?
<div className={styles.loginCcode}>
<div className={styles.loginCcode}>
<img
<img
src={
src={
...
@@ -198,8 +191,9 @@ const MiLeLogin = forwardRef((props, _ref) => {
...
@@ -198,8 +191,9 @@ const MiLeLogin = forwardRef((props, _ref) => {
/>
/>
<div className={styles.codeBig}>{renderQRCode(props.global)}</div>
<div className={styles.codeBig}>{renderQRCode(props.global)}</div>
</div>
</div>
: ''
) : (
}
''
)}
</div>
</div>
<div className={styles['login-header-wrapper']}>
<div className={styles['login-header-wrapper']}>
<div className={styles['login-header']}>
<div className={styles['login-header']}>
...
@@ -207,7 +201,7 @@ const MiLeLogin = forwardRef((props, _ref) => {
...
@@ -207,7 +201,7 @@ const MiLeLogin = forwardRef((props, _ref) => {
<div>
<div>
<img src={`
$
{
window
.
location
.
origin
}
/${logoImage}`} /
>
<img src={`
$
{
window
.
location
.
origin
}
/${logoImage}`} /
>
<
/div
>
<
/div
>
<
div
className
=
{
styles
[
'cn-title'
]}
>
{
props
.
global
.
title
||
"弥勒诚正自来水智慧水务平台"
}
<
/div
>
<
div
className
=
{
styles
[
'cn-title'
]}
>
{
props
.
global
.
title
||
'弥勒诚正自来水智慧水务平台'
}
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
{
styles
[
'right-timebox'
]}
>
<
div
className
=
{
styles
[
'right-timebox'
]}
>
<
div
className
=
{
styles
[
'curr-time'
]}
>
{
dateObj
.
curTime
}
<
/div
>
<
div
className
=
{
styles
[
'curr-time'
]}
>
{
dateObj
.
curTime
}
<
/div
>
...
@@ -218,22 +212,19 @@ const MiLeLogin = forwardRef((props, _ref) => {
...
@@ -218,22 +212,19 @@ const MiLeLogin = forwardRef((props, _ref) => {
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
{
{
projectName
?
(
projectName
?
<
div
className
=
{
styles
[
'krpano'
]}
>
<
div
className
=
{
styles
[
'krpano'
]}
>
<
Krpano
projectName
=
{
projectName
}
/
>
<
Krpano
projectName
=
{
projectName
}
/
>
<
/div>:nul
l
<
/div
>
}
)
:
null
}
<
Modal
centered
visible
=
{
visible
}
width
=
{
340
}
footer
=
{
null
}
closable
=
{
false
}
bodyStyle
=
{{
padding
:
'15px'
}}
>
<
Modal
centered
visible
=
{
visible
}
width
=
{
340
}
footer
=
{
null
}
closable
=
{
false
}
bodyStyle
=
{{
padding
:
'15px'
}}
>
<
div
ref
=
{
sliVerify
}
/
>
<
div
ref
=
{
sliVerify
}
/
>
<
/Modal
>
<
/Modal
>
<
/div
>
<
/div
>
<
/HelmetProvider
>
<
/HelmetProvider
>
)
);
});
})
const
mapStateToProps
=
state
=>
({
const
mapStateToProps
=
state
=>
({
global
:
state
.
getIn
([
'global'
,
'globalConfig'
]),
global
:
state
.
getIn
([
'global'
,
'globalConfig'
]),
...
...
src/pages/user/login/template/project/ruiyun/index.js
View file @
eb77df5d
...
@@ -53,7 +53,8 @@ const imgList = [
...
@@ -53,7 +53,8 @@ const imgList = [
},
},
];
];
const
Login
=
forwardRef
((
props
,
_ref
)
=>
{
const
Login
=
forwardRef
((
props
,
_ref
)
=>
{
const
isValidate
=
(
window
?.
globalConfig
?.
isVerification
||
0
)
*
1
===
1
;
const
{
isVerificationCode
,
isVerification
,
verificationCodeType
}
=
window
.
globalConfig
;
const
isValidate
=
(
isVerification
||
0
)
*
1
===
1
||
isVerificationCode
;
// const isValidate = true;
// const isValidate = true;
const
sliVerify
=
useRef
();
const
sliVerify
=
useRef
();
const
loginFormRef
=
useRef
();
const
loginFormRef
=
useRef
();
...
...
src/pages/user/login/template/project/suzhou/index.js
View file @
eb77df5d
...
@@ -41,8 +41,8 @@ const PopOvercontent = () => {
...
@@ -41,8 +41,8 @@ const PopOvercontent = () => {
const
welcomeList
=
[
'诚信为基'
,
'合作共赢'
,
'以人为本'
,
'效益优先'
];
const
welcomeList
=
[
'诚信为基'
,
'合作共赢'
,
'以人为本'
,
'效益优先'
];
const
Login
=
forwardRef
((
props
,
_ref
)
=>
{
const
Login
=
forwardRef
((
props
,
_ref
)
=>
{
// const isValidate = (window?.globalConfig?.isVerification || 0) * 1 === 1
;
const
{
isVerificationCode
,
isVerification
,
verificationCodeType
}
=
window
.
globalConfig
;
const
isValidate
=
tru
e
;
const
isValidate
=
(
isVerification
||
0
)
*
1
===
1
||
isVerificationCod
e
;
const
loginFormRef
=
useRef
();
const
loginFormRef
=
useRef
();
const
formRef
=
useRef
(
null
);
const
formRef
=
useRef
(
null
);
const
krpanoObjRef
=
useRef
(
null
);
const
krpanoObjRef
=
useRef
(
null
);
...
@@ -63,7 +63,9 @@ const Login = forwardRef((props, _ref) => {
...
@@ -63,7 +63,9 @@ const Login = forwardRef((props, _ref) => {
/* eslint-disable */
/* eslint-disable */
action
&&
action
&&
(
type
===
'Account'
(
type
===
'Account'
?
isValidate
?
action
.
loginHandlerValidate
(
values
.
userName
,
values
.
password
,
null
,
autoLogin
,
'none'
,
values
?.
validate
)
?
action
.
loginHandlerValidate
(
values
.
userName
,
values
.
password
,
null
,
autoLogin
,
'none'
,
values
?.
validate
)
:
action
.
loginHandler
(
values
.
userName
,
values
.
password
,
null
,
autoLogin
,
sliVerify
)
:
type
===
'Mobile'
:
type
===
'Mobile'
?
action
.
phoneLoginFormHandler
(
values
.
mobile
,
values
.
captcha
)
?
action
.
phoneLoginFormHandler
(
values
.
mobile
,
values
.
captcha
)
:
null
);
:
null
);
...
...
src/pages/user/login/template/water/index.js
View file @
eb77df5d
...
@@ -9,6 +9,7 @@ import { Helmet, HelmetProvider } from 'react-helmet-async';
...
@@ -9,6 +9,7 @@ import { Helmet, HelmetProvider } from 'react-helmet-async';
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
useHistory
,
withRouter
}
from
'@wisdom-utils/runtime'
;
import
{
useHistory
,
withRouter
}
from
'@wisdom-utils/runtime'
;
import
{
actionCreators
}
from
'@/containers/App/store'
;
import
{
actionCreators
}
from
'@/containers/App/store'
;
import
QRCode
from
'qrcode.react'
;
import
defaultSetting
from
'../../../../../../config/defaultSetting'
;
import
defaultSetting
from
'../../../../../../config/defaultSetting'
;
import
LoginAction
from
'../../login'
;
import
LoginAction
from
'../../login'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
...
@@ -16,18 +17,19 @@ import useRenderQcode from '../../js/useRenderQcode';
...
@@ -16,18 +17,19 @@ import useRenderQcode from '../../js/useRenderQcode';
import
Account
from
'../../js/useAccount'
;
import
Account
from
'../../js/useAccount'
;
import
IotComponent
from
'../../js/useIOTComponent'
;
import
IotComponent
from
'../../js/useIOTComponent'
;
import
{
defaultApp
}
from
'../../../../../micro'
;
import
{
defaultApp
}
from
'../../../../../micro'
;
import
QRCode
from
'qrcode.react'
;
const
renderQRCode
=
props
=>
{
const
renderQRCode
=
props
=>
{
const
qrcodes
=
props
?.
qrcode
?.
split
(
'|'
)
??
[];
const
qrcodes
=
props
?.
qrcode
?.
split
(
'|'
)
??
[];
if
(
qrcodes
.
length
>
0
&&
qrcodes
[
0
])
{
if
(
qrcodes
.
length
>
0
&&
qrcodes
[
0
])
{
le
t
value
=
qrcodes
[
0
].
replace
(
/{ip}/gi
,
props
.
ip
||
window
.
location
.
host
).
split
(
'='
)[
1
];
cons
t
value
=
qrcodes
[
0
].
replace
(
/{ip}/gi
,
props
.
ip
||
window
.
location
.
host
).
split
(
'='
)[
1
];
return
<
QRCode
value
=
{
value
}
/>
;
return
<
QRCode
value
=
{
value
}
/>
;
}
}
return
<
span
>
手持
APP
下载未配置
<
/span>
;
return
<
span
>
手持
APP
下载未配置
<
/span>
;
};
};
const
Login
=
forwardRef
((
props
,
_ref
)
=>
{
const
Login
=
forwardRef
((
props
,
_ref
)
=>
{
const
{
isVerificationCode
,
isVerification
,
verificationCodeType
}
=
window
.
globalConfig
;
const
isValidate
=
(
isVerification
||
0
)
*
1
===
1
||
isVerificationCode
;
const
sliVerify
=
useRef
();
const
sliVerify
=
useRef
();
const
loginFormRef
=
useRef
();
const
loginFormRef
=
useRef
();
const
formRef
=
useRef
(
null
);
const
formRef
=
useRef
(
null
);
...
@@ -45,7 +47,9 @@ const Login = forwardRef((props, _ref) => {
...
@@ -45,7 +47,9 @@ const Login = forwardRef((props, _ref) => {
/* eslint-disable */
/* eslint-disable */
action
&&
action
&&
(
type
===
'Account'
(
type
===
'Account'
?
action
.
loginHandler
(
values
.
userName
,
values
.
password
,
null
,
autoLogin
,
sliVerify
)
?
isValidate
?
action
.
loginHandlerValidate
(
values
.
userName
,
values
.
password
,
null
,
autoLogin
,
'none'
,
values
?.
validate
)
:
action
.
loginHandler
(
values
.
userName
,
values
.
password
,
null
,
autoLogin
,
sliVerify
)
:
type
===
'Mobile'
:
type
===
'Mobile'
?
action
.
phoneLoginFormHandler
(
values
.
mobile
,
values
.
captcha
)
?
action
.
phoneLoginFormHandler
(
values
.
mobile
,
values
.
captcha
)
:
null
);
:
null
);
...
@@ -75,7 +79,7 @@ const Login = forwardRef((props, _ref) => {
...
@@ -75,7 +79,7 @@ const Login = forwardRef((props, _ref) => {
});
});
action
.
events
.
on
(
'loginHomePage'
,
()
=>
{
action
.
events
.
on
(
'loginHomePage'
,
()
=>
{
props
.
history
.
push
(
`/homePage`
);
props
.
history
.
push
(
`/homePage`
);
})
})
;
action
.
events
.
on
(
'loginIndustry'
,
()
=>
{
action
.
events
.
on
(
'loginIndustry'
,
()
=>
{
props
.
history
.
push
(
`/industry`
);
props
.
history
.
push
(
`/industry`
);
});
});
...
@@ -108,7 +112,7 @@ const Login = forwardRef((props, _ref) => {
...
@@ -108,7 +112,7 @@ const Login = forwardRef((props, _ref) => {
loginMode
:
props
.
loginMode
,
loginMode
:
props
.
loginMode
,
updateLoginMode
:
props
.
updateLoginMode
,
updateLoginMode
:
props
.
updateLoginMode
,
};
};
return
<
Account
{...
params
}
/>
;
return
<
Account
{...
params
}
isValidate
=
{
isValidate
}
/>
;
};
};
/* eslint-disable */
/* eslint-disable */
...
@@ -150,9 +154,7 @@ const Login = forwardRef((props, _ref) => {
...
@@ -150,9 +154,7 @@ const Login = forwardRef((props, _ref) => {
<
/div
>
<
/div
>
<
div
className
=
{
classNames
(
styles
[
'login-block'
],
styles
.
caseHide
,
'animate__animated'
)}
ref
=
{
loginFormRef
}
>
<
div
className
=
{
classNames
(
styles
[
'login-block'
],
styles
.
caseHide
,
'animate__animated'
)}
ref
=
{
loginFormRef
}
>
<
div
className
=
{
styles
[
'login-form'
]}
>
{
renderPlatform
()}
<
/div
>
<
div
className
=
{
styles
[
'login-form'
]}
>
{
renderPlatform
()}
<
/div
>
{
{
qrcodes
.
length
>
0
&&
qrcodes
[
0
]
?
(
qrcodes
.
length
>
0
&&
qrcodes
[
0
]
?
<
div
className
=
{
styles
.
loginCcode
}
>
<
div
className
=
{
styles
.
loginCcode
}
>
<
img
<
img
src
=
{
src
=
{
...
@@ -164,9 +166,9 @@ const Login = forwardRef((props, _ref) => {
...
@@ -164,9 +166,9 @@ const Login = forwardRef((props, _ref) => {
/>
/>
<
div
className
=
{
styles
.
codeBig
}
>
{
renderQRCode
(
props
.
global
)}
<
/div
>
<
div
className
=
{
styles
.
codeBig
}
>
{
renderQRCode
(
props
.
global
)}
<
/div
>
<
/div
>
<
/div
>
:
''
)
:
(
}
''
)}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
...
src/pages/user/login/template/water/water.js
View file @
eb77df5d
...
@@ -9,6 +9,7 @@ import { Helmet, HelmetProvider } from 'react-helmet-async';
...
@@ -9,6 +9,7 @@ import { Helmet, HelmetProvider } from 'react-helmet-async';
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
useHistory
,
withRouter
}
from
'@wisdom-utils/runtime'
;
import
{
useHistory
,
withRouter
}
from
'@wisdom-utils/runtime'
;
import
{
actionCreators
}
from
'@/containers/App/store'
;
import
{
actionCreators
}
from
'@/containers/App/store'
;
import
QRCode
from
'qrcode.react'
;
import
defaultSetting
from
'../../../../../../config/defaultSetting'
;
import
defaultSetting
from
'../../../../../../config/defaultSetting'
;
import
LoginAction
from
'../../login'
;
import
LoginAction
from
'../../login'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
...
@@ -16,18 +17,19 @@ import useRenderQcode from '../../js/useRenderQcode';
...
@@ -16,18 +17,19 @@ import useRenderQcode from '../../js/useRenderQcode';
import
Account
from
'../../js/useAccount'
;
import
Account
from
'../../js/useAccount'
;
import
IotComponent
from
'../../js/useIOTComponent'
;
import
IotComponent
from
'../../js/useIOTComponent'
;
import
{
defaultApp
}
from
'../../../../../micro'
;
import
{
defaultApp
}
from
'../../../../../micro'
;
import
QRCode
from
'qrcode.react'
;
const
renderQRCode
=
props
=>
{
const
renderQRCode
=
props
=>
{
const
qrcodes
=
props
?.
qrcode
?.
split
(
'|'
)
??
[];
const
qrcodes
=
props
?.
qrcode
?.
split
(
'|'
)
??
[];
if
(
qrcodes
.
length
>
0
&&
qrcodes
[
0
])
{
if
(
qrcodes
.
length
>
0
&&
qrcodes
[
0
])
{
le
t
value
=
qrcodes
[
0
].
replace
(
/{ip}/gi
,
props
.
ip
||
window
.
location
.
host
).
split
(
'='
)[
1
];
cons
t
value
=
qrcodes
[
0
].
replace
(
/{ip}/gi
,
props
.
ip
||
window
.
location
.
host
).
split
(
'='
)[
1
];
return
<
QRCode
value
=
{
value
}
/>
;
return
<
QRCode
value
=
{
value
}
/>
;
}
}
return
<
span
>
手持
APP
下载未配置
<
/span>
;
return
<
span
>
手持
APP
下载未配置
<
/span>
;
};
};
const
Login
=
forwardRef
((
props
,
_ref
)
=>
{
const
Login
=
forwardRef
((
props
,
_ref
)
=>
{
const
{
isVerificationCode
,
isVerification
,
verificationCodeType
}
=
window
.
globalConfig
;
const
isValidate
=
(
isVerification
||
0
)
*
1
===
1
||
isVerificationCode
;
const
sliVerify
=
useRef
();
const
sliVerify
=
useRef
();
const
loginFormRef
=
useRef
();
const
loginFormRef
=
useRef
();
const
formRef
=
useRef
(
null
);
const
formRef
=
useRef
(
null
);
...
@@ -45,7 +47,9 @@ const Login = forwardRef((props, _ref) => {
...
@@ -45,7 +47,9 @@ const Login = forwardRef((props, _ref) => {
/* eslint-disable */
/* eslint-disable */
action
&&
action
&&
(
type
===
'Account'
(
type
===
'Account'
?
action
.
loginHandler
(
values
.
userName
,
values
.
password
,
null
,
autoLogin
,
sliVerify
)
?
isValidate
?
action
.
loginHandlerValidate
(
values
.
userName
,
values
.
password
,
null
,
autoLogin
,
'none'
,
values
?.
validate
)
:
action
.
loginHandler
(
values
.
userName
,
values
.
password
,
null
,
autoLogin
,
sliVerify
)
:
type
===
'Mobile'
:
type
===
'Mobile'
?
action
.
phoneLoginFormHandler
(
values
.
mobile
,
values
.
captcha
)
?
action
.
phoneLoginFormHandler
(
values
.
mobile
,
values
.
captcha
)
:
null
);
:
null
);
...
@@ -75,7 +79,7 @@ const Login = forwardRef((props, _ref) => {
...
@@ -75,7 +79,7 @@ const Login = forwardRef((props, _ref) => {
});
});
action
.
events
.
on
(
'loginHomePage'
,
()
=>
{
action
.
events
.
on
(
'loginHomePage'
,
()
=>
{
props
.
history
.
push
(
`/homePage`
);
props
.
history
.
push
(
`/homePage`
);
})
})
;
action
.
events
.
on
(
'loginIndustry'
,
()
=>
{
action
.
events
.
on
(
'loginIndustry'
,
()
=>
{
props
.
history
.
push
(
`/industry`
);
props
.
history
.
push
(
`/industry`
);
});
});
...
@@ -108,7 +112,7 @@ const Login = forwardRef((props, _ref) => {
...
@@ -108,7 +112,7 @@ const Login = forwardRef((props, _ref) => {
loginMode
:
props
.
loginMode
,
loginMode
:
props
.
loginMode
,
updateLoginMode
:
props
.
updateLoginMode
,
updateLoginMode
:
props
.
updateLoginMode
,
};
};
return
<
Account
{...
params
}
/>
;
return
<
Account
{...
params
}
isValidate
=
{
isValidate
}
/>
;
};
};
/* eslint-disable */
/* eslint-disable */
...
@@ -150,9 +154,7 @@ const Login = forwardRef((props, _ref) => {
...
@@ -150,9 +154,7 @@ const Login = forwardRef((props, _ref) => {
<
/div
>
<
/div
>
<
div
className
=
{
classNames
(
styles
[
'login-block'
],
styles
.
caseHide
,
'animate__animated'
)}
ref
=
{
loginFormRef
}
>
<
div
className
=
{
classNames
(
styles
[
'login-block'
],
styles
.
caseHide
,
'animate__animated'
)}
ref
=
{
loginFormRef
}
>
<
div
className
=
{
styles
[
'login-form'
]}
>
{
renderPlatform
()}
<
/div
>
<
div
className
=
{
styles
[
'login-form'
]}
>
{
renderPlatform
()}
<
/div
>
{
{
qrcodes
.
length
>
0
&&
qrcodes
[
0
]
?
(
qrcodes
.
length
>
0
&&
qrcodes
[
0
]
?
<
div
className
=
{
styles
.
loginCcode
}
>
<
div
className
=
{
styles
.
loginCcode
}
>
<
img
<
img
src
=
{
src
=
{
...
@@ -164,9 +166,9 @@ const Login = forwardRef((props, _ref) => {
...
@@ -164,9 +166,9 @@ const Login = forwardRef((props, _ref) => {
/>
/>
<
div
className
=
{
styles
.
codeBig
}
>
{
renderQRCode
(
props
.
global
)}
<
/div
>
<
div
className
=
{
styles
.
codeBig
}
>
{
renderQRCode
(
props
.
global
)}
<
/div
>
<
/div
>
<
/div
>
:
''
)
:
(
}
''
)}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment