fix(auth): 重构登录认证,并支持跳转到关联服务如图纸标注

This commit is contained in:
sophie committed 2026-07-29 13:22:31 +08:00
1 parent ce1fd59f61
commit affe139bf9
51 files changed
+1939 -132

No files matched your search

+12 -1
View File
@@ -1,12 +1,13 @@
/**
* features/admin/api/admin.api.ts
* 管理后台 HTTP API:用户、部门、Agent、权限、报表、企业微信、公告等。
* 管理后台 HTTP API:用户、部门、Agent、权限、报表、企业微信、公告、关联服务等。
*/
import { getAuthHeaders } from '@/shared/utils/auth';
import { requestJson } from '@/shared/api/client';
import type { AdminUserRow } from '../types/admin.types';
import type { AdminDashboardBadges, AdminDashboardSummary } from '../types/dashboard.types';
import type { PaginatedResult } from '@/shared/types/pagination.types';
import type { AdminLinkedServiceRow } from '../types/linked-service.types';
import type {
ApplicationReport,
ApplicationSortKey,
@@ -394,6 +395,16 @@ export const updateAnnouncement = (id: number, payload: Record<string, unknown>)
export const deleteAnnouncement = (id: number) =>
requestJson(`/api/admin/announcements/${id}`, { method: 'DELETE', ...auth() });
// Linked services(关联服务:侧栏跳转入口)
export const listLinkedServices = () =>
requestJson<AdminLinkedServiceRow[]>('/api/admin/linked-services', auth());
export const createLinkedService = (payload: Record<string, unknown>) =>
requestJson('/api/admin/linked-services', { method: 'POST', ...jsonAuth(), body: JSON.stringify(payload) });
export const updateLinkedService = (id: number, payload: Record<string, unknown>) =>
requestJson(`/api/admin/linked-services/${id}`, { method: 'PUT', ...jsonAuth(), body: JSON.stringify(payload) });
export const deleteLinkedService = (id: number) =>
requestJson(`/api/admin/linked-services/${id}`, { method: 'DELETE', ...auth() });
// Quick questions
export const listAdminQuickQuestions = () => requestJson<any[]>('/api/admin/quick-questions', auth());
export const saveAdminQuickQuestion = (url: string, method: string, payload: Record<string, unknown>) =>