添加退出登录功能

This commit is contained in:
whyour
2021-03-23 14:32:17 +08:00
parent d41eb582e4
commit 51b0418fa9
5 changed files with 21 additions and 6 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ const FormItem = Form.Item;
const Login = () => {
const handleOk = (values: any) => {
request
.post(`${config.apiPrefix}auth`, {
.post(`${config.apiPrefix}login`, {
data: {
username: values.username,
password: values.password,
+3 -3
View File
@@ -9,6 +9,7 @@ import {
auto as followSystemColorScheme,
setFetchMethod,
} from 'darkreader';
import { history } from 'umi';
const optionsWithDisabled = [
{ label: '亮色', value: 'light' },
@@ -34,9 +35,8 @@ const Password = () => {
},
})
.then((data: any) => {
notification.success({
message: data.msg,
});
localStorage.removeItem(config.authKey);
history.push('/login');
})
.catch((error: any) => {
console.log(error);