| | |
| | | //修改密码 |
| | | case "updatePwd": |
| | | return UpdatePwd(context); |
| | | //根据数组字符串转换字典 |
| | | case "arrayStrToDict": |
| | | return ArrayStrToDict(context); |
| | | |
| | | default: |
| | | throw new Exception("Invalid Action=" + @string); |
| | |
| | | private JsonPageResult LoadUserMenuList(PageContext<SysUser> context) |
| | | { |
| | | context.CheckRight("104", FailedOperation.PromptOnly); |
| | | return new JsonPageResult(true, (object) this._Dao.LoadUserMenuList(context.GetInt("userid")).Keys); |
| | | //return new JsonPageResult(true, (object) this._Dao.LoadUserMenuList(context.GetInt("userid")).Keys); |
| | | return new JsonPageResult(true, (object) this._Dao.LoadUserRoleMenuList(context.GetInt("userid")).Keys); |
| | | } |
| | | |
| | | private JsonPageResult SaveUser(PageContext<SysUser> context) |
| | |
| | | string string2 = context.GetString("password"); |
| | | string userName = context.GetString("userName"); |
| | | string userType = context.GetString("userType"); |
| | | |
| | | List<string> tmpList = new List<string>(); |
| | | //数组合并 |
| | | tmpList.AddRange( JsonConvert.DeserializeObject<string[]>(context.GetString("userType")) ); |
| | | |
| | | //数组去重 |
| | | string[] tmpArray = DataConverter.DelRepeatData(tmpList.ToArray() ); |
| | | userType = string.Join(",", tmpArray) ; |
| | | |
| | | string string3 = context.GetString("email"); |
| | | string string4 = context.GetString("mobile"); |
| | | int int2 = context.GetInt("emailFlag"); |
| | |
| | | throw new ArgumentException("账户名称已经存在,请重新输入!"); |
| | | |
| | | sysUser.UserName = userName; |
| | | sysUser.UserType = string.IsNullOrEmpty(userType) ? 0 : int.Parse(userType); |
| | | sysUser.UserType = userType; |
| | | sysUser.CreateTime = DateTime.Now; |
| | | |
| | | /** |
| | |
| | | _Dao.UpdatePwd(account, newPwd ); |
| | | |
| | | return new JsonPageResult(true, (object)"修改密码成功!"); |
| | | } |
| | | |
| | | //根据数组字符串转换字典 |
| | | private JsonPageResult ArrayStrToDict(PageContext<Model.SysUser> context) |
| | | { |
| | | string userId = context.GetString("userId"); |
| | | string userType = context.GetString("userType"); |
| | | |
| | | Dictionary<string, object> dictionary = new Dictionary<string, object>(); |
| | | |
| | | List<object> list = DataConverter.stringToList(userType); |
| | | for (int i = 0; i < list.Count; i++) |
| | | { |
| | | //dictionary[userId.ToString()] = list[i]; |
| | | dictionary[list[i].ToString()] = list[i]; |
| | | } |
| | | |
| | | return new JsonPageResult(true, dictionary.Keys); |
| | | } |
| | | |
| | | } |