mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 10:29:19 +08:00
feat(auth): 超管切换账户迁至 SuperAuthController,新增多公司切换与 companyCount 并收紧 auth 白名单
This commit is contained in:
@@ -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}`,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,6 +14,13 @@ export async function getUserInfoApi() {
|
||||
return requestClient.get<UserVO.UserInfoVO>('/user/info');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户可切换的可用公司列表
|
||||
*/
|
||||
export async function getAvailableCompaniesApi() {
|
||||
return requestClient.get<Array<{ id: number; name: string }>>('/user/companies');
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新用户信息
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,8 @@ export namespace UserVO {
|
||||
id: number;
|
||||
name: string;
|
||||
};
|
||||
/** 可切换的可用公司数量 */
|
||||
companyCount?: number;
|
||||
/** 部门id */
|
||||
departmentId?: number;
|
||||
/** 岗位id */
|
||||
|
||||
Reference in New Issue
Block a user