コード例 #1
0
ファイル: ApiHelper.cs プロジェクト: meetTime/aigdzc
        private static ActionResponse CreateActionResponse(object obj = null)
        {
            ActionResponse ar = obj as ActionResponse;

            if (ar != null)
            {
                return(ar);
            }

            var pager = obj as IPagerModelCollection;

            if (pager != null)
            {
                return(ActionResponse.CreateSuccessResponse(pager, pager.TotalRecord));
            }
            return(ActionResponse.CreateSuccessResponse(obj));
        }
コード例 #2
0
        public ActionResponse Verify(string requestUrl, Identity identity)
        {
            if (identity != null)
            {
                return(ActionResponse.CreateSuccessResponse(requestUrl));
            }

            foreach (var item in NoAuthenticationUrls)
            {
                if (requestUrl.Contains(item))
                {
                    return(ActionResponse.CreateSuccessResponse(requestUrl));
                }
            }

            return(ActionResponse.CreateFailResponse((int)CrypoAuthenticationCode.VerifyFail, "Verify 失败,需要重新授权才能访问:{0}", requestUrl));
        }