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
c452305a
Commit
c452305a
authored
Jan 05, 2024
by
徐乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 修改默认登录页不配置二维码时不显示二维码框
parent
be7099fd
Pipeline
#83879
passed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
index.js
src/pages/user/login/template/water/index.js
+21
-14
No files found.
src/pages/user/login/template/water/index.js
View file @
c452305a
...
@@ -19,7 +19,7 @@ import { defaultApp } from '../../../../../micro';
...
@@ -19,7 +19,7 @@ import { defaultApp } from '../../../../../micro';
import
QRCode
from
'qrcode.react'
;
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
])
{
let
value
=
qrcodes
[
0
].
replace
(
/{ip}/gi
,
props
.
ip
||
window
.
location
.
host
).
split
(
'='
)[
1
];
let
value
=
qrcodes
[
0
].
replace
(
/{ip}/gi
,
props
.
ip
||
window
.
location
.
host
).
split
(
'='
)[
1
];
return
<
QRCode
value
=
{
value
}
/>
;
return
<
QRCode
value
=
{
value
}
/>
;
...
@@ -35,6 +35,7 @@ const Login = forwardRef((props, _ref) => {
...
@@ -35,6 +35,7 @@ const Login = forwardRef((props, _ref) => {
const
[
status
,
setStatus
]
=
useState
(
'normal'
);
const
[
status
,
setStatus
]
=
useState
(
'normal'
);
const
[
autoLogin
,
setAutoLogin
]
=
useState
(
false
);
const
[
autoLogin
,
setAutoLogin
]
=
useState
(
false
);
const
[
submitting
,
setSubmitting
]
=
useState
(
false
);
const
[
submitting
,
setSubmitting
]
=
useState
(
false
);
const
qrcodes
=
props
.
global
?.
qrcode
?.
split
(
'|'
)
??
[];
const
[
type
,
setType
]
=
useState
(
'Account'
);
const
[
type
,
setType
]
=
useState
(
'Account'
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
history
=
useHistory
();
const
history
=
useHistory
();
...
@@ -46,8 +47,8 @@ const Login = forwardRef((props, _ref) => {
...
@@ -46,8 +47,8 @@ const Login = forwardRef((props, _ref) => {
(
type
===
'Account'
(
type
===
'Account'
?
action
.
loginHandler
(
values
.
userName
,
values
.
password
,
null
,
autoLogin
,
sliVerify
)
?
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
);
setSubmitting
(
true
);
setSubmitting
(
true
);
props
.
updateCurrentIndex
&&
props
.
updateCurrentIndex
(
-
1
);
props
.
updateCurrentIndex
&&
props
.
updateCurrentIndex
(
-
1
);
...
@@ -141,17 +142,23 @@ const Login = forwardRef((props, _ref) => {
...
@@ -141,17 +142,23 @@ 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
>
<
div
className
=
{
styles
.
loginCcode
}
>
{
<
img
qrcodes
.
length
>
0
&&
qrcodes
[
0
]
src
=
{
?
props
.
global
&&
<
div
className
=
{
styles
.
loginCcode
}
>
props
.
global
.
transformDevAssetsBaseURL
&&
<
img
props
.
global
.
transformDevAssetsBaseURL
(
'assets/images/login/石家庄/小程序@2x.png'
)
src
=
{
}
props
.
global
&&
alt
=
""
props
.
global
.
transformDevAssetsBaseURL
&&
/>
props
.
global
.
transformDevAssetsBaseURL
(
'assets/images/login/石家庄/小程序@2x.png'
)
<
div
className
=
{
styles
.
codeBig
}
>
{
renderQRCode
(
props
.
global
)}
<
/div
>
}
<
/div
>
alt
=
""
/>
<
div
className
=
{
styles
.
codeBig
}
>
{
renderQRCode
(
props
.
global
)}
<
/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