|
|
@@ -224,7 +224,7 @@ public class AccountUtils {
|
|
|
ModelMap formData = new ModelMap();
|
|
|
saveUrl = saveUrl + "/info/name";
|
|
|
formData.put("spaceName", spaceName);
|
|
|
- HttpUtil.ResponseWrap res = HttpUtil.doPost(saveUrl, formData);
|
|
|
+ HttpUtil.ResponseWrap res = HttpUtil.doGet(saveUrl, formData);
|
|
|
if (!res.isSuccess()) {
|
|
|
throw new Exception(res.getContent());
|
|
|
} else {
|
|
|
@@ -965,16 +965,27 @@ public class AccountUtils {
|
|
|
* @param userSpaceView 企业信息
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
- public static void register(UserSpaceView userSpaceView) throws Exception {
|
|
|
+ public static UserSpaceView register(UserSpaceView userSpaceView, UserView admin) throws Exception {
|
|
|
String url = AccountConfig.getSpaceSaveUrl();
|
|
|
if (!StringUtils.isEmpty(url)) {
|
|
|
url = url + "/register/other";
|
|
|
+ // 不把管理员设置成null会400
|
|
|
+ userSpaceView.setAdmin(null);
|
|
|
JSONObject data = JSON.parseObject(JSON.toJSONString(userSpaceView));
|
|
|
+ data.putAll(JSON.parseObject(JSON.toJSONString(admin)));
|
|
|
HttpUtil.ResponseWrap res = HttpUtil.doPost(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 {
|
|
|
+ return JSON.parseObject(result.getContent().toString(), UserSpaceView.class);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
/**
|