Beispiel #1
0
        public async Task <IActionResult> GetAppMenu([FromServices] AppData appData, [FromServices] IUtilRepository util)
        {
            var business = HttpContext.Session.Get <Business>(appData.Session);

            if (business == null)
            {
                throw new Exception("请先登录");
            }
            var token = await util.GetTokenAsync(business.WeChatAppId, business.WeChatSecret);

            var menu = await WxHelper.GetAppMenuAsync(token);

            return(Json(menu));
        }