Browse Source

保存记录接口

zhoutg 5 năm trước cách đây
mục cha
commit
bb113a0cd2

+ 3 - 9
diagbotman-service/src/main/java/com/diagbot/util/IPUtil.java

@@ -9,7 +9,6 @@ import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.Resource;
 import org.springframework.util.FileCopyUtils;
 
-import java.io.File;
 import java.io.InputStream;
 import java.lang.reflect.Method;
 
@@ -32,14 +31,9 @@ public class IPUtil {
         }
         try {
             DbConfig config = new DbConfig();
-            File file = new File("/ip2region.db"); // 本路获取资源文件
-            if (!file.exists()) {
-                Resource resource = new ClassPathResource("/ip2region.db"); // 远程获取资源文件
-                InputStream inputStream = resource.getInputStream();
-                searcher = new DbSearcher(config, FileCopyUtils.copyToByteArray(inputStream));
-            } else {
-                searcher = new DbSearcher(config, file.getPath());
-            }
+            Resource resource = new ClassPathResource("ip2region.db"); // 远程获取资源文件
+            InputStream inputStream = resource.getInputStream();
+            searcher = new DbSearcher(config, FileCopyUtils.copyToByteArray(inputStream));
         } catch (Exception e) {
             e.printStackTrace();
             System.out.println("获取DbSearcher错误");

+ 1 - 1
user-service/src/main/resources/mapper/MenuMapper.xml

@@ -18,7 +18,7 @@
     </resultMap>
 
     <select id="getByRole" resultMap="BaseResultMap">
-        select a.* from sys_menu a, sys_role_menu b, sys_user_role c
+        select distinct a.* from sys_menu a, sys_role_menu b, sys_user_role c
         where a.id = b.menu_id and b.role_id and b.role_id = c.role_id and c.user_id = #{userId}
         and a.is_deleted = 'N' and b.is_deleted = 'N' and c.is_deleted = 'N'
         ORDER BY a.parent_id , a.order_no