This commit is contained in:
2025-09-05 21:39:28 +08:00
parent 089c9f8494
commit 913c2ba036
4 changed files with 99 additions and 280 deletions
+31
View File
@@ -85,6 +85,37 @@ export const NO_AUTH_APIS = [
'/common/upload-config' // 上传配置
]
/**
* 需要鉴权的接口列表(明确需要登录的接口)
* 这些接口在调用时如果未登录会自动跳转到登录页面
*/
export const AUTH_REQUIRED_APIS = [
// 用户个人信息相关
'/profile/info', // 获取用户信息
'/profile/update', // 更新用户信息
'/profile/avatar', // 更新头像
'/profile/stats', // 用户统计信息
// 宠物管理相关
'/pets/create', // 创建宠物
'/pets/update', // 更新宠物信息
'/pets/delete', // 删除宠物
'/pets/my', // 我的宠物列表
// 领养相关
'/adoption/apply', // 申请领养
'/adoption/my-applications', // 我的申请
'/adoption/my-pets', // 我发布的宠物
// 收藏和关注
'/favorites/*', // 收藏相关
'/follows/*', // 关注相关
// 消息和通知
'/messages/*', // 消息相关
'/notifications/*' // 通知相关
]
/**
* 检查接口是否需要鉴权
* @param {String} url 接口URL