mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update 修改余额支付订单
This commit is contained in:
@@ -4,6 +4,8 @@ import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import io.jsonwebtoken.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -14,6 +16,7 @@ import java.util.Date;
|
||||
|
||||
@Component
|
||||
public class JWTUtils {
|
||||
private static final Logger logger = LoggerFactory.getLogger(JWTUtils.class);
|
||||
// 令牌自定义标识
|
||||
private static String header;
|
||||
|
||||
@@ -94,6 +97,7 @@ public class JWTUtils {
|
||||
.parseClaimsJws(token)
|
||||
.getBody();
|
||||
} catch (ExpiredJwtException e) {
|
||||
logger.error("parseToken error", e);
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_TOKEN_ERROR);
|
||||
}
|
||||
return claims;
|
||||
|
||||
@@ -3,11 +3,13 @@ package com.jsowell.common.util.file;
|
||||
import com.aliyun.oss.OSS;
|
||||
import com.aliyun.oss.OSSClientBuilder;
|
||||
import com.jsowell.common.config.AliyunOssConfig;
|
||||
import com.jsowell.common.util.RandomUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Component
|
||||
public class AliyunOssUploadUtils {
|
||||
@@ -39,8 +41,16 @@ public class AliyunOssUploadUtils {
|
||||
|
||||
// 编码文件名
|
||||
String filePathName = FileUploadUtils.extractFilename(file);
|
||||
|
||||
//获取当前时间
|
||||
LocalDateTime currentDate = LocalDateTime.now();
|
||||
String dir_name = currentDate.getYear() + "/" + currentDate.getMonthValue() + "/";
|
||||
|
||||
// 随机数
|
||||
String randomNumber = RandomUtil.getRandomNumber(5) + "-";
|
||||
|
||||
// 文件路径名称
|
||||
filePathName = aliyunOssConfig.getFilehost() + "/" + filePathName;
|
||||
filePathName = aliyunOssConfig.getFilehost() + "/" + dir_name + randomNumber + filePathName;
|
||||
try {
|
||||
ossClient.putObject(aliyunOssConfig.getBucketName(), filePathName, file.getInputStream());
|
||||
} catch (IOException e) {
|
||||
|
||||
Reference in New Issue
Block a user