mirror of
https://gitee.com/jzsw-it/yexuejc-base.git
synced 2025-08-03 17:29:30 +08:00
Compare commits
5 Commits
df43189a0c
...
7f1b49df93
Author | SHA1 | Date | |
---|---|---|---|
|
7f1b49df93 | ||
|
0cfd7e78f1 | ||
|
0d66a62e6c | ||
9d160bdede | |||
831ba7b866 |
@ -1,6 +1,14 @@
|
||||
yexuejc-base 更新记录
|
||||
------------------
|
||||
|
||||
#### version :1.4.0
|
||||
**time:2020-5-18 12:06:14** <br/>
|
||||
**branch:** master <br/>
|
||||
**update:** <br/>
|
||||
>1. 更新仓库地址 https://nexus.yexuejc.club/ 为 https://nexus.yexuejc.top/
|
||||
>2. 优化Execl 和 Jwt 工具
|
||||
#
|
||||
|
||||
#### version :1.3.9
|
||||
**time:2019-1-11 16:50:51** <br/>
|
||||
**branch:** master <br/>
|
||||
|
25
pom.xml
25
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>top.yexuejc</groupId>
|
||||
<artifactId>yexuejc-base</artifactId>
|
||||
<version>1.3.9</version>
|
||||
<version>1.4.0</version>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<url>https://github.com/yexuejc/yexuejc-base</url>
|
||||
@ -39,7 +39,7 @@
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
<repos.yexuejc.url>https://nexus.yexuejc.club/repository/</repos.yexuejc.url>
|
||||
<repos.yexuejc.url>https://nexus.yexuejc.top/repository/</repos.yexuejc.url>
|
||||
<repos.mcworle.url>https://nexus.mcworle.com/repository/</repos.mcworle.url>
|
||||
<repos.aliyun.url>http://maven.aliyun.com/nexus/content/groups/public</repos.aliyun.url>
|
||||
<repos.jitpack.url>https://jitpack.io</repos.jitpack.url>
|
||||
@ -51,6 +51,7 @@
|
||||
<commons-io.version>2.6</commons-io.version>
|
||||
<bcprov-jdk15on.version>1.60</bcprov-jdk15on.version>
|
||||
<guava.version>20.0</guava.version>
|
||||
<apache-poi.version>3.13</apache-poi.version>
|
||||
<!-- 文件拷贝时的编码 -->
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
@ -96,6 +97,18 @@
|
||||
<artifactId>guava</artifactId>
|
||||
<version>${guava.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
<version>${apache-poi.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>${apache-poi.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@ -201,7 +214,7 @@
|
||||
<!--<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>-->
|
||||
<!--</repository>-->
|
||||
|
||||
<!-- 私服仓库发布
|
||||
<!-- 私服仓库发布-->
|
||||
<repository>
|
||||
<id>releases</id>
|
||||
<name>nexus-release</name>
|
||||
@ -212,9 +225,9 @@
|
||||
<name>nexus-snapshots</name>
|
||||
<url>${repos.yexuejc.url}maven-snapshots/</url>
|
||||
</snapshotRepository>
|
||||
-->
|
||||
|
||||
<repository>
|
||||
|
||||
<!-- <repository>
|
||||
<id>releases</id>
|
||||
<name>nexus-release</name>
|
||||
<url>${repos.mcworle.url}maven-releases/</url>
|
||||
@ -223,7 +236,7 @@
|
||||
<id>snapshots</id>
|
||||
<name>nexus-snapshots</name>
|
||||
<url>${repos.mcworle.url}maven-snapshots/</url>
|
||||
</snapshotRepository>
|
||||
</snapshotRepository>-->
|
||||
</distributionManagement>
|
||||
|
||||
<profiles>
|
||||
|
@ -1,5 +1,15 @@
|
||||
package com.yexuejc.base.util;
|
||||
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* excel 格式验证工具
|
||||
*
|
||||
@ -48,5 +58,20 @@ public class ExcelImportUtil {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void readExcel(String path) throws IOException {
|
||||
Workbook wb = null;
|
||||
if (isExcel2007(path)) {
|
||||
wb = new XSSFWorkbook(new FileInputStream(new File(path)));
|
||||
} else if (isExcel2003(path)) {
|
||||
wb = new HSSFWorkbook(new FileInputStream(new File(path)));
|
||||
} else {
|
||||
throw new NullPointerException("请上传excel文件");
|
||||
}
|
||||
Sheet sheet = wb.getSheetAt(0);
|
||||
for (int i = 2; i < sheet.getLastRowNum() + 1; i++) {
|
||||
Row row = sheet.getRow(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -124,4 +124,19 @@ public class JwtUtil {
|
||||
return JsonUtil.json2Obj(subject, cls);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解密token为字符串
|
||||
*
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
public String parseStr(String token) {
|
||||
String subject = null;
|
||||
try {
|
||||
subject = Jwts.parser().setSigningKey(JWT_SIGNATURE_KEY).parseClaimsJws(token).getBody().getSubject();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return subject;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user