feat: update
This commit is contained in:
@@ -41,6 +41,10 @@ const handleLogin = async () => {
|
|||||||
try {
|
try {
|
||||||
const resp = await authService.login(username.value, password.value);
|
const resp = await authService.login(username.value, password.value);
|
||||||
const { token } = resp.data;
|
const { token } = resp.data;
|
||||||
|
if (!token) {
|
||||||
|
alert('登录失败');
|
||||||
|
return;
|
||||||
|
}
|
||||||
authStore.setToken(token);
|
authStore.setToken(token);
|
||||||
router.push('/');
|
router.push('/');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user