- 封裝
public static String getToken(String userName,String password){
String url = "http://localhost:8888/jeecg/rest/tokens?username="+userName+"&password="+password;
String token= JwtHttpUtil.httpRequest(url, "POST", null);
return token;
}
- 呼叫
public static void main(String[] args) {
String token = getToken("name","password");
}