feat: 全局获取userinfo、数据持久化、store处理
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<Container title="个人信息" class="container mt-24px">
|
||||
<a-table :columns="columns" :data="data" :pagination="false" class="mt-16px">
|
||||
<a-table :columns="columns" :data="dataSource" :pagination="false" class="mt-16px">
|
||||
<template #info="{ record }">
|
||||
<div class="pt-3px pb-3px">
|
||||
<a-avatar :image-url="record.head_image" :size="32" />
|
||||
@ -85,7 +85,7 @@ import axios from 'axios';
|
||||
import { useUserStore } from '@/stores';
|
||||
|
||||
const store = useUserStore();
|
||||
const userInfo = store.getUserInfo();
|
||||
const userInfo = store.userInfo;
|
||||
|
||||
const columns = [
|
||||
{
|
||||
@ -97,7 +97,7 @@ const columns = [
|
||||
slotName: 'mobile',
|
||||
},
|
||||
];
|
||||
const data = reactive([userInfo]);
|
||||
|
||||
const infoVisible = ref(false);
|
||||
const imageVisible = ref(false);
|
||||
const mobileVisible = ref(false);
|
||||
@ -108,6 +108,10 @@ const formRef = ref();
|
||||
const isSendCaptcha = ref(false);
|
||||
const uploadInputRef = ref();
|
||||
|
||||
const dataSource = computed(() => {
|
||||
return userInfo ? [userInfo] : [];
|
||||
});
|
||||
|
||||
// 表单校验规则
|
||||
const formRules = {
|
||||
mobile: [
|
||||
|
||||
Reference in New Issue
Block a user