generated from youfool-project/youfool-prj-springboot-template
调整权限
This commit is contained in:
parent
3ead8762a3
commit
b5b53df7d9
|
|
@ -16,8 +16,8 @@ public class YoufoolApplication extends SpringBootServletInitializer {
|
||||||
|
|
||||||
SpringApplication.run(YoufoolApplication.class, args);
|
SpringApplication.run(YoufoolApplication.class, args);
|
||||||
log.info("========================== 程序启动成功! ==========================");
|
log.info("========================== 程序启动成功! ==========================");
|
||||||
log.info("====== 程 序:youfool-prj-springboot-template!");
|
log.info("====== 程 序:youfool-course!");
|
||||||
log.info("====== 描 述:boot基础的后台模板!");
|
log.info("====== 描 述:培训课程程序!");
|
||||||
log.info("====== CMS 基础框架后台管理系统路径:/cms,账号:admin、密码:123456");
|
log.info("====== CMS 基础框架后台管理系统路径:/cms,账号:admin、密码:123456");
|
||||||
log.info("====== 接口文档路径:/doc.html,账号:admin、密码:123456。注:如果乱码请指定VM -Dfile.encoding=UTF-8");
|
log.info("====== 接口文档路径:/doc.html,账号:admin、密码:123456。注:如果乱码请指定VM -Dfile.encoding=UTF-8");
|
||||||
log.info("====== Druid Monitor路径:/druid,账号:admin、密码:123456");
|
log.info("====== Druid Monitor路径:/druid,账号:admin、密码:123456");
|
||||||
|
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
package com.chinaweal.youfool.course.config;
|
|
||||||
|
|
||||||
import cn.dev33.satoken.interceptor.SaInterceptor;
|
|
||||||
import cn.dev33.satoken.router.SaRouter;
|
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sa-Token配置
|
|
||||||
*
|
|
||||||
* @author lroyia
|
|
||||||
* @since 2025/10/24
|
|
||||||
**/
|
|
||||||
@Configuration
|
|
||||||
public class SaTokenConfig implements WebMvcConfigurer {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addInterceptors(InterceptorRegistry registry) {
|
|
||||||
// 注册Sa-Token拦截器
|
|
||||||
registry.addInterceptor(new SaInterceptor())
|
|
||||||
.addPathPatterns("/**")
|
|
||||||
.excludePathPatterns(
|
|
||||||
"/login",
|
|
||||||
"/error",
|
|
||||||
"/webjars/**",
|
|
||||||
"/css/**",
|
|
||||||
"/js/**",
|
|
||||||
"/user/auth/**",
|
|
||||||
"/oauth2/**"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -37,7 +37,7 @@ public class SpringMvcConfig implements WebMvcConfigurer {
|
||||||
// SaRouter.match("/notice/**", r -> StpUtil.checkPermission("notice"));
|
// SaRouter.match("/notice/**", r -> StpUtil.checkPermission("notice"));
|
||||||
// SaRouter.match("/comment/**", r -> StpUtil.checkPermission("comment"));
|
// SaRouter.match("/comment/**", r -> StpUtil.checkPermission("comment"));
|
||||||
// 指定一条 match 规则
|
// 指定一条 match 规则
|
||||||
SaRouter.notMatch("/user/auth/**", "/test/**", "/doc.html**", "/cross/**", "/swagger*",
|
SaRouter.notMatch("/login**","/oauth2**","/user/auth/**", "/test/**", "/doc.html**", "/cross/**", "/swagger*",
|
||||||
"/cms/index.html", "/cms/static/**", "/cms/favicon.ico", "/cms/user/login", "/network/ping", "/error", "/static/data/**")
|
"/cms/index.html", "/cms/static/**", "/cms/favicon.ico", "/cms/user/login", "/network/ping", "/error", "/static/data/**")
|
||||||
.match("/**", r -> StpUtil.checkLogin());
|
.match("/**", r -> StpUtil.checkLogin());
|
||||||
})).addPathPatterns("/**");
|
})).addPathPatterns("/**");
|
||||||
|
|
|
||||||
|
|
@ -14,14 +14,6 @@ spring:
|
||||||
suffix: .html
|
suffix: .html
|
||||||
encoding: UTF-8
|
encoding: UTF-8
|
||||||
mode: HTML
|
mode: HTML
|
||||||
# Gitea OAuth2配置
|
|
||||||
gitea:
|
|
||||||
client-id: ${GITEA_CLIENT_ID:your-gitea-client-id}
|
|
||||||
client-secret: ${GITEA_CLIENT_SECRET:your-gitea-client-secret}
|
|
||||||
auth-url: ${GITEA_AUTH_URL:https://gitea.com/login/oauth/authorize}
|
|
||||||
token-url: ${GITEA_TOKEN_URL:https://gitea.com/login/oauth/access_token}
|
|
||||||
user-url: ${GITEA_USER_URL:https://gitea.com/api/v1/user}
|
|
||||||
redirect-uri: ${BASE_URL:http://localhost:8080}/course/oauth2/gitea/callback
|
|
||||||
datasource:
|
datasource:
|
||||||
dynamic:
|
dynamic:
|
||||||
primary: master #设置默认的数据源或者数据源组,默认值即为master
|
primary: master #设置默认的数据源或者数据源组,默认值即为master
|
||||||
|
|
@ -92,7 +84,7 @@ sa-token:
|
||||||
# token有效期,单位s 默认30天, -1代表永不过期
|
# token有效期,单位s 默认30天, -1代表永不过期
|
||||||
timeout: 2592000
|
timeout: 2592000
|
||||||
# token临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
|
# token临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
|
||||||
activity-timeout: -1
|
active-timeout: -1
|
||||||
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
|
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
|
||||||
is-concurrent: true
|
is-concurrent: true
|
||||||
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
|
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
|
||||||
|
|
@ -101,3 +93,11 @@ sa-token:
|
||||||
token-style: uuid
|
token-style: uuid
|
||||||
# 是否输出操作日志
|
# 是否输出操作日志
|
||||||
is-log: false
|
is-log: false
|
||||||
|
# Gitea OAuth2配置
|
||||||
|
gitea:
|
||||||
|
client-id: ${GITEA_CLIENT_ID:your-gitea-client-id}
|
||||||
|
client-secret: ${GITEA_CLIENT_SECRET:your-gitea-client-secret}
|
||||||
|
auth-url: ${GITEA_AUTH_URL:https://gitea.com/login/oauth/authorize}
|
||||||
|
token-url: ${GITEA_TOKEN_URL:https://gitea.com/login/oauth/access_token}
|
||||||
|
user-url: ${GITEA_USER_URL:https://gitea.com/api/v1/user}
|
||||||
|
redirect-uri: ${BASE_URL:http://localhost:8080}/course/oauth2/gitea/callback
|
||||||
Loading…
Reference in New Issue