|
|
@@ -66,7 +66,11 @@ public class AdminSuperviserApiController extends CertifyApiController {
|
|
|
@RequestMapping(value = "/insertAdmin", method = RequestMethod.POST)
|
|
|
public Result insertAdmin(@RequestParam(value = "roles[]", required = false) String[] roleIds, String data) {
|
|
|
Result res = new Result();
|
|
|
- JSONObject jo = (JSONObject) JSON.parse(data);
|
|
|
+ JSONObject jo = (JSONObject) JSON.parse(data);
|
|
|
+ if (roleIds==null||roleIds.length<=0) {
|
|
|
+ res.getError().add(buildError("","角色不能为空"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
if (null != jo) {
|
|
|
Admin admin = jo.toJavaObject(Admin.class);
|
|
|
|
|
|
@@ -74,7 +78,6 @@ public class AdminSuperviserApiController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "登录帐号为空", "登录帐号"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
if (StringUtils.isBlank(admin.getName())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "用户名为空", "用户名"));
|
|
|
return res;
|
|
|
@@ -85,6 +88,7 @@ public class AdminSuperviserApiController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "当前用户已注册!"));
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
|
|
|
Admin ad = new Admin();
|
|
|
BeanUtils.copyProperties(admin, ad);
|