/// <summary> /// 获取默认用户 /// <para>作 者:蔡亚康</para> /// <para>创建时间:2019-03-07</para> /// </summary> /// <returns></returns> public AMS.Service.HssUserPrincipal GetDefaultUser() { JwtHandler handler = new JwtHandler(); AMS.Service.HssUserPrincipal user = handler.Handler(this._context); return(user); }
/// <summary> /// 验证用户 /// <para>作 者:蔡亚康</para> /// <para>创建时间:2019-03-07</para> /// </summary> /// <returns></returns> public void ValidateDefaultUser() { AMS.Service.HssUserPrincipal user = GetDefaultUser(); //用户为空或者未授权 if (user == null || !user.IsAuthenticated) { throw new PlatformException(ErrorMsgConfig.ERROR_TOKEN_DESCRYPTION_FAILED); } }