mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-10-01 08:12:06 +00:00
feat: 新增用户头像字段并优化表单布局
refactor(前端): 统一表单搜索组件样式和布局 style: 优化表格和卡片样式,调整高度和间距 fix(上传): 修复文件上传组件name属性缺失问题 perf(IP定位): 优化IP定位逻辑,增加内网IP判断和重试机制 docs: 更新密码修改成功后的提示信息 chore: 清理无用代码和注释 ``` 这个提交消息包含了多个方面的改进: 1. 新增功能(feat):为用户表添加了avatar字段 2. 重构(refactor):统一了前端表单搜索组件的样式和布局 3. 样式优化(style):调整了表格和卡片的样式 4. 问题修复(fix):修复了文件上传组件name属性缺失的问题 5. 性能优化(perf):改进了IP定位服务的逻辑 6. 文档更新(docs):修改了密码修改成功后的提示信息 7. 杂项(chore):清理了无用的代码和注释 消息遵循了提交规范,每个部分都简明扼要地描述了变更内容。
This commit is contained in:
+22
-34
@@ -3,8 +3,8 @@ import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
|
||||
|
||||
import { getCurrentUserInfo } from "@/api/system/user";
|
||||
import { getInitConfig } from "@/api/system/config";
|
||||
import { getNoticeList } from '@/api/system/notice'
|
||||
import { getDictDataByType } from '@/api/system/dict'
|
||||
import { getNoticeListAvailable } from '@/api/system/notice'
|
||||
import { getInitDict } from '@/api/system/dict'
|
||||
|
||||
// pinia-plugin-persistedstate 持久化存储官方文档:https://prazdevs.github.io/pinia-plugin-persistedstate/zh/guide/
|
||||
const store = createPinia()
|
||||
@@ -20,16 +20,12 @@ export const useNoticeStore = defineStore("notice", {
|
||||
}),
|
||||
actions: {
|
||||
async getNotice() {
|
||||
try {
|
||||
const response = await getNoticeList({ available: true });
|
||||
const { status_code, data } = response.data;
|
||||
if (status_code === 200) {
|
||||
this.noticeList = data.items;
|
||||
this.total = data.total;
|
||||
this.isNoticeLoaded = true;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("获取通知失败", error);
|
||||
const response = await getNoticeListAvailable();
|
||||
const { status_code, data } = response.data;
|
||||
if (status_code === 200) {
|
||||
this.noticeList = data.items;
|
||||
this.total = data.total;
|
||||
this.isNoticeLoaded = true;
|
||||
}
|
||||
},
|
||||
clearUserInfo() {
|
||||
@@ -49,16 +45,12 @@ export const useUserStore = defineStore("user", {
|
||||
}),
|
||||
actions: {
|
||||
async getUserInfo() {
|
||||
try {
|
||||
const response = await getCurrentUserInfo();
|
||||
const result = response.data;
|
||||
const routers = result.data.menus;
|
||||
delete result.data.menus;
|
||||
this.setRoute(routers);
|
||||
this.basicInfo = { ...this.basicInfo, ...result.data };
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
const response = await getCurrentUserInfo();
|
||||
const result = response.data;
|
||||
const routers = result.data.menus;
|
||||
delete result.data.menus;
|
||||
this.setRoute(routers);
|
||||
this.basicInfo = { ...this.basicInfo, ...result.data };
|
||||
},
|
||||
setRoute(routers) {
|
||||
this.routeList = routers;
|
||||
@@ -83,15 +75,11 @@ export const useConfigStore = defineStore("config", {
|
||||
}),
|
||||
actions: {
|
||||
async getConfig() {
|
||||
try {
|
||||
const response = await getInitConfig();
|
||||
const { status_code, data } = response.data;
|
||||
if (status_code === 200) {
|
||||
this.configData = data;
|
||||
this.isConfigLoaded = true;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("获取系统配置失败", error);
|
||||
const response = await getInitConfig();
|
||||
const { status_code, data } = response.data;
|
||||
if (status_code === 200) {
|
||||
this.configData = data;
|
||||
this.isConfigLoaded = true;
|
||||
}
|
||||
},
|
||||
getConfigValue(key) {
|
||||
@@ -113,13 +101,13 @@ export const useDictStore = defineStore('dict', {
|
||||
},
|
||||
actions: {
|
||||
// 批量获取字典数据
|
||||
async setDict(types) {
|
||||
async getDict(types) {
|
||||
try {
|
||||
for (const type of types) {
|
||||
const response = await getDictDataByType(type)
|
||||
const response = await getInitDict(type)
|
||||
const result = response.data;
|
||||
|
||||
if (result.status_code === 200) {
|
||||
console.log("参数:",type, "根据字典类型获取字典数据:",result.data);
|
||||
// 格式化数据
|
||||
this.dictObj[type] = result.data;
|
||||
this.isLoaded = true;
|
||||
|
||||
Reference in New Issue
Block a user