Ejemplo n.º 1
0
        public IActionResult TicketVerify(TicketVerifyModel ticketVerify)
        {
            TicketVerifyResponseModel responseModel = null;

            // ticket 效验
            responseModel = _service.TicketVerify(ticketVerify.AppId, ticketVerify.AppSecret, ticketVerify.Ticket, ticketVerify.UserId, ticketVerify.UserIp);

            return(Ok(responseModel));
        }
Ejemplo n.º 2
0
        public IActionResult TicketVerify(TicketVerifyModel ticketVerify)
        {
            TicketVerifyResponseModel responseModel = null;
            // appId, appSecret效验: 这通常需要你自己根据业务实现 IAppChecker
            AppCheckModel appCheckResult = _appChecker.Check(ticketVerify.AppId, ticketVerify.AppSecret);

            if (!appCheckResult.Pass)
            {
                // -7 AppId,AppSecret效验不通过
                responseModel = new TicketVerifyResponseModel {
                    code = -7, message = appCheckResult.Message
                };
                return(Ok(responseModel));
            }

            // ticket 效验
            responseModel = _service.TicketVerify(ticketVerify.AppId, ticketVerify.AppSecret, ticketVerify.Ticket, ticketVerify.UserId, ticketVerify.UserIp);

            return(Ok(responseModel));
        }