提交 240950fb authored 作者: Whispa's avatar Whispa

commit

上级 0511ba44
......@@ -267,11 +267,18 @@ public class AuthController extends Controller {
Hashids hashids = new Hashids("big father is daddy", 6);
Long codeCount = user.getCodeCount();
Calendar cal = Calendar.getInstance();
long currentTime = cal.getTimeInMillis();
long Max = 9999999999999L;
long Min = 1000000000000L;
long range = Math.abs((long) (Math.random() * (Max - Min)) + Min);
long id = Math.addExact(currentTime, range);
if( codeCount == null){
codeCount = userRepository.count();
}
user.setCode(hashids.encode(codeCount));
user.setCode(hashids.encode(id));
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论