修改二维码上传图片路径
This commit is contained in:
parent
9c911ea8e0
commit
24fb0c36ea
@ -52,7 +52,7 @@ public class QrImgUtils {
|
||||
// 创建OSSClient实例
|
||||
OSSClient ossClient = new OSSClient(environment.getProperty("oss.endpoint"), environment.getProperty("oss.access-key"), environment.getProperty("oss.secret-key"));
|
||||
// 上传文件流
|
||||
ossClient.putObject(environment.getProperty("oss.bucket-name"), xhpcTerminal.getPileSerialNumber() + "/" + finallyImgFileName, new File(environment.getProperty("oss.destPath") + "\\" + finallyImgFileName));
|
||||
ossClient.putObject(environment.getProperty("oss.bucket-name"), xhpcTerminal.getPileSerialNumber() + "/" + finallyImgFileName, new File(environment.getProperty("destPath") + "\\" + finallyImgFileName));
|
||||
ossClient.shutdown();
|
||||
|
||||
//5.将放在阿里云上的生成的图片的路径和图片所对应的终端的id放入数据库xhpc_img表中
|
||||
@ -60,10 +60,10 @@ public class QrImgUtils {
|
||||
xhpcImgMapper.insert(xhpcTerminal.getPileSerialNumber() + "/" + finallyImgFileName, terminalId);
|
||||
|
||||
//6.删除生成的二维码图片
|
||||
File QrImg = new File(environment.getProperty("oss.destPath") + "\\" + qrFileName);
|
||||
File QrImg = new File(environment.getProperty("destPath") + "\\" + qrFileName);
|
||||
QrImg.delete();
|
||||
//7.删除生成本地生成的完整图片
|
||||
File finallyImg = new File(environment.getProperty("oss.fullImgDestPath") + finallyImgFileName);
|
||||
File finallyImg = new File(environment.getProperty("fullImgDestPath") + finallyImgFileName);
|
||||
finallyImg.delete();
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user