|
@@ -1,5 +1,6 @@
|
|
package com.xy.utils;
|
|
package com.xy.utils;
|
|
|
|
|
|
|
|
+import cn.hutool.system.SystemUtil;
|
|
import com.aliyun.oss.ClientConfiguration;
|
|
import com.aliyun.oss.ClientConfiguration;
|
|
import com.aliyun.oss.OSS;
|
|
import com.aliyun.oss.OSS;
|
|
import com.aliyun.oss.OSSClient;
|
|
import com.aliyun.oss.OSSClient;
|
|
@@ -40,11 +41,15 @@ public class TyImgUrlConvert {
|
|
OSS ossClient = new OSSClient("oss-cn-beijing.aliyuncs.com",
|
|
OSS ossClient = new OSSClient("oss-cn-beijing.aliyuncs.com",
|
|
new DefaultCredentialProvider("LTAI5tKyfiX3LT2PENxrax6a", "QDpoLnUek0e0DE613mECgIirDExW89"),
|
|
new DefaultCredentialProvider("LTAI5tKyfiX3LT2PENxrax6a", "QDpoLnUek0e0DE613mECgIirDExW89"),
|
|
new ClientConfiguration());
|
|
new ClientConfiguration());
|
|
-
|
|
|
|
-
|
|
|
|
- InputStream inputStream = IoUtils.inputStream("tyGoods.xlsx").get();
|
|
|
|
// 读取Excel
|
|
// 读取Excel
|
|
- XSSFWorkbook workbook = new XSSFWorkbook(inputStream);
|
|
|
|
|
|
+ XSSFWorkbook workbook;
|
|
|
|
+ if (!SystemUtil.getOsInfo().isLinux()) {
|
|
|
|
+ workbook = new XSSFWorkbook("D:\\tyGoods.xlsx");
|
|
|
|
+ } else {
|
|
|
|
+ InputStream inputStream = IoUtils.inputStream("tyGoods.xlsx").get();
|
|
|
|
+ workbook = new XSSFWorkbook(inputStream);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
XSSFSheet sheet = workbook.getSheetAt(0);
|
|
XSSFSheet sheet = workbook.getSheetAt(0);
|
|
|
|
|