|
|
@@ -1291,4 +1291,25 @@ public class AccountUtils {
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
+
|
|
|
+ public static UserView findUserByMobile(String mobile) throws Exception {
|
|
|
+ String url = AccountConfig.getUserSaveUrl();
|
|
|
+ if (!StringUtils.isEmpty(url)) {
|
|
|
+ url = url + "/info/mobile";
|
|
|
+ ModelMap data = new ModelMap();
|
|
|
+ data.put("mobile", mobile);
|
|
|
+ HttpUtil.ResponseWrap res = HttpUtil.doGet(url, data);
|
|
|
+ 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 if (result.getContent() != null) {
|
|
|
+ return JSON.parseObject(result.getContent().toString(), UserView.class);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|