From c3f33f6a94eef769228b6b6df7f0799ebb791245 Mon Sep 17 00:00:00 2001 From: oyo Date: Mon, 1 Sep 2025 20:03:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20template/TOCO.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/TOCO.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/template/TOCO.md b/template/TOCO.md index df41e74..a4c1a98 100644 --- a/template/TOCO.md +++ b/template/TOCO.md @@ -17,10 +17,11 @@ - 如果需求中存在用户登录认证功能,且用户未指定实现方式,则默认使用JWT。如果项目中已有相关功能,则不要重复实现。 - 用户的Token生成和解密相关的Utils放在项目代码的common/中。 - 在项目代码的common/中增加UserContext,用户的相关信息。 - - 后续所有用户登录校验、鉴权相关的代码可以放在用户模块entrance中的Filter中,从cookie中获取用户的token然后获取用户信息放入UserContext中。 + - 后续所有用户登录校验、鉴权相关的代码可以放在用户模块entrance中的Filter中,从RequestHeader: 'Authorization': `Bearer ${token}`中获取用户的token然后获取用户信息放入UserContext中。 - 登录校验需要对健康检查接口增加白名单:/api/healthcheck,登录接口。其中/api/healthcheck已经内置在系统框架中,无需新建。 - 注意用户的密码必须进行加密存储。 - 注意JWT密钥长度至少要为256位。 - - 用户登录接口需要返回用户的Token字符串,同时向Response写如如下Header: 'Authorization': `Bearer ${token}`。 + - 用户登录接口需要返回用户的Token字符串即可。 - 接口相关 - - 使用Filter完成跨域配置 \ No newline at end of file + - 使用Filter完成跨域配置 + - Aspect需要放在entrance层,便于调用Service \ No newline at end of file