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
497ea497
Commit
497ea497
authored
Nov 08, 2024
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 增加验证码formItem,修改大足登录页
parent
3d11bbd9
Pipeline
#93760
passed with stages
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
131 additions
and
5 deletions
+131
-5
LoginItem.js
src/pages/user/login/components/Login/LoginItem.js
+57
-1
index.js
src/pages/user/login/components/Login/index.js
+1
-0
index.less
src/pages/user/login/components/Login/index.less
+48
-0
map.js
src/pages/user/login/components/Login/map.js
+15
-0
useAccount.js
src/pages/user/login/js/useAccount.js
+2
-1
index.js
src/pages/user/login/template/project/dazu/index.js
+4
-3
index.less
src/pages/user/login/template/project/dazu/index.less
+4
-0
No files found.
src/pages/user/login/components/Login/LoginItem.js
View file @
497ea497
import
'kit_logger'
;
import
'kit_logger'
;
import
React
,
{
useCallback
,
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useCallback
,
useEffect
,
useState
}
from
'react'
;
import
{
FieldNumberOutlined
,
ReloadOutlined
}
from
'@ant-design/icons'
;
import
{
Button
,
Form
,
Input
,
message
}
from
'antd'
;
import
{
Button
,
Form
,
Input
,
message
}
from
'antd'
;
import
omit
from
'omit.js'
;
import
omit
from
'omit.js'
;
...
@@ -30,6 +30,53 @@ const getFormItemOptions = ({ onChange, defaultValue, customProps = {}, rules })
...
@@ -30,6 +30,53 @@ const getFormItemOptions = ({ onChange, defaultValue, customProps = {}, rules })
return
options
;
return
options
;
};
};
const
ValidateCode
=
props
=>
{
const
[
count
,
setCount
]
=
useState
(
0
);
const
codeUrl
=
window
?.
globalConfig
?.
hasGateWay
?
'/PandaCore/Identity/GetVerificationCode'
:
'/PandaCore/GCK/BussinessAuth/GetVerificationCode'
;
useEffect
(()
=>
{
// eslint-disable-next-line no-use-before-define
window
.
share
.
event
.
on
(
'loginError'
,
handError
);
return
()
=>
{
// eslint-disable-next-line no-use-before-define
window
.
share
.
event
.
removeListener
(
'loginError'
,
handError
);
};
},
[]);
const
handError
=
()
=>
{
setCount
(
Date
.
now
());
};
const
handeRefresh
=
()
=>
{
setCount
(
Date
.
now
());
};
const
handChange
=
value
=>
{
props
?.
onChange
?.(
value
);
};
return
(
<
div
className
=
{
styles
.
validate_view
}
>
<
Input
size
=
{
props
.
size
||
'large'
}
prefix
=
{
props
?.
prefix
||
<
FieldNumberOutlined
/>
}
className
=
{
styles
.
validate_input
}
value
=
{
props
.
value
||
''
}
placeholder
=
{
props
?.
placeholder
||
'请输入验证码'
}
onChange
=
{
handChange
}
/
>
<
div
className
=
{
styles
.
validate_img
}
>
<
img
src
=
{
`
${
codeUrl
}
?time=
${
count
}
`
}
alt
=
""
/>
<
div
className
=
{
styles
.
validate_refresh
}
onClick
=
{
handeRefresh
}
>
<
ReloadOutlined
/>
<
/div
>
<
/div
>
<
/div
>
);
};
const
LoginItem
=
props
=>
{
const
LoginItem
=
props
=>
{
const
[
count
,
setCount
]
=
useState
(
props
.
countDown
||
0
);
const
[
count
,
setCount
]
=
useState
(
props
.
countDown
||
0
);
const
[
timing
,
setTiming
]
=
useState
(
false
);
const
[
timing
,
setTiming
]
=
useState
(
false
);
...
@@ -149,6 +196,15 @@ const LoginItem = props => {
...
@@ -149,6 +196,15 @@ const LoginItem = props => {
<
/FormItem
>
<
/FormItem
>
);
);
}
}
if
(
type
===
'Validate'
)
{
return
(
<
Form
.
Item
name
=
{
name
}
{...
options
}
>
<
ValidateCode
{...
customProps
}
{...
otherProps
}
/
>
<
/Form.Item
>
);
}
return
(
return
(
<
FormItem
name
=
{
name
}
{...
options
}
>
<
FormItem
name
=
{
name
}
{...
options
}
>
<
Input
{...
customProps
}
{...
otherProps
}
/
>
<
Input
{...
customProps
}
{...
otherProps
}
/
>
...
...
src/pages/user/login/components/Login/index.js
View file @
497ea497
...
@@ -50,5 +50,6 @@ Login.Mobile = LoginItem.Mobile;
...
@@ -50,5 +50,6 @@ Login.Mobile = LoginItem.Mobile;
Login
.
Captcha
=
LoginItem
.
Captcha
;
Login
.
Captcha
=
LoginItem
.
Captcha
;
Login
.
NewYearMobile
=
LoginItem
.
NewYearMobile
;
Login
.
NewYearMobile
=
LoginItem
.
NewYearMobile
;
Login
.
NewYearCaptcha
=
LoginItem
.
NewYearCaptcha
;
Login
.
NewYearCaptcha
=
LoginItem
.
NewYearCaptcha
;
Login
.
Validate
=
LoginItem
.
Validate
;
export
default
Login
;
export
default
Login
;
src/pages/user/login/components/Login/index.less
View file @
497ea497
...
@@ -74,4 +74,52 @@
...
@@ -74,4 +74,52 @@
width: 100%;
width: 100%;
margin-top: 14px;
margin-top: 14px;
}
}
.validate_view {
display: flex;
align-items: center;
.validate_input {
flex: 1;
margin-right: 20px;
}
.validate_img {
width: 92px;
height: 40px;
flex: none;
position: relative;
cursor: pointer;
border: 1px solid #d9d9d9;
border-radius: 2px;
&:hover {
.validate_refresh {
opacity: 1;
background-color: rgba(238, 238, 238, 0.7);
}
}
img {
width: 100%;
height: 100%;
object-fit: contain;
}
.validate_refresh {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 1;
display: flex;
opacity: 0;
align-items: center;
justify-content: center;
cursor: pointer;
color: #666666;
}
}
}
}
}
src/pages/user/login/components/Login/map.js
View file @
497ea497
...
@@ -7,6 +7,7 @@ import {
...
@@ -7,6 +7,7 @@ import {
UserOutlined
,
UserOutlined
,
EyeInvisibleOutlined
,
EyeInvisibleOutlined
,
EyeTwoTone
,
EyeTwoTone
,
FieldNumberOutlined
,
}
from
'@ant-design/icons'
;
}
from
'@ant-design/icons'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
...
@@ -119,4 +120,18 @@ export default {
...
@@ -119,4 +120,18 @@ export default {
},
},
],
],
},
},
Validate
:
{
props
:
{
size
:
'large'
,
id
:
'validate'
,
prefix
:
<
FieldNumberOutlined
className
=
{
styles
.
prefixIcon
}
/>
,
placeholder
:
'请输入验证码'
,
},
rules
:
[
{
required
:
true
,
message
:
'请输入验证码'
,
},
],
},
};
};
src/pages/user/login/js/useAccount.js
View file @
497ea497
...
@@ -4,7 +4,7 @@ import { useIntl } from '@wisdom-utils/components';
...
@@ -4,7 +4,7 @@ import { useIntl } from '@wisdom-utils/components';
import
LoginForm
from
'../components/Login'
;
import
LoginForm
from
'../components/Login'
;
import
LoginMessage
from
'./loginMessage'
;
import
LoginMessage
from
'./loginMessage'
;
/* eslint-disable */
/* eslint-disable */
const
{
UserName
,
Password
,
Submit
}
=
LoginForm
;
const
{
UserName
,
Password
,
Validate
,
Submit
}
=
LoginForm
;
const
useAccount
=
props
=>
(
const
useAccount
=
props
=>
(
<
LoginForm
onSubmit
=
{
props
.
onSubmit
}
welcome
=
{
props
.
welcome
}
>
<
LoginForm
onSubmit
=
{
props
.
onSubmit
}
welcome
=
{
props
.
welcome
}
>
{
props
.
status
===
'error'
&&
props
.
type
===
'account'
&&
!
props
.
submitting
&&
(
{
props
.
status
===
'error'
&&
props
.
type
===
'account'
&&
!
props
.
submitting
&&
(
...
@@ -42,6 +42,7 @@ const useAccount = props => (
...
@@ -42,6 +42,7 @@ const useAccount = props => (
},
},
]}
]}
/
>
/
>
{
props
?.
isValidate
?
<
Validate
name
=
"validate"
/>
:
null
}
<
div
>
<
div
>
<
Checkbox
<
Checkbox
checked
=
{
props
.
autoLogin
}
checked
=
{
props
.
autoLogin
}
...
...
src/pages/user/login/template/project/dazu/index.js
View file @
497ea497
...
@@ -34,6 +34,7 @@ const PopOvercontent = () =>{
...
@@ -34,6 +34,7 @@ const PopOvercontent = () =>{
}
}
const
Login
=
forwardRef
((
props
,
_ref
)
=>
{
const
Login
=
forwardRef
((
props
,
_ref
)
=>
{
const
isValidate
=
(
window
?.
globalConfig
?.
isVerification
||
0
)
*
1
===
1
;
const
sliVerify
=
useRef
();
const
sliVerify
=
useRef
();
const
videoRef
=
useRef
();
const
videoRef
=
useRef
();
const
loginFormRef
=
useRef
();
const
loginFormRef
=
useRef
();
...
@@ -53,7 +54,7 @@ const Login = forwardRef((props, _ref) => {
...
@@ -53,7 +54,7 @@ const Login = forwardRef((props, _ref) => {
/* eslint-disable */
/* eslint-disable */
action
&&
action
&&
(
type
===
'Account'
(
type
===
'Account'
?
action
.
loginHandler
(
values
.
userName
,
values
.
password
,
null
,
autoLogin
,
sliVerify
)
?
action
.
loginHandler
Validate
(
values
.
userName
,
values
.
password
,
null
,
autoLogin
,
sliVerify
,
values
?.
validate
)
:
type
===
'Mobile'
:
type
===
'Mobile'
?
action
.
phoneLoginFormHandler
(
values
.
mobile
,
values
.
captcha
)
?
action
.
phoneLoginFormHandler
(
values
.
mobile
,
values
.
captcha
)
:
null
);
:
null
);
...
@@ -108,7 +109,7 @@ const Login = forwardRef((props, _ref) => {
...
@@ -108,7 +109,7 @@ const Login = forwardRef((props, _ref) => {
updateLoginMode
:
props
.
updateLoginMode
,
updateLoginMode
:
props
.
updateLoginMode
,
welcome
:
null
,
welcome
:
null
,
};
};
return
<
Account
{...
params
}
/>
;
return
<
Account
{...
params
}
isValidate
=
{
isValidate
}
/>
;
};
};
/* eslint-disable */
/* eslint-disable */
...
@@ -205,7 +206,7 @@ const Login = forwardRef((props, _ref) => {
...
@@ -205,7 +206,7 @@ const Login = forwardRef((props, _ref) => {
<
/QueueAnim
>
<
/QueueAnim
>
<
QueueAnim
type
=
"scale"
duration
=
{
1000
}
>
<
QueueAnim
type
=
"scale"
duration
=
{
1000
}
>
<
div
key
=
{
'innerwrapper'
}
className
=
{
classnames
(
styles
[
'inner-wrapper'
])}
>
<
div
key
=
{
'innerwrapper'
}
className
=
{
classnames
(
styles
[
'inner-wrapper'
])}
>
<
div
className
=
{
styles
[
'inner-center'
]
}
>
<
div
className
=
{
classnames
(
styles
[
'inner-center'
],
isValidate
?
styles
[
'inner-center-validate'
]
:
''
)
}
>
<
div
className
=
{
styles
[
'welcome-title'
]}
>
<
div
className
=
{
styles
[
'welcome-title'
]}
>
<
img
src
=
{
loginTitlePng
}
alt
=
"login-title"
/>
<
img
src
=
{
loginTitlePng
}
alt
=
"login-title"
/>
<
/div
>
<
/div
>
...
...
src/pages/user/login/template/project/dazu/index.less
View file @
497ea497
...
@@ -89,6 +89,10 @@
...
@@ -89,6 +89,10 @@
border: 1px solid #FFFFFF;
border: 1px solid #FFFFFF;
box-shadow: 1px 1px 12px -3px #22222277;
box-shadow: 1px 1px 12px -3px #22222277;
border-radius: 8px 10px 10px 10px;
border-radius: 8px 10px 10px 10px;
&.inner-center-validate {
height: 450px;
}
}
}
.welcome-title {
.welcome-title {
...
...
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