fanxp 1 éve
szülő
commit
55e59b05e1

+ 7 - 7
pom.xml

@@ -24,7 +24,7 @@
         <commons.codec.version>1.10</commons.codec.version>
         <commons.configuration.version>1.10</commons.configuration.version>
         <hutool.version>5.7.20</hutool.version>
-        <satoken.version>1.35.0.RC</satoken.version>
+        <satoken.version>1.29.0</satoken.version>
         <lombok.version>1.18.4</lombok.version>
         <fastjson.version>1.2.83</fastjson.version>
         <joda.time.version>2.9.9</joda.time.version>
@@ -142,11 +142,11 @@
         </dependency>
 
         <!-- Sa-Token 整合 Redis (使用jdk默认序列化方式) -->
-<!--        <dependency>-->
-<!--            <groupId>cn.dev33</groupId>-->
-<!--            <artifactId>sa-token-redis</artifactId>-->
-<!--            <version>${satoken.version}</version>-->
-<!--        </dependency>-->
+        <dependency>
+            <groupId>cn.dev33</groupId>
+            <artifactId>sa-token-dao-redis</artifactId>
+            <version>${satoken.version}</version>
+        </dependency>
 
         <dependency>
             <groupId>cn.dev33</groupId>
@@ -559,4 +559,4 @@
         </plugins>
     </build>
 
-</project>
+</project>

+ 562 - 0
pom.xml.back.xml

