Commit 31b550d5 authored by 李纪文's avatar 李纪文

feat: 弥勒登录页增加验证码登录

parent cb0faf13
Pipeline #93904 waiting for manual action with stages
...@@ -130,7 +130,7 @@ export default { ...@@ -130,7 +130,7 @@ export default {
rules: [ rules: [
{ {
required: true, required: true,
message: '请输入验证码', message: '请输入验证码!',
}, },
], ],
}, },
......
...@@ -1564,7 +1564,7 @@ class Login { ...@@ -1564,7 +1564,7 @@ class Login {
loginHandlerValidate(user, pwd, userPhone, isRememberPWD, ref, validateCode = '') { loginHandlerValidate(user, pwd, userPhone, isRememberPWD, ref, validateCode = '') {
const self = this; const self = this;
if(this.globalConfig?.isVerification == 1) return self.loginValidate(user, pwd, userPhone, isRememberPWD, SERVICE_APP_LOGIN_MODE.password, validateCode); if((this.globalConfig?.isVerification || 0) * 1 === 1) return self.loginValidate(user, pwd, userPhone, isRememberPWD, SERVICE_APP_LOGIN_MODE.password, validateCode);
if (user && pwd) { if (user && pwd) {
if (self.loginFailed && self.captchaObj) { if (self.loginFailed && self.captchaObj) {
self.captchaObj.verify(); self.captchaObj.verify();
......
This diff was suppressed by a .gitattributes entry.
...@@ -26,6 +26,7 @@ const renderQRCode = props => { ...@@ -26,6 +26,7 @@ const renderQRCode = props => {
}; };
const MiLeLogin = forwardRef((props, _ref) => { const MiLeLogin = forwardRef((props, _ref) => {
const isValidate = (window?.globalConfig?.isVerification || 0) * 1 === 1;
const sliVerify = useRef(); const sliVerify = useRef();
const loginFormRef = useRef(); const loginFormRef = useRef();
const formRef = useRef(null); const formRef = useRef(null);
...@@ -46,12 +47,13 @@ const MiLeLogin = forwardRef((props, _ref) => { ...@@ -46,12 +47,13 @@ const MiLeLogin = forwardRef((props, _ref) => {
/* eslint-disable */ /* eslint-disable */
action && action &&
(type === 'Account' (type === 'Account'
? action.loginHandler( ? action.loginHandlerValidate(
values.userName, values.userName,
values.password, values.password,
null, null,
autoLogin, autoLogin,
sliVerify, sliVerify,
values?.validate,
) )
: type === 'Mobile' : type === 'Mobile'
? action.phoneLoginFormHandler(values.mobile, values.captcha) ? action.phoneLoginFormHandler(values.mobile, values.captcha)
...@@ -118,7 +120,7 @@ const MiLeLogin = forwardRef((props, _ref) => { ...@@ -118,7 +120,7 @@ const MiLeLogin = forwardRef((props, _ref) => {
updateLoginMode: props.updateLoginMode, updateLoginMode: props.updateLoginMode,
welcome: null, welcome: null,
}; };
return <Account {...params} />; return <Account {...params} isValidate={isValidate} />;
}; };
const handleWeek = () => { const handleWeek = () => {
......
...@@ -28,6 +28,18 @@ ...@@ -28,6 +28,18 @@
.panda-console-base-form-item{ .panda-console-base-form-item{
margin-bottom: 30px; margin-bottom: 30px;
} }
.panda-console-base-input-affix-wrapper {
border-radius: 5px !important;
padding: 4px 11px !important;
}
.panda-console-basesrc-pages-user-login-components-login-index-validate_img {
height: 47.5px !important;
width: 102px !important;
border-radius: 5px !important;
}
.panda-console-base-form-item-control-input-content { .panda-console-base-form-item-control-input-content {
&>span { &>span {
border-radius: 5px !important; border-radius: 5px !important;
......
...@@ -5,9 +5,10 @@ import LoginForm from '../../../components/Login'; ...@@ -5,9 +5,10 @@ import LoginForm from '../../../components/Login';
import LoginMessage from '../../../js/loginMessage'; import LoginMessage from '../../../js/loginMessage';
import passwordIcon from './images/password.png'; import passwordIcon from './images/password.png';
import userIcon from './images/user.png'; import userIcon from './images/user.png';
import validateIcon from './images/validate.png';
/* 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 && (
...@@ -47,6 +48,7 @@ const useAccount = props => ( ...@@ -47,6 +48,7 @@ const useAccount = props => (
]} ]}
prefix={<img src={passwordIcon}/>} prefix={<img src={passwordIcon}/>}
/> />
{props?.isValidate ? <Validate name="validate" prefix={<img src={validateIcon}/>} /> : null}
<div> <div>
<Checkbox <Checkbox
checked={props.autoLogin} checked={props.autoLogin}
......
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