feat(auth): 超管切换账户迁至 SuperAuthController,新增多公司切换与 companyCount 并收紧 auth 白名单

This commit is contained in:
小蟑螂
2026-05-25 22:47:25 +08:00
parent d4bfa4d257
commit 2ef5b9a41a
13 changed files with 402 additions and 19 deletions
@@ -117,8 +117,19 @@ export async function getAccessCodesApi() {
/**
* 切换账户(超级管理员功能)
*/
export async function switchAccountApi(userId: number) {
return requestClient.post<AuthApi.LoginResult>(`/auth/switch/${userId}`);
export async function switchAccountApi(companyId: number, userId: number) {
return requestClient.post<AuthApi.LoginResult>(
`/super/auth/switch/company/${companyId}/user/${userId}`,
);
}
/**
* 切换公司(重新签发 token)
*/
export async function switchCompanyApi(companyId: number) {
return requestClient.post<AuthApi.LoginResult>(
`/auth/switch-company/${companyId}`,
);
}
/**