|
@@ -226,7 +226,7 @@ public class TokenUtil {
|
|
|
public String generateTempToken(String account) {
|
|
public String generateTempToken(String account) {
|
|
|
if (StringUtils.isBlank(account)) return null;
|
|
if (StringUtils.isBlank(account)) return null;
|
|
|
//加密数据,模式:模式0登录名,模式1用户id,时间戳,随机数,数据
|
|
//加密数据,模式:模式0登录名,模式1用户id,时间戳,随机数,数据
|
|
|
- String data = String.format("%s%d%s%s", "O",
|
|
|
|
|
|
|
+ String data = String.format("%s%d%s%s", "0",
|
|
|
System.currentTimeMillis() / 1000, RandomStringUtils.randomAlphanumeric(8), account);
|
|
System.currentTimeMillis() / 1000, RandomStringUtils.randomAlphanumeric(8), account);
|
|
|
//密钥,转md5,取 8-24 字符(16 字节)
|
|
//密钥,转md5,取 8-24 字符(16 字节)
|
|
|
String key = DigestUtils.md5Hex(securityProperties.getSecret()).substring(8, 24).toUpperCase();
|
|
String key = DigestUtils.md5Hex(securityProperties.getSecret()).substring(8, 24).toUpperCase();
|