This commit is contained in:
1 parent
2fee329002
commit
64eadf1446
52 files changed
+2590
-4
No files matched your search
+3
@@ -50,6 +50,9 @@ public class SecurityConfig {
|
||||
/* 启动配置与公告:客户端登录前就要拿(POST /app/creator/apply 等仍要登录) */
|
||||
"/app/config",
|
||||
"/app/notices",
|
||||
/* 奖励中心只读配置:登录前可浏览任务与活动,签到/领取仍需登录。 */
|
||||
"/app/rewards/overview",
|
||||
"/app/rewards/activities",
|
||||
/* 服务条款与隐私协议:登录前就要能打开,按语言返回 HTML */
|
||||
"/privacy/**",
|
||||
"/terms/**",
|
||||
|
||||
+6
@@ -58,4 +58,10 @@ public final class SecurityUtils {
|
||||
}
|
||||
return loginUser.userId();
|
||||
}
|
||||
|
||||
/** 客户端匿名只读接口取当前用户,未登录或非客户端用户返回 null。 */
|
||||
public static Long getAppUserIdOrNull() {
|
||||
LoginUser loginUser = getLoginUserOrNull();
|
||||
return isAppUser(loginUser) ? loginUser.userId() : null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user