fix: 状态码使用常量避免后续变更

This commit is contained in:
TsMask
2023-09-14 15:19:37 +08:00
parent 9a88d9b8de
commit 03e1b4b8bd
18 changed files with 120 additions and 78 deletions

View File

@@ -7,6 +7,7 @@ import { getCaptchaImage } from '@/api/login';
import { useRouter, useRoute } from 'vue-router';
import useI18n from '@/hooks/useI18n';
import { toRaw } from 'vue';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
const { t, changeLocale } = useI18n();
const router = useRouter();
const route = useRoute();
@@ -54,7 +55,7 @@ function fnFinish() {
useUserStore()
.fnLogin(toRaw(state.from))
.then(res => {
if (res.code === 1) {
if (res.code === RESULT_CODE_SUCCESS) {
message.success(t('views.login.loginSuccess'), 3);
router.push({ path: redirectPath });
} else {