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

@@ -5,6 +5,7 @@ import { register } from '@/api/login';
import { regExpPasswd, regExpUserName } from '@/utils/regular-utils';
import { useRouter } from 'vue-router';
import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
const { t } = useI18n();
const router = useRouter();
@@ -44,7 +45,7 @@ function fnFinish() {
const hide = message.loading(t('common.loading'), 0);
register(toRaw(state.form))
.then(res => {
if (res.code === 1) {
if (res.code === RESULT_CODE_SUCCESS) {
Modal.success({
title: t('common.tipTitle'),
content: t('views.register.tipContent', {