jeecg, token獲取

張澤發表於2022-11-24
  • 封裝
    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");
    }

相關文章