|
@@ -4,6 +4,7 @@ import { Form, Input, Button, message } from 'antd'
|
|
|
import { UserOutlined, LockOutlined } from '@ant-design/icons'
|
|
|
import { useNavigate } from 'react-router-dom'
|
|
|
import { loginUser } from '../services'
|
|
|
+import Base64 from 'base-64'
|
|
|
|
|
|
const LoginWrapper = styled.div`
|
|
|
width:100%;
|
|
@@ -92,7 +93,10 @@ const LoginView = () => {
|
|
|
.validateFields()
|
|
|
.then(async () => {
|
|
|
const { account, password } = loginForm.getFieldValue()
|
|
|
- const { data } = await loginUser({ username: account, password })
|
|
|
+ const { data } = await loginUser({
|
|
|
+ username: account,
|
|
|
+ password: Base64.encode(password),
|
|
|
+ })
|
|
|
if (data.code === 200) {
|
|
|
sessionStorage.setItem('user_token', data.data.auth_token)
|
|
|
sessionStorage.setItem('user_id', data.data.id)
|