完善用户菜单权限,显示营收数据
This commit is contained in:
@@ -313,9 +313,22 @@ export const getVerificationCodePhone = (
|
||||
export const getUserOwnedMenus = (
|
||||
data: InputUserOwnedMenus
|
||||
): Promise<UserOwnedMenusResponse> => {
|
||||
// 从 localStorage 获取 accessToken
|
||||
const accessToken = typeof window !== 'undefined'
|
||||
? localStorage.getItem('accessToken')
|
||||
: null;
|
||||
|
||||
const headers: Record<string, string> = {};
|
||||
if (accessToken) {
|
||||
headers.Authorization = `Bearer ${accessToken}`;
|
||||
}
|
||||
|
||||
return request.post<UserOwnedMenusResponse>(
|
||||
`/api/auth/user/owned/menus`,
|
||||
data
|
||||
data,
|
||||
{
|
||||
headers,
|
||||
}
|
||||
).then(res => res.data);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user