1
0

3 Коммиты 7de99afb03 ... 5cf5d2b167

Автор SHA1 Сообщение Дата
  wuheng 5cf5d2b167 build 1 год назад
  wuheng 0096cb62fd Merge branch 'master' of http://39.105.160.25:10880/wuheng/eas-system 1 год назад
  wuheng ceea5c5139 build 1 год назад

+ 1 - 2
Jenkinsfile

@@ -17,8 +17,7 @@ pipeline {
                 sh '[ -n "$EASID" ] && docker kill $EASID && docker rm $EASID || echo -n "Docker Container is Down"'
                 sh '[ -n "$EASID" ] && docker images | grep easapi${BRANCH_NAME} | awk \'{print $1":"$2}\' | xargs docker rmi || echo -n "No Images of remove"'
                 sh '~/tools/apache-maven-3.6.3/bin/mvn sonar:sonar'
-                sh '~/tools/apache-maven-3.6.3/bin/mvn clean'
-                sh '~/tools/apache-maven-3.6.3/bin/mvn install -Dmaven.test.skip=true'
+                sh '~/tools/apache-maven-3.6.3/bin/mvn clean install -Dmaven.test.skip=true'
                 sh 'docker build -t easapi${BRANCH_NAME}:${BUILD_NUMBER} .'
             }
         }

+ 6 - 4
service/src/main/java/com/koobietech/eas/service/impl/EasSysAdminLoginServiceImpl.java

@@ -31,9 +31,8 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.ObjectUtils;
 
 import javax.annotation.Resource;
-import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.List;
@@ -88,8 +87,11 @@ public class EasSysAdminLoginServiceImpl implements EasSysAdminLoginService {
         List<DepartmentPojo> departments = userDetailPojoInRedis.getDepartments();
 
         //权限配置文件
-        String absolutePath = new File(jsonFilePath).getAbsolutePath();
-        FileInputStream archiveFile = fileManager.getArchiveFile(absolutePath);
+//        String absolutePath = new File(jsonFilePath).getAbsolutePath();
+//        FileInputStream archiveFile = fileManager.getArchiveFile(absolutePath);
+        String absolutePath = "temp/authority.json";
+        InputStream archiveFile = getClass().getClassLoader().getResourceAsStream(absolutePath);
+
         String jsonStr = "";
         try {
             jsonStr = IOUtils.toString(archiveFile, "UTF-8");

+ 3 - 27
service/src/main/java/com/koobietech/eas/service/impl/EasSysStudentLoginServiceImpl.java

@@ -1,7 +1,6 @@
 package com.koobietech.eas.service.impl;
 
 import com.alibaba.fastjson2.JSON;
-import com.google.common.io.Resources;
 import com.koobietech.eas.common.exception.EasException;
 import com.koobietech.eas.common.pojo.JwtUserPojo;
 import com.koobietech.eas.common.utils.FileManager;
@@ -26,12 +25,10 @@ import org.springframework.security.crypto.password.PasswordEncoder;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.io.InputStream;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-import java.net.URL;
 import java.util.List;
 import java.util.Objects;
 import java.util.Optional;
@@ -91,36 +88,15 @@ public class EasSysStudentLoginServiceImpl implements EasSysStudentLoginService
         //权限配置文件
         //String absolutePath = new File(jsonFilePath).getAbsolutePath();
         //FileInputStream archiveFile = fileManager.getArchiveFile(absolutePath);
-
-
         String absolutePath = "temp/authority.json";
-        URL resource = Resources.getResource(absolutePath);
-
-
+        InputStream archiveFile = getClass().getClassLoader().getResourceAsStream(absolutePath);
 
-        FileInputStream archiveFile = null;
         String jsonStr = "";
         try {
-            archiveFile = new FileInputStream(resource.getFile());
-
-            System.out.println( "archiveFile" );
-            System.out.println( archiveFile );
-
             jsonStr = IOUtils.toString(archiveFile, "UTF-8");
-        } catch (FileNotFoundException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
-        } finally {
+        } catch (IOException ignored) {} finally {
             IOUtils.closeQuietly(archiveFile);
         }
-        //InputStream archiveFile = this.getClass().getClassLoader().getResourceAsStream(absolutePath);
-
-//        try {
-//            jsonStr = IOUtils.toString(archiveFile, "UTF-8");
-//        } catch (IOException ignored) {} finally {
-//            IOUtils.closeQuietly(archiveFile);
-//        }
 
         EasAuthorityConfig easAuthorityConfig = JSON.parseObject(jsonStr, EasAuthorityConfig.class);
         if (easAuthorityConfig == null) {