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}`,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user