Explorar el Código

登录权限取消

yangbq hace 1 mes
padre
commit
df391dabde

+ 2 - 2
pom.xml

@@ -91,10 +91,10 @@
             <artifactId>spring-boot-configuration-processor</artifactId>
             <optional>true</optional>
         </dependency>
-        <dependency>
+       <!-- <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-security</artifactId>
-        </dependency>
+        </dependency>-->
         <dependency>
             <groupId>org.apache.httpcomponents</groupId>
             <artifactId>httpclient</artifactId>

+ 2 - 5
src/main/java/com/project/zcustom/config/SecurityConfig.java

@@ -1,8 +1,5 @@
 package com.project.zcustom.config;
 
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.web.SecurityFilterChain;
-
 /**
  * @Description
  * @Author bqyang
@@ -13,12 +10,12 @@ import org.springframework.security.web.SecurityFilterChain;
 public class SecurityConfig {
 
     //@Bean
-    public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
+    /*public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
         http
                 .authorizeRequests()
                 .anyRequest().permitAll() // 允许所有请求通过
                 .and()
                 .csrf().disable(); // 禁用 CSRF 保护
         return http.build();
-    }
+    }*/
 }

+ 2 - 2
src/main/java/com/project/zcustom/exception/GlobalExceptionHandler.java

@@ -21,11 +21,11 @@ public class GlobalExceptionHandler {
         return AjaxResult.error(message);
     }
 
-    @ExceptionHandler(NotLoginException.class)
+    /*@ExceptionHandler(NotLoginException.class)
     public AjaxResult handleMissingParams(NotLoginException ex) {
         String message = "未登录,请登录!";
         return AjaxResult.error(401,message);
-    }
+    }*/
 
     @ExceptionHandler(ServiceException.class)
     public AjaxResult serviceException(ServiceException ex) {

+ 1 - 1
src/main/java/com/project/zcustom/service/system/impl/SysUserServiceImpl.java

@@ -31,7 +31,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         if (Objects.isNull(user)) {
             throw new ServiceException("用户名/密码错误!");
         }
-        boolean pass = SecurityUtils.matchesPassword(password, user.getPassword());
+        boolean pass = false;//SecurityUtils.matchesPassword(password, user.getPassword());
         if (!pass){
             throw new ServiceException("用户名/密码错误!");
         }

+ 4 - 5
src/main/java/com/project/zcustom/tools/SecurityUtils.java

@@ -1,7 +1,6 @@
 package com.project.zcustom.tools;
 
 
-import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
 
 /**
  * 安全服务工具类
@@ -16,10 +15,10 @@ public class SecurityUtils {
      * @param password 密码
      * @return 加密字符串
      */
-    public static String encryptPassword(String password) {
+   /* public static String encryptPassword(String password) {
         BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
         return passwordEncoder.encode(password);
-    }
+    }*/
 
     /**
      * 判断密码是否相同
@@ -28,9 +27,9 @@ public class SecurityUtils {
      * @param encodedPassword 加密后字符
      * @return 结果
      */
-    public static boolean matchesPassword(String rawPassword, String encodedPassword) {
+    /*public static boolean matchesPassword(String rawPassword, String encodedPassword) {
         BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
         return passwordEncoder.matches(rawPassword, encodedPassword);
-    }
+    }*/
 
 }

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

@@ -5,9 +5,9 @@ server:
 spring:
   datasource:
     driverClassName: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://127.0.0.1:3306/sxgw?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
+    url: jdbc:mysql://192.168.110.130:13306/sxgw?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
     username: root
-    password: 1qaz2wsx
+    password: root
   jackson:
     date-format: yyyy-MM-dd HH:mm:ss
     time-zone: GMT+8

+ 38 - 0
src/main/resources/application-local.yml

@@ -0,0 +1,38 @@
+server:
+  port: 8080
+  servlet:
+    context-path: /zhhq_dp
+spring:
+  datasource:
+    driverClassName: com.mysql.cj.jdbc.Driver
+    url: jdbc:mysql://127.0.0.1:3306/sxgw?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
+    username: root
+    password: 1qaz2wsx
+  jackson:
+    date-format: yyyy-MM-dd HH:mm:ss
+    time-zone: GMT+8
+    serialization:
+      write-dates-as-timestamps: false
+  #配置上传图片大小限制
+  servlet:
+    multipart:
+      max-file-size: 10MB
+      max-request-size: 10MB
+
+# MyBatisPlus配置
+mybatis-plus:
+  # 搜索指定包别名
+  typeAliasesPackage: com.project.**.domain
+  # 配置mapper的扫描,找到所有的mapper.xml映射文件
+  mapperLocations: classpath*:mapper/**/*Mapper.xml
+  # 全局配置
+  global-config:
+    db-config:
+      id-type: auto
+      logic-delete-field: delFlag
+      logic-not-delete-value: "0"
+      logic-delete-value: "1"
+  configuration:
+    map-underscore-to-camel-case: true
+    #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 打印sql
+

+ 8 - 8
src/main/resources/application.yml

@@ -3,18 +3,18 @@ spring:
     active: dev
 
 ############## Sa-Token 配置 (文档: https://sa-token.cc) ##############
-sa-token:
+#sa-token:
   # token 名称(同时也是 cookie 名称)
-  token-name: Authorization
+  #token-name: Authorization
   # token 有效期(单位:秒) 默认30天,-1 代表永久有效
-  timeout: 2592000
+  #timeout: 2592000
   # token 最低活跃频率(单位:秒),如果 token 超过此时间没有访问系统就会被冻结,默认-1 代表不限制,永不冻结
-  active-timeout: -1
+  #active-timeout: -1
   # 是否允许同一账号多地同时登录 (为 true 时允许一起登录, 为 false 时新登录挤掉旧登录)
-  is-concurrent: true
+  #is-concurrent: true
   # 在多人登录同一账号时,是否共用一个 token (为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token)
-  is-share: true
+  #is-share: true
   # token 风格(默认可取值:uuid、simple-uuid、random-32、random-64、random-128、tik)
-  token-style: simple-uuid
+  #token-style: simple-uuid
   # 是否输出操作日志
-  is-log: true
+  #is-log: true