完善用户菜单权限,显示营收数据

This commit is contained in:
xianyi
2025-12-17 09:58:37 +08:00
parent c376f9344b
commit 1c15d4b892
2 changed files with 59 additions and 12 deletions

View File

@@ -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);
};