jwt token

This commit is contained in:
jiangzhongxiang 2019-09-26 16:10:19 +08:00
parent 0bbd817a19
commit ace8887ea1
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
package com.educoder.bridge.user.util;
import java.util.Date;
import org.junit.Test;
import com.educoder.bridge.user.model.User;
public class JwtUtilsTest {
@Test
public void test() {
User user = new User();
user.setName("innov");
long expireTime = System.currentTimeMillis() + 1000L * 60 * 30;
Date expireDatePoint = new Date(expireTime);
String str = JwtUtils.genToken(user, expireDatePoint);
System.out.println(str);
}
}