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