修复用户名密码修改,diff视图滚动

This commit is contained in:
whyour
2021-03-21 11:57:00 +08:00
parent f03323e5d8
commit ecb5bb1718
6 changed files with 33 additions and 20 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ const Login = () => {
},
})
.then((data) => {
if (data.err == 0) {
if (data.code == 200) {
localStorage.setItem(config.authKey, data.token);
history.push('/cookie');
} else {
+6 -10
View File
@@ -29,22 +29,18 @@ const Password = () => {
const handleOk = (values: any) => {
request
.post(`${config.apiPrefix}auth?t=${Date.now()}`, {
.post(`${config.apiPrefix}user?t=${Date.now()}`, {
data: {
username: values.username,
password: values.password,
},
})
.then((data) => {
if (data.err == 0) {
localStorage.setItem(config.authKey, 'true');
} else {
notification.open({
message: data.msg,
});
}
.then((data: any) => {
notification.success({
message: data.msg,
});
})
.catch(function (error) {
.catch((error: any) => {
console.log(error);
});
};