|
|
@@ -482,30 +482,32 @@ public class AccountUtils {
|
|
|
// }
|
|
|
// return null;
|
|
|
// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 验证密码,返回绑定身份信息的token
|
|
|
-// *
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// public static String getAccessToken(User user) throws Exception {
|
|
|
-// String saveUrl = AccountConfig.getUserSaveUrl();
|
|
|
-// if (!StringUtils.isEmpty(saveUrl)) {
|
|
|
-// JSONObject formData = JSON.parseObject(JSON.toJSONString(user));
|
|
|
-// formData.put("_operate", "getToken");
|
|
|
-// ResponseWrap res = HttpUtil.doGet(saveUrl, formData);
|
|
|
-// if (!res.isSuccess())
|
|
|
-// throw new Exception(res.getContent());
|
|
|
-// else {
|
|
|
-// ResultWrap result = JSON.parseObject(res.getContent(), ResultWrap.class);
|
|
|
-// if (!result.isSuccess())
|
|
|
-// throw new Exception(result.getErrMsg());
|
|
|
-// else
|
|
|
-// return String.valueOf(result.getContent());
|
|
|
-// }
|
|
|
-// }
|
|
|
-// return null;
|
|
|
-// }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 验证密码,返回绑定身份信息的token
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static String getAccessToken(UserView user) throws Exception {
|
|
|
+ String saveUrl = AccountConfig.getUserSaveUrl();
|
|
|
+ if (!StringUtils.isEmpty(saveUrl)) {
|
|
|
+ JSONObject formData = JSON.parseObject(JSON.toJSONString(user));
|
|
|
+ formData.put("_operate", "getToken");
|
|
|
+ HttpUtil.ResponseWrap res = HttpUtil.doGet(saveUrl, formData);
|
|
|
+ if (!res.isSuccess()) {
|
|
|
+ throw new Exception(res.getContent());
|
|
|
+ } else {
|
|
|
+ ResultWrap result = JSON.parseObject(res.getContent(), ResultWrap.class);
|
|
|
+ if (!result.isSuccess()) {
|
|
|
+ throw new Exception(result.getErrMsg());
|
|
|
+ } else {
|
|
|
+ return String.valueOf(result.getContent());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
//
|
|
|
// /**
|
|
|
// * 验证token,返回当前应用相关的身份信息
|