Commit c4e973a5 authored by 皮倩雯's avatar 皮倩雯

fix: '运维登录密码加密'

parent 563e8a01
Pipeline #81825 passed with stages
......@@ -6,8 +6,10 @@ import { AUTHORITY, USER_MODE } from '@/utils/constants';
import { appConnector } from '@/containers/App/store';
import { useHistory } from 'react-router-dom';
import sha1 from 'sha1';
import { encipher } from '@wisdom-utils/utils/lib/helpers';
import LoginForm from './components/Login';
import styles from './style.less';
import { SysConfiguration } from '@/services/userManage/api';
import { setAuthority } from '@/utils/authority';
const { UserName, Password, Submit } = LoginForm;
......@@ -29,12 +31,25 @@ const Login = props => {
const [loading, setLoading] = useState(false);
// const [autoLogin, setAutoLogin] = useState(true);
const [type, setType] = useState('account');
const [pasType, setPasType] = useState('');
useEffect(() => {
passwordType();
}, []);
const passwordType = () => {
SysConfiguration().then(res => {
if (res.code === 0) {
setPasType(res.data);
}
});
};
const handleSubmit = values => {
/* eslint-disable no-console */
console.log(values); // eg:{userName: "123", password: "123"}
const { userName: loginName, password } = values;
setLoading(true);
OMSLogin(loginName, sha1(password).toUpperCase(), 'CivManage')
OMSLogin(loginName, encipher(password, pasType ? pasType : '').toUpperCase(), 'CivManage')
.then(result => {
const { msg } = result;
......
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