public async Task <object> Login(string LoginName, string LoginPwd) { //var getByWhere = db.Queryable<Student>().Where(it => it.Id == 1 || it.Name == "a").ToList(); var user = _logic.GetDbClient().Queryable <Sys_User>().Where(p => p.User_LoginName == LoginName && p.User_Pwd == LoginPwd).First(); if (user == null) { return(new ResponseJson(StateEnum.Fail, "登录失败")); } else { var _RoleList = _logic.GetDbClient().Queryable <Sys_UserRole>().Where(m1 => m1.UserRole_UserID == user.User_ID).Select(m1 => m1.UserRole_RoleID).ToList(); CurrentAccount = new Account { RoleIDList = _RoleList, User = user, IsSuperManage = false }; var accountJson = JsonConvert.SerializeObject(CurrentAccount); var token = JwtToken.IssueJWT(accountJson, new TimeSpan(0, 60, 0), new TimeSpan(12, 00, 0)); return(token); } }
/// <summary> /// 获取菜单功能数据 /// </summary> /// <returns></returns> public object GetMenuFunctionData() { //不需要用LEFT JOIN或者 RIGHT JOIN 只是单纯的INNER JOIN时 //var menuList = DbClient.Queryable<Sys_Menu, Sys_Menu>((m1, m2) => m1.Menu_ParentID == m2.Menu_ID) // .Select((m1, m2) => new // { // m1.Menu_ID, // m1.Menu_Num, // m1.Menu_Name, // m1.Menu_Url, // m1.Menu_Icon, // m1.Menu_ParentID, // m1.Menu_IsShow, // Parent_Name = m2.Menu_Name, // Parent_IsShow = m2.Menu_IsShow // }).OrderBy((m1) => m1.Menu_Num).ToList(); var menuList = _logic.GetDbClient().Queryable <Sys_Menu, Sys_Menu>((m1, m2) => new object[] { JoinType.Left, m1.Menu_ParentID == m2.Menu_ID }) .Select((m1, m2) => new { m1.Menu_ID, m1.Menu_Num, m1.Menu_Name, m1.Menu_Url, m1.Menu_Icon, m1.Menu_ParentID, m1.Menu_IsShow, Parent_Name = m2.Menu_Name, Parent_IsShow = m2.Menu_IsShow }).OrderBy((m1) => m1.Menu_Num).ToList(); return(menuList); }
public async Task <object> Insert(Sys_RoleMenuFunction ent) { return(_logic.GetDbClient().GetSimpleClient <Sys_RoleMenuFunction>().Insert(ent)); }
public async Task <object> CreateAllTable(string FilePath = @"E:\6.代码Demo\YLYT.Core\02.Entitys\ORM", string NameSpace = "_02.Entitys.ORM") { _logic.GetDbClient().DbFirst.CreateClassFile(FilePath, NameSpace); return(default);
public async Task <object> Insert(Sys_User ent) { return(_logic.GetDbClient().GetSimpleClient <Sys_User>().Insert(ent)); }