@@ -0,0 +1,562 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.7.5</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+    <groupId>com.xjrsoft</groupId>
+    <artifactId>xjrsoft-boot</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <name>xjrsoft-boot</name>
+    <description>xjrsoft-boot</description>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <java.version>11</java.version>
+        <commons.lang.version>2.6</commons.lang.version>
+        <commons.fileupload.version>1.2.2</commons.fileupload.version>
+        <commons.io.version>2.5</commons.io.version>
+        <commons.codec.version>1.10</commons.codec.version>
+        <commons.configuration.version>1.10</commons.configuration.version>
+        <hutool.version>5.7.20</hutool.version>
+        <satoken.version>1.35.0.RC</satoken.version>
+        <lombok.version>1.18.4</lombok.version>
+        <fastjson.version>1.2.83</fastjson.version>
+        <joda.time.version>2.9.9</joda.time.version>
+        <gson.version>2.8.5</gson.version>
+        <mybatisplus.join.version>1.4.2.2</mybatisplus.join.version>
+        <mybatisplus.version>3.5.1</mybatisplus.version>
+        <mybatisplus.generator.version>3.5.2</mybatisplus.generator.version>
+        <mybatisplus.dynamic.version>3.5.1</mybatisplus.dynamic.version>
+        <druid.version>1.1.22</druid.version>
+        <knife4j.version>2.0.7</knife4j.version>
+        <freemarker.version>2.3.30</freemarker.version>
+        <hibernatevalidator.version>6.0.13.Final</hibernatevalidator.version>
+        <qiniu.version>7.2.23</qiniu.version>
+        <aliyun.oss.version>2.8.3</aliyun.oss.version>
+        <qcloud.cos.version>4.4</qcloud.cos.version>
+        <huawei.obs.version>3.19.7</huawei.obs.version>
+        <minio.oss.version>7.1.0</minio.oss.version>
+        <jaxb.api.version>2.3.0</jaxb.api.version>
+        <log4j.core.version>2.17.2</log4j.core.version>
+        <screw.version>1.0.5</screw.version>
+        <ureport.version>2.2.9</ureport.version>
+        <camunda.version>7.18.0</camunda.version>
+        <groovy.version>3.0.17</groovy.version>
+        <javax.mail.version>1.6.2</javax.mail.version>
+        <magic.api.version>2.1.1</magic.api.version>
+        <keycloak.version>20.0.1</keycloak.version>
+        <aliyun.core.version>4.5.1</aliyun.core.version>
+        <tencentcloud.version>3.1.62</tencentcloud.version>
+        <chatgpt.java.version>1.0.6</chatgpt.java.version>
+        <okio.version>3.3.0</okio.version>
+        <easyexcel.version>3.1.4</easyexcel.version>
+        <poi.version>3.17</poi.version>
+        <ooxml.schemas.version>1.3</ooxml.schemas.version>
+        <javassist.version>3.29.2-GA</javassist.version>
+        <microsoft.version>8.4.1.jre8</microsoft.version>
+        <pinyin4j.version>2.5.1</pinyin4j.version>
+        <sms4j.version>2.1.0</sms4j.version>
+        <license.version>2.0</license.version>
+        <easy.captcha.version>1.6.2</easy.captcha.version>
+        <paho.mqttv5.version>1.2.5</paho.mqttv5.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter</artifactId>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.eclipse.paho</groupId>
+            <artifactId>org.eclipse.paho.mqttv5.client</artifactId>
+            <version>${paho.mqttv5.version}</version>
+        </dependency>
+
+        <!--Java图形验证码,支持gif、中文、算术等类型:https://gitee.com/ele-admin/EasyCaptcha-->
+        <dependency>
+            <groupId>com.github.whvcse</groupId>
+            <artifactId>easy-captcha</artifactId>
+            <version>${easy.captcha.version}</version>
+        </dependency>
+
+        <!--引入MySql依赖-->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+
+        <!--引入oracle依赖-->
+        <dependency>
+            <groupId>com.oracle</groupId>
+            <artifactId>ojdbc7</artifactId>
+            <version>12.1.0.1.0</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/src/main/resources/lib/ojdbc7.jar</systemPath>
+        </dependency>
+
+        <!--引入sqlserver依赖-->
+        <dependency>
+            <groupId>com.microsoft.sqlserver</groupId>
+            <artifactId>mssql-jdbc</artifactId>
+            <version>${microsoft.version}</version>
+        </dependency>
+
+        <!--引入hutool依赖-->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>${hutool.version}</version>
+        </dependency>
+
+        <!--引入hutool依赖 邮件依赖-->
+        <dependency>
+            <groupId>com.sun.mail</groupId>
+            <artifactId>javax.mail</artifactId>
+            <version>${javax.mail.version}</version>
+        </dependency>
+
+        <!-- Sa-Token 权限认证, 在线文档:http://sa-token.dev33.cn/ -->
+        <dependency>
+            <groupId>cn.dev33</groupId>
+            <artifactId>sa-token-spring-boot-starter</artifactId>
+            <version>${satoken.version}</version>
+        </dependency>
+
+        <!-- Sa-Token 整合 Redis (使用jdk默认序列化方式) -->
+<!--        <dependency>-->
+<!--            <groupId>cn.dev33</groupId>-->
+<!--            <artifactId>sa-token-redis</artifactId>-->
+<!--            <version>${satoken.version}</version>-->
+<!--        </dependency>-->
+
+        <dependency>
+            <groupId>cn.dev33</groupId>
+            <artifactId>sa-token-temp-jwt</artifactId>
+            <version>${satoken.version}</version>
+        </dependency>
+
+        <!-- Sa-Token-OAuth2.0 模块 -->
+        <dependency>
+            <groupId>cn.dev33</groupId>
+            <artifactId>sa-token-oauth2</artifactId>
+            <version>${satoken.version}</version>
+        </dependency>
+
+
+        <!--引入Lombok依赖-->
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>${lombok.version}</version>
+            <optional>true</optional>
+        </dependency>
+
+        <!--引入mybatis-plus依赖-->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>${mybatisplus.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+            <version>${mybatisplus.generator.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.github.xiaoymin</groupId>
+            <artifactId>knife4j-spring-boot-starter</artifactId>
+            <version>${knife4j.version}</version>
+        </dependency>
+
+        <!--引入fastjson依赖-->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>${fastjson.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <version>${commons.lang.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-fileupload</groupId>
+            <artifactId>commons-fileupload</artifactId>
+            <version>${commons.fileupload.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>${commons.io.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>${commons.codec.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-configuration</groupId>
+            <artifactId>commons-configuration</artifactId>
+            <version>${commons.configuration.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>joda-time</groupId>
+            <artifactId>joda-time</artifactId>
+            <version>${joda.time.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <version>${gson.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>${druid.version}</version>
+        </dependency>
+
+        <!--引入模板依赖-->
+        <dependency>
+            <groupId>org.freemarker</groupId>
+            <artifactId>freemarker</artifactId>
+            <version>${freemarker.version}</version>
+        </dependency>
+
+        <!--引入注解验证依赖-->
+        <dependency>
+            <groupId>org.hibernate.validator</groupId>
+            <artifactId>hibernate-validator</artifactId>
+            <version>${hibernatevalidator.version}</version>
+        </dependency>
+
+        <!-- 动态数据源 -->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+            <version>${mybatisplus.dynamic.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.qiniu</groupId>
+            <artifactId>qiniu-java-sdk</artifactId>
+            <version>${qiniu.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.aliyun.oss</groupId>
+            <artifactId>aliyun-sdk-oss</artifactId>
+            <version>${aliyun.oss.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.huaweicloud</groupId>
+            <artifactId>esdk-obs-java</artifactId>
+            <version>${huawei.obs.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.qcloud</groupId>
+            <artifactId>cos_api</artifactId>
+            <version>${qcloud.cos.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-log4j12</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>io.minio</groupId>
+            <artifactId>minio</artifactId>
+            <version>${minio.oss.version}</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+            <optional>true</optional>
+        </dependency>
+
+        <!--jdk8  可以不需要-->
+        <dependency>
+            <groupId>javax.xml.bind</groupId>
+            <artifactId>jaxb-api</artifactId>
+            <version>${jaxb.api.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-core</artifactId>
+            <version>${log4j.core.version}</version>
+        </dependency>
+
+        <!-- mybatis-plus 多表关联 -->
+        <dependency>
+            <groupId>com.github.yulichang</groupId>
+            <artifactId>mybatis-plus-join</artifactId>
+            <version>${mybatisplus.join.version}</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>cn.smallbun.screw</groupId>
+            <artifactId>screw-core</artifactId>
+            <version>${screw.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.syyai.spring.boot</groupId>
+            <artifactId>ureport-spring-boot-starter</artifactId>
+            <version>${ureport.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.camunda.bpm.springboot</groupId>
+            <artifactId>camunda-bpm-spring-boot-starter</artifactId>
+            <version>${camunda.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.camunda.bpm.springboot</groupId>
+            <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
+            <version>${camunda.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.codehaus.groovy</groupId>
+            <artifactId>groovy-all</artifactId>
+            <version>${groovy.version}</version>
+            <classifier>sources</classifier>
+            <type>java-source</type>
+        </dependency>
+
+        <!-- 钉钉用到的jar包 -->
+        <dependency>
+            <groupId>taobao-sdk-java-auto</groupId>
+            <artifactId>taobao-sdk-java-auto</artifactId>
+            <version>1.0</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/src/main/resources/lib/taobao-sdk-java-auto.jar</systemPath>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.ssssssss</groupId>
+            <artifactId>magic-api-spring-boot-starter</artifactId>
+            <version>${magic.api.version}</version>
+        </dependency>
+
+        <!-- 腾讯云短信 -->
+        <dependency>
+            <groupId>com.tencentcloudapi</groupId>
+            <artifactId>tencentcloud-sdk-java</artifactId>
+            <version>${tencentcloud.version}</version>
+        </dependency>
+
+        <!-- 阿里云短信 -->
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-core</artifactId>
+            <version>${aliyun.core.version}</version>
+        </dependency>
+
+        <!-- keycloak -->
+        <dependency>
+            <groupId>org.keycloak</groupId>
+            <artifactId>keycloak-authz-client</artifactId>
+            <version>${keycloak.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.unfbx</groupId>
+            <artifactId>chatgpt-java</artifactId>
+            <version>${chatgpt.java.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.squareup.okio</groupId>
+            <artifactId>okio</artifactId>
+            <version>${okio.version}</version>
+        </dependency>
+
+        <!-- excel导入导出 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>easyexcel</artifactId>
+            <version>${easyexcel.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+            <version>${poi.version}</version>
+            <!--            <scope>provided</scope>-->
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+            <version>${poi.version}</version>
+            <!--            <scope>provided</scope>-->
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>ooxml-schemas</artifactId>
+            <version>${ooxml.schemas.version}</version>
+        </dependency>
+
+        <!--动态给类新增属性 的工具-->
+        <dependency>
+            <groupId>org.javassist</groupId>
+            <artifactId>javassist</artifactId>
+            <version>${javassist.version}</version>
+        </dependency>
+
+        <!-- 第三方拼音依赖包,配合 hutool-all 包中的 PinyinUtil 拼音工具使用 start -->
+        <dependency>
+            <groupId>com.belerweb</groupId>
+            <artifactId>pinyin4j</artifactId>
+            <version>${pinyin4j.version}</version>
+        </dependency>
+        <!-- 第三方拼音依赖包,配合 hutool-all 包中的 PinyinUtil 拼音工具使用 start -->
+
+        <dependency>
+            <groupId>org.dromara.sms4j</groupId>
+            <artifactId>sms4j-spring-boot-starter</artifactId>
+            <version>${sms4j.version}</version>
+        </dependency>
+
+
+
+        <dependency>
+            <groupId>org.smartboot.license</groupId>
+            <artifactId>license-client</artifactId>
+            <version>${license.version}</version>
+        </dependency>
+
+
+    </dependencies>
+
+    <build>
+        <finalName>${project.artifactId}</finalName>
+        <plugins>
+            <!--解开以下注释可以指定jdk版本-->
+            <!--            <plugin>-->
+            <!--                <groupId>org.apache.maven.plugins</groupId>-->
+            <!--                <artifactId>maven-compiler-plugin</artifactId>-->
+            <!--                <version>3.8.1</version>-->
+            <!--                <configuration>-->
+            <!--                    <source>1.8</source>-->
+            <!--                    <target>1.8</target>-->
+            <!--                    <encoding>${project.build.sourceEncoding}</encoding>-->
+            <!--                </configuration>-->
+            <!--            </plugin>-->
+
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <includeSystemScope>true</includeSystemScope>
+                    <excludes>
+                        <exclude>
+                            <groupId>org.projectlombok</groupId>
+                            <artifactId>lombok</artifactId>
+                        </exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>8</source>
+                    <target>8</target>
+                </configuration>
+            </plugin>
+            <!--解开以下注释  打包时 会使用 maven插件 上传到docker-->
+            <!--            &lt;!&ndash;使用docker-maven-plugin插件&ndash;&gt;-->
+            <!--            <plugin>-->
+            <!--                <groupId>com.spotify</groupId>-->
+            <!--                <artifactId>docker-maven-plugin</artifactId>-->
+            <!--                <version>1.2.2</version>-->
+            <!--                &lt;!&ndash;将插件绑定在某个phase执行&ndash;&gt;-->
+            <!--                <executions>-->
+            <!--                    <execution>-->
+            <!--                        <id>build-image</id>-->
+            <!--                        &lt;!&ndash;用户只需执行mvn package ,就会自动执行mvn docker:build&ndash;&gt;-->
+            <!--                        <phase>package</phase>-->
+            <!--                        <goals>-->
+            <!--                            <goal>build</goal>-->
+            <!--                        </goals>-->
+            <!--                    </execution>-->
+            <!--                </executions>-->
+            <!--                <configuration>-->
+            <!--                    &lt;!&ndash;指定生成的镜像名,这里是我们的作者名+项目名&ndash;&gt;-->
+            <!--                    <imageName>${project.artifactId}</imageName>-->
+            <!--                    &lt;!&ndash;指定标签 这里指定的是镜像的版本,我们默认版本是latest&ndash;&gt;-->
+            <!--                    <imageTags>-->
+            <!--                        <imageTag>latest</imageTag>-->
+            <!--                    </imageTags>-->
+            <!--                    &lt;!&ndash;指定基础镜像jdk11&ndash;&gt;-->
+            <!--                    <baseImage>openjdk:11-jre</baseImage>-->
+            <!--                    &lt;!&ndash;-->
+            <!--                    镜像制作人本人信息&ndash;&gt;-->
+            <!--                    <maintainer>343894036@email.com</maintainer>-->
+            <!--                    &lt;!&ndash;切换到ROOT目录&ndash;&gt;-->
+            <!--                    <workdir>/ROOT</workdir>-->
+            <!--                    &lt;!&ndash;查看我们的java版本&ndash;&gt;-->
+            <!--                    <cmd>["java", "-version"]</cmd>-->
+            <!--                    &lt;!&ndash;${project.build.finalName}.jar是打包后生成的jar包的名字&ndash;&gt;-->
+            <!--                    <entryPoint>["java", "-jar", "/${project.build.finalName}.jar"]</entryPoint>-->
+            <!--                    &lt;!&ndash;指定远程 docker api地址&ndash;&gt;-->
+            <!--                    <dockerHost>http://47.106.153.7:2375</dockerHost>-->
+            <!--                    &lt;!&ndash; 这里是复制 jar 包到 docker 容器指定目录配置 &ndash;&gt;-->
+            <!--                    <resources>-->
+            <!--                        <resource>-->
+            <!--                            <targetPath>/</targetPath>-->
+            <!--                            &lt;!&ndash;jar 包所在的路径  此处配置的 即对应 target 目录&ndash;&gt;-->
+            <!--                            <directory>${project.build.directory}</directory>-->
+            <!--                            &lt;!&ndash;用于指定需要复制的文件 需要包含的 jar包 ,这里对应的是 Dockerfile中添加的文件名 &ndash;&gt;-->
+            <!--                            <include>${project.build.finalName}.jar</include>-->
+            <!--                        </resource>-->
+            <!--                    </resources>-->
+
+            <!--                </configuration>-->
+            <!--            </plugin>-->
+
+        </plugins>
+    </build>
+
+</project>

+ 2 - 2
src/main/java/com/xjrsoft/config/SaTokenConfig.java

@@ -1,7 +1,7 @@
 package com.xjrsoft.config;
 
 import cn.dev33.satoken.context.SaHolder;
-import cn.dev33.satoken.exception.DisableServiceException;
+import cn.dev33.satoken.exception.DisableLoginException;
 import cn.dev33.satoken.exception.NotLoginException;
 import cn.dev33.satoken.exception.NotPermissionException;
 import cn.dev33.satoken.exception.NotRoleException;
@@ -91,7 +91,7 @@ public class SaTokenConfig implements WebMvcConfigurer {
                         return SaResult.get(ResponseCode.REQ_REJECT.getCode(), ResponseCode.REQ_REJECT.getMessage(), null);
                     } else if (e instanceof NotPermissionException) {    // 如果是权限异常
                         return SaResult.get(ResponseCode.REQ_REJECT.getCode(), ResponseCode.REQ_REJECT.getMessage(), null);
-                    } else if (e instanceof DisableServiceException) {    // 如果是被封禁异常
+                    } else if (e instanceof DisableLoginException) {    // 如果是被封禁异常
                         return SaResult.get(ResponseCode.REQ_REJECT.getCode(), ResponseCode.REQ_REJECT.getMessage(), null);
                     } else {    // 普通异常, 输出:500 + 异常信息
                         return SaResult.get(ResponseCode.INTERNAL_SERVER_ERROR.getCode(), ResponseCode.INTERNAL_SERVER_ERROR.getMessage(), null);

+ 14 - 9
src/main/java/com/xjrsoft/module/system/controller/Oauth2Controller.java

@@ -7,6 +7,7 @@ import cn.dev33.satoken.context.model.SaRequest;
 import cn.dev33.satoken.context.model.SaResponse;
 import cn.dev33.satoken.oauth2.config.SaOAuth2Config;
 import cn.dev33.satoken.oauth2.logic.SaOAuth2Handle;
+import cn.dev33.satoken.spring.SpringMVCUtil;
 import cn.dev33.satoken.stp.StpLogic;
 import cn.dev33.satoken.stp.StpUtil;
 import cn.dev33.satoken.util.SaResult;
@@ -23,8 +24,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.servlet.ModelAndView;
 
+import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -54,26 +57,28 @@ public class Oauth2Controller {
     public void setSaOAuth2Config(SaOAuth2Config cfg) {
         // 配置:未登录时返回的View
         cfg.setNotLoginView(() -> {
-                    SaRequest req = SaHolder.getRequest();
-                    Map<String, String> paramMap = req.getParamMap();
+                    HttpServletRequest req = SpringMVCUtil.getRequest();
+                    Map<String, String[]> paramMap = req.getParameterMap();
                     StringBuilder param = new StringBuilder();
                     paramMap.forEach((k, v) -> {
-                        param.append("&").append(k).append("=").append(v);
+                        param.append("&").append(k).append("=").append(v[0]);
                     });
                     param.deleteCharAt(0);
-                    String callBackUrl = String.format("%s?%s", req.getUrl(), param);
+                    String callBackUrl = String.format("%s?%s", req.getRequestURL(), param);
 
                     String key = GlobalConstant.OAUTH2 + IdUtil.simpleUUID();
                     redisUtil.set(key, callBackUrl, 86400);
 
-                    SaResponse res = SaHolder.getResponse();
-                    SaCookie cookie = new SaCookie()
-                            .setName("Oauth2Info")
-                            .setValue(key);
+                    HttpServletResponse res = SpringMVCUtil.getResponse();
+                    Cookie cookie = new Cookie("Oauth2Info",key);
 
                     res.addCookie(cookie);
 
-                    res.redirect(String.format("%s/#/login", commonPropertiesConfig.getDomainWeb()));
+                    try {
+                        res.sendRedirect(String.format("%s/#/login", commonPropertiesConfig.getDomainWeb()));
+                    } catch (IOException e) {
+                        throw new RuntimeException(e);
+                    }
                     return null;
                 }).
                 // 配置:登录处理函数

+ 1 - 1
src/main/java/com/xjrsoft/module/system/service/impl/LoginServiceImpl.java

@@ -79,7 +79,7 @@ public class LoginServiceImpl implements ILoginService {
     public LoginVo login(LoginDto dto) throws Exception {
         if (licenseConfig.getEnabled()) {
             //查出所有在线用户
-            List<String> onlineUser = StpUtil.searchSessionId("", 0,-1, true);
+            List<String> onlineUser = StpUtil.searchSessionId("", 0, Integer.MAX_VALUE);
 
             //如果已经登录人数超过授权人数  不允许登录
             if (onlineUser.size() >= licenseConfig.getLoginMax()) {

+ 2 - 2
src/main/resources/application-dev.yml

@@ -61,8 +61,8 @@ xjrsoft:
     druid-password: admin # druid 监控密码
     default-password: "000000" #默认密码(用户重置密码后为该密码)
     domain-api: https://test.tl.web.yingcaibx.com/api #api域名地址
-    domain-web: https://test.tl.web.yingcaibx.com #web域名地址
-#    domain-web: http://127.0.0.1:9000 #web域名地址
+#    domain-web: https://test.tl.web.yingcaibx.com #web域名地址
+    domain-web: http://127.0.0.1:9000 #web域名地址
     white-list:
       - 192.168.0.139
     exclude-urls: