From e8b2ca46862565b7b6d2f05c3f45f7873afe044e Mon Sep 17 00:00:00 2001
From: xubinbin <1323875150@qq.com>
Date: 星期四, 31 八月 2023 16:39:18 +0800
Subject: [PATCH] 将生成jwt令牌和验证jwt令牌时使用的公钥私钥由固定值修改为每次启动服务时动态生产;剔除jwt token中包含的password和roleId,防止密码泄露。

---
 src/main/java/com/genersoft/iot/vmp/storager/dao/RoleMapper.java |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/RoleMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/RoleMapper.java
old mode 100644
new mode 100755
index 425f5e4..3df7469
--- a/src/main/java/com/genersoft/iot/vmp/storager/dao/RoleMapper.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/RoleMapper.java
@@ -1,7 +1,6 @@
 package com.genersoft.iot.vmp.storager.dao;
 
 import com.genersoft.iot.vmp.storager.dao.dto.Role;
-import com.genersoft.iot.vmp.storager.dao.dto.User;
 import org.apache.ibatis.annotations.*;
 import org.springframework.stereotype.Repository;
 
@@ -11,25 +10,25 @@
 @Repository
 public interface RoleMapper {
 
-    @Insert("INSERT INTO user_role (name, authority, createTime, updateTime) VALUES" +
+    @Insert("INSERT INTO wvp_user_role (name, authority, create_time, update_time) VALUES" +
             "(#{name}, #{authority}, #{createTime}, #{updateTime})")
     int add(Role role);
 
     @Update(value = {" <script>" +
-            "UPDATE user_role " +
-            "SET updateTime=#{updateTime} " +
+            "UPDATE wvp_user_role " +
+            "SET update_time=#{updateTime} " +
             "<if test=\"name != null\">, name=#{name}</if>" +
             "<if test=\"authority != null\">, authority=#{authority}</if>" +
             "WHERE id != 1 and id=#{id}" +
             " </script>"})
     int update(Role role);
 
-    @Delete("DELETE FROM user_role WHERE  id != 1 and id=#{id}")
+    @Delete("DELETE from wvp_user_role WHERE  id != 1 and id=#{id}")
     int delete(int id);
 
-    @Select("select * FROM user_role WHERE id=#{id}")
+    @Select("select * from wvp_user_role WHERE id=#{id}")
     Role selectById(int id);
 
-    @Select("select * FROM user_role")
+    @Select("select * from wvp_user_role")
     List<Role> selectAll();
 }

--
Gitblit v1.8.0