Просмотр исходного кода

✨ feat(auth): 为公开商品路由添加认证中间件并更新登录页面

- 在公开商品路由文件中导入并添加 authMiddleware 中间件
- 将登录页面标题从“管理后台登录”更新为“长愿青”
- 注释掉登录页面的测试账号信息以提高安全性
yourname 1 месяц назад
Родитель
Сommit
72a6744039

+ 1 - 0
packages/goods-module-mt/src/routes/public-goods-routes.mt.ts

@@ -5,6 +5,7 @@ import { PublicGoodsSchema, PublicGoodsQueryDto } from '../schemas/public-goods.
 import { FileMt } from '@d8d/file-module-mt';
 import { GoodsServiceMt } from '../services/goods.service.mt';
 import { AppDataSource } from '@d8d/shared-utils';
+import { authMiddleware } from '@d8d/auth-module-mt';
 
 // 创建公开商品路由 - 只读查询,无需认证
 // 默认只返回可用状态的商品

+ 3 - 3
web/src/client/admin/pages/Login.tsx

@@ -57,7 +57,7 @@ export const LoginPage = () => {
             <User className="h-8 w-8 text-white" />
           </div>
           <h2 className="mt-6 text-center text-3xl font-bold tracking-tight text-gray-900">
-            管理后台登录
+            长愿青
           </h2>
           <p className="mt-2 text-center text-sm text-gray-600">
             请输入您的账号和密码继续操作
@@ -142,9 +142,9 @@ export const LoginPage = () => {
             </Form>
           </CardContent>
           <CardFooter className="flex flex-col items-center space-y-2">
-            <div className="text-sm text-gray-500">
+            {/* <div className="text-sm text-gray-500">
               测试账号: <span className="font-medium text-gray-700">admin</span> / <span className="font-medium text-gray-700">admin123</span>
-            </div>
+            </div> */}
             <div className="text-xs text-gray-400">
               © {new Date().getFullYear()} 管理系统. 保留所有权利.
             </div>