|
@@ -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) {
|