一、超管端设计优化 - 文档管理SOP体系建立,docs目录重组 - 统一用户管理:跨租户全局视角,合并用户管理+公众用户 - 活动监管全模块重构:全部活动(统计卡片+阶段筛选+SuperDetail详情页)、报名数据/作品数据/评审进度(两层合一扁平列表)、成果发布(去Tab+统计+隐藏写操作) - 菜单精简:移除评委管理/评审规则/通知管理 - Bug修复:租户编辑丢失隐藏菜单、pageSize限制、主色统一 二、UGC绘本创作社区P0 - 数据库:10张新表(user_works/user_work_pages/work_tags等) - 子女账号独立化:Child升级为独立User,家长切换+独立登录 - 用户作品库:CRUD+发布审核,8个API - AI创作流程:提交→生成→保存到作品库,4个API - 作品广场:首页改造为推荐流,标签+搜索+排序 - 内容审核(超管端):作品审核+作品管理+标签管理 - 活动联动:WorkSelector作品选择器 - 布局改造:底部5Tab(发现/创作/活动/作品库/我的) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
79 lines
2.0 KiB
TypeScript
79 lines
2.0 KiB
TypeScript
import request from "@/utils/request";
|
|
import type { PaginationParams, PaginationResponse } from "@/types/api";
|
|
|
|
export interface Permission {
|
|
id: number;
|
|
name: string;
|
|
code: string;
|
|
resource: string;
|
|
action: string;
|
|
description?: string;
|
|
validState?: number;
|
|
creator?: number;
|
|
modifier?: number;
|
|
createTime?: string;
|
|
modifyTime?: string;
|
|
}
|
|
|
|
export interface CreatePermissionForm {
|
|
name: string;
|
|
code: string;
|
|
resource: string;
|
|
action: string;
|
|
description?: string;
|
|
}
|
|
|
|
export interface UpdatePermissionForm {
|
|
name?: string;
|
|
code?: string;
|
|
resource?: string;
|
|
action?: string;
|
|
description?: string;
|
|
}
|
|
|
|
// 获取权限列表
|
|
export async function getPermissionsList(
|
|
params: PaginationParams
|
|
): Promise<PaginationResponse<Permission>> {
|
|
const response = await request.get<any, PaginationResponse<Permission>>("/permissions", {
|
|
params,
|
|
});
|
|
return response;
|
|
}
|
|
|
|
// 获取单个权限详情
|
|
export async function getPermissionDetail(id: number): Promise<Permission> {
|
|
const response = await request.get<any, Permission>(`/permissions/${id}`);
|
|
return response;
|
|
}
|
|
|
|
// 创建权限
|
|
export async function createPermission(data: CreatePermissionForm): Promise<Permission> {
|
|
const response = await request.post<any, Permission>("/permissions", data);
|
|
return response;
|
|
}
|
|
|
|
// 更新权限
|
|
export async function updatePermission(
|
|
id: number,
|
|
data: UpdatePermissionForm
|
|
): Promise<Permission> {
|
|
const response = await request.patch<any, Permission>(`/permissions/${id}`, data);
|
|
return response;
|
|
}
|
|
|
|
// 删除权限
|
|
export async function deletePermission(id: number): Promise<void> {
|
|
return await request.delete<any, void>(`/permissions/${id}`);
|
|
}
|
|
|
|
// 兼容性导出:保留 permissionsApi 对象
|
|
export const permissionsApi = {
|
|
getList: getPermissionsList,
|
|
getDetail: getPermissionDetail,
|
|
create: createPermission,
|
|
update: updatePermission,
|
|
delete: deletePermission,
|
|
};
|
|
|