Commit 69ac552f authored by m1991's avatar m1991

后台接口——用户与资讯后台接口

parent a7d955c5
......@@ -162,7 +162,12 @@
<artifactId>ffmpeg-platform</artifactId>
<version>4.0.2-1.4.3</version>
</dependency>
<!--获取服务器硬件信息-->
<dependency>
<groupId>org.fusesource</groupId>
<artifactId>sigar</artifactId>
<version>${sigar.version}</version>
</dependency>
<!--druid数据源 -->
<dependency>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4" />
\ No newline at end of file
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
......@@ -64,6 +64,12 @@
<artifactId>thumbnailator</artifactId>
<version>0.4.8</version>
</dependency>
<!--获取服务器硬件信息-->
<dependency>
<groupId>org.fusesource</groupId>
<artifactId>sigar</artifactId>
<version>1.6.4</version>
</dependency>
</dependencies>
<!-- MAVEN构建 -->
......
......@@ -58,7 +58,9 @@ public class ShiroConfig {
// 设置拦截器集合
Map<String, String> filterChainDefinitionMap = new LinkedHashMap<String, String>();
filterChainDefinitionMap.put("/authInformation/save", "anon");//存储设备IMEI号和手机SIM卡ID号
filterChainDefinitionMap.put("/sys/login", "anon"); // 登录页面-身份认证
filterChainDefinitionMap.put("/sys/registered", "anon"); // 注册页面
filterChainDefinitionMap.put("/swagger-ui.html", "anon"); // swagger接口-匿名访问
filterChainDefinitionMap.put("/swagger/**", "anon");
filterChainDefinitionMap.put("/swagger-resources/**", "anon");
......
package cn.wisenergy.web.config;
import lombok.extern.slf4j.Slf4j;
import org.hyperic.jni.ArchNotSupportedException;
import org.hyperic.sigar.Sigar;
import org.hyperic.sigar.SigarLoader;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import java.io.*;
/**
* Created by m1991 on 2021/3/23 16:50
*/
@Slf4j
@Configuration
public class SigarConfig {
static {
try {
initSigar();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 初始化sigar的配置文件
*/
public static void initSigar() throws IOException {
SigarLoader loader = new SigarLoader(Sigar.class);
String lib = null;
try {
lib = loader.getLibraryName();
log.info("init sigar so文件====================="+lib);
} catch (ArchNotSupportedException var7) {
log.error("initSigar() error:{}",var7.getMessage());
}
ResourceLoader resourceLoader = new DefaultResourceLoader();
Resource resource = resourceLoader.getResource("classpath:/sigar.so/" + lib);
if (resource.exists()) {
InputStream is = resource.getInputStream();
File tempDir = new File("./log");
if (!tempDir.exists()){
tempDir.mkdirs();
}
BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(new File(tempDir, lib), false));
int lentgh = 0;
while ((lentgh = is.read()) != -1){
os.write(lentgh);
}
is.close();
os.close();
System.setProperty("org.hyperic.sigar.path", tempDir.getCanonicalPath());
}
}
}
\ No newline at end of file
package cn.wisenergy.web.shiro;
import cn.wisenergy.common.enums.RespCodeEnum;
import cn.wisenergy.model.app.User;
import cn.wisenergy.web.config.JwtConfig;
import com.alibaba.fastjson.JSON;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment