赞
踩
------1,创建一个用户对象User
package com.xforceplus.hera; public class User { private String userName; private String password; private String tel; public User(String userName,String password,String tel){ this.userName = userName; this.password = password; this.tel = tel; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getTel() { return tel; } public void setTel(String tel) { this.tel = tel; } }
-------2,开始进行加解密及测试
package com.xforceplus.hera; import com.xforceplus.xplat.core.utils.JsonUtils; import io.jsonwebtoken.Claims; import io.jsonwebtoken.JwtBuilder; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; import org.apache.commons.codec.binary.Base64; import org.jooq.tools.json.JSONParser;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。