diff --git a/.gitignore b/.gitignore index ce54dc5..e56dd92 100644 --- a/.gitignore +++ b/.gitignore @@ -13,5 +13,6 @@ os_del.cmd os_del_doc.cmd .svn derby.log -.idea -dist \ No newline at end of file +.idea/* +dist +dist.* \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml index 0946b03..7c77d59 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -8,6 +8,7 @@ + diff --git a/.idea/misc.xml b/.idea/misc.xml index 71ec035..00c8863 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -8,7 +8,7 @@ - + \ No newline at end of file diff --git a/README-Applet-Filter.md b/README-Applet-Filter.md deleted file mode 100644 index 9669dd6..0000000 --- a/README-Applet-Filter.md +++ /dev/null @@ -1,144 +0,0 @@ -# 小程序登录拦截器分离配置说明 - -## 配置目标 -将系统的登录拦截器分成后台管理系统和小程序两个独立的拦截器,实现不同的认证策略。 - -## 实现方案 - -### 1. 创建小程序专用拦截器 - -#### 1.1 新增文件 -- `jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/filters/AppletJwtFilter.java` - -#### 1.2 核心特性 -```java -@Override -protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) { - try { - HttpServletRequest httpRequest = (HttpServletRequest) request; - String requestPath = httpRequest.getServletPath(); - - // 只处理以/applet开头的请求 - if (!requestPath.startsWith("/applet")) { - return true; // 不是applet请求,直接放行 - } - - // 判断当前路径是不是注解了@IngoreAuth路径,如果是,则放开验证 - if (InMemoryIgnoreAuth.contains(requestPath)) { - return true; - } - - executeLogin(request, response); - return true; - } catch (Exception e) { - JwtUtil.responseError(response,401,CommonConstant.TOKEN_IS_INVALID_MSG); - return false; - } -} -``` - -### 2. 修改Shiro配置 - -#### 2.1 修改文件 -- `jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java` - -#### 2.2 配置变更 -```java -// 添加自己的过滤器并且取名为jwt和applet -Map filterMap = new HashMap(2); -//如果cloudServer为空 则说明是单体 需要加载跨域配置【微服务跨域切换】 -Object cloudServer = env.getProperty(CommonConstant.CLOUD_SERVER_KEY); -filterMap.put("jwt", new JwtFilter(cloudServer==null)); -filterMap.put("applet", new AppletJwtFilter(cloudServer==null)); -shiroFilterFactoryBean.setFilters(filterMap); - -//
@@ -194,8 +195,8 @@ //账号登录表单字段 const formData = reactive({ inputCode: '', - username: 'admin', - password: '123456', + username: '',//admin + password: '',//123456 }); //手机登录表单字段 const phoneFormData = reactive({