/// <summary> /// 异步获取用户权限 /// </summary> /// <returns></returns> public async Task <UserPermission> GetPermissionAsync() { long userid = UserIdentity().UserId; string res = this.Get() as string; if (string.IsNullOrEmpty(res)) { var permission = await _resourceService.GetUserPermissionAsync(userid); this.Store(permission); return(permission); } return(JsonConvert.DeserializeObject <UserPermission>(res)); }
public async Task <UserPermission> GetUserPermissionAsync(long userid) { return(await _resourceService.GetUserPermissionAsync(userid)); }