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 { getUserProfile } from '@/api/profile';
import { reactive, ref, onMounted } from 'vue';
import { parseDateToStr } from '@/utils/date-utils';
import useUserStore from '@/store/modules/user';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
/**加载状态 */
let loading = ref<boolean>(true);
@@ -54,7 +55,7 @@ let listData = ref([
/**查询用户个人信息 */
function fnGetProfile() {
getUserProfile().then(res => {
if (res.code === 1 && res.data) {
if (res.code === RESULT_CODE_SUCCESS && res.data) {
const { user, roleGroup, postGroup } = res.data;
state.user = user;
state.roleGroup = roleGroup;