public ActionResult Edit(string username, MedicalCrab.Core.Models.User user) { try { var u = userService.EditUser(username, user); return(this.SuccessJson(u, "获取用户信息成功。")); } catch (Exception err) { return(this.ErrorJson(err.Message)); } }
/// <summary> /// 注册用户 /// </summary> /// <param name="user"></param> /// <returns></returns> public ActionResult Register(MedicalCrab.Core.Models.User user) { try { HXRestApi api = new HXRestApi("YXA6SVlUUCWEEeWx_C8p0OTisQ", "YXA65l1CuWGQBgTVZZTrIf8TfS4gQA8", "imchat", "dreamzoom"); if (!ModelState.IsValid) { throw new Exception(string.Join(",", ModelState.ToArray())); } api.AccountCreate(user.UserName, "123456"); userService.Register(user); return(this.SuccessJson("注册成功。")); } catch (Exception err) { return(this.ErrorJson(err.Message)); } }