From 374ce4ffd0c459bb4067e8d5765f972668aff9b1 Mon Sep 17 00:00:00 2001 From: wzp <2040239371@qq.com> Date: 星期四, 02 三月 2023 14:56:23 +0800 Subject: [PATCH] 变更oracle访问组件 --- web/web/SysUser.ashx | 36 ++++++++++++++++++++++++++++++++++-- 1 files changed, 34 insertions(+), 2 deletions(-) diff --git a/web/web/SysUser.ashx b/web/web/SysUser.ashx index d5590f4..190dddf 100644 --- a/web/web/SysUser.ashx +++ b/web/web/SysUser.ashx @@ -34,6 +34,9 @@ //淇敼瀵嗙爜 case "updatePwd": return UpdatePwd(context); + //鏍规嵁鏁扮粍瀛楃涓茶浆鎹㈠瓧鍏� + case "arrayStrToDict": + return ArrayStrToDict(context); default: throw new Exception("Invalid Action=" + @string); @@ -88,7 +91,8 @@ 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) @@ -98,6 +102,15 @@ 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"); @@ -140,7 +153,7 @@ throw new ArgumentException("璐︽埛鍚嶇О宸茬粡瀛樺湪锛岃閲嶆柊杈撳叆锛�"); sysUser.UserName = userName; - sysUser.UserType = string.IsNullOrEmpty(userType) ? 0 : int.Parse(userType); + sysUser.UserType = userType; sysUser.CreateTime = DateTime.Now; /** @@ -249,5 +262,24 @@ _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); } + } -- Gitblit v1.9.1