Commit 20b6c0df authored by liudong1993's avatar liudong1993

1

parent 2e05967f
...@@ -556,5 +556,33 @@ namespace Edu.WebApi.Controllers.Course ...@@ -556,5 +556,33 @@ namespace Edu.WebApi.Controllers.Course
string filePath = Common.Plugin.WeChatHelper.GetWeChatQRCode(token, newUrl, width); string filePath = Common.Plugin.WeChatHelper.GetWeChatQRCode(token, newUrl, width);
return ApiResult.Success(data: filePath); return ApiResult.Success(data: filePath);
} }
/// <summary>
/// 生成小程序二维码(财务收据)
/// </summary>
/// <returns></returns>
public ApiResult CreateWeChatCodeForReceipt()
{
string url = base.ParmJObj.GetStringValue("url");
var newUrl = "/pages/index/index?id=" + HttpUtility.UrlEncode(url) + "&JumpType=20";
int width = base.ParmJObj.GetInt("width");
if (width <= 0)
{
width = 430;
}
string tokenKey = "DATA_WeiXinToken_" + Common.Config.AppID;
string token = Cache.WeChat.WeChatReidsCache2.GetToken(tokenKey);
if (Config.IsLocal == 1)
{
token = Common.Config.TempToken;
}
if (string.IsNullOrEmpty(token))
{
token = Common.Plugin.WeChatHelper.GetAccessToken(Common.Config.AppID, Common.Config.AppSecret);
Cache.WeChat.WeChatReidsCache2.Set(tokenKey, token);
}
string filePath = Common.Plugin.WeChatHelper.GetWeChatQRCode(token, newUrl, width);
return ApiResult.Success(data: filePath);
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment