\RG3.BO.BI.Tools\Controller\HelpController.cs
/// <summary>
/// 验证接口是否可以访问
/// </summary>
/// <exception cref="BizException"></exception>
private void ValidateAuth()
{
if (EnvPFUtil.IsDev()) return;
var pf = new PFGlobalParameter { OwnerId = RequestPFUtil.GetOwnerId(this.HttpContext), SysId = RequestPFUtil.GetSysId(this.HttpContext) };
var user = _authProvider.GetCurrentToken(null, null, pf.OwnerId, pf.SysId);
var valueN = new List<string> { "dbadmim", "development", "admin", "debugger" };
if (user != null && user.RoleId != null && (user.RoleId.Intersect(valueN)).Count() > 0) return;
throw new BizException(ErrorCodeConst.HTTP_16405.ErrorCode, "【接口授权】无权限,接口不能使用");
}
文档更新时间: 2023-06-05 21:08 作者:admin