feat(medications): 优化药品管理功能和登录流程
- 更新默认药品图片为专用图标 - 移除未使用的 loading 状态选择器 - 优化 Apple 登录按钮样式,支持毛玻璃效果和加载状态 - 添加登录成功后返回功能(shouldBack 参数) - 药品详情页添加信息卡片点击交互 - 添加药品添加页面的登录状态检查 - 增强时间选择器错误处理和数据验证 - 修复药品图片显示逻辑,支持网络图片 - 优化药品卡片样式和布局 - 添加图片加载错误处理
This commit is contained in:
@@ -13,6 +13,7 @@ type RedirectParams = Record<string, string | number | boolean | undefined>;
|
||||
type EnsureOptions = {
|
||||
redirectTo?: string;
|
||||
redirectParams?: RedirectParams;
|
||||
shouldBack?: boolean; // 登录成功后是否返回上一页而不是重定向
|
||||
};
|
||||
|
||||
export function useAuthGuard() {
|
||||
@@ -28,12 +29,14 @@ export function useAuthGuard() {
|
||||
|
||||
const redirectTo = options?.redirectTo ?? currentPath ?? ROUTES.TAB_STATISTICS;
|
||||
const paramsJson = options?.redirectParams ? JSON.stringify(options.redirectParams) : undefined;
|
||||
const shouldBack = options?.shouldBack;
|
||||
|
||||
router.push({
|
||||
pathname: '/auth/login',
|
||||
params: {
|
||||
redirectTo,
|
||||
...(paramsJson ? { redirectParams: paramsJson } : {}),
|
||||
...(shouldBack ? { shouldBack: 'true' } : {}),
|
||||
},
|
||||
} as any);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user