提交 f70f1327 编写于 作者: I IanDavid

小修改

上级 d497b36e
......@@ -36,12 +36,13 @@ namespace Ae.C.Login.Api.Client.Clients.WeChatService
/// <returns></returns>
public async Task<GetJsCodeResponse> GetJscode2session(LoginPlatform platform, string jsCode)
{
GetJsCode2SessionRequest request = new GetJsCode2SessionRequest();
string openId = "";
try
{
//创建调用client
var client = clientFactory.CreateClient("WebChat");
//整合调用参数
GetJsCode2SessionRequest request = new GetJsCode2SessionRequest();
request.Js_Code = jsCode;
if (platform== LoginPlatform.YangChe)
{
......@@ -63,13 +64,13 @@ namespace Ae.C.Login.Api.Client.Clients.WeChatService
}
//调微信接口
string openId = await client.GetAsStringAsync<GetJsCode2SessionRequest>(configuration["WebChat:jscode2session"], request);
openId = await client.GetAsStringAsync<GetJsCode2SessionRequest>(configuration["WebChat:jscode2session"], request);
GetJsCodeResponse result = JsonConvert.DeserializeObject<GetJsCodeResponse>(openId);
return result;
}
catch (Exception ex)
{
logger.Error($"微信GetJscode2session:Request:{JsonConvert.SerializeObject(new { platform=platform, jsCode=jsCode })}调用失败", ex);
logger.Error($"微信GetJscode2session:Request:{JsonConvert.SerializeObject(request)}, openId={openId}", ex);
return null;
}
}
......
......@@ -28,17 +28,17 @@
"RefreshTokenExpiresMinutes": "100080" //60*24*7
},
"Mini": {
"CheBang": {
"YangChe": {//1
"AppId": "",
"Secret": "",
"Grant_Type": "authorization_code"
},
"YangChe": {
"AppId": "",
"CheBang": { //2
"AppId": "wx48091b1fd1f7ad7d",
"Secret": "",
"Grant_Type": "authorization_code"
},
"QiPei": {
"QiPei": {//3
"AppId": "",
"Secret": "",
"Grant_Type": "authorization_code"
......
......@@ -13,10 +13,10 @@ cd myproject
yarn
# 开发时构建
npm dev
npm run dev
# 打包构建
npm build
npm run build
# 指定平台的开发时构建(微信、百度、头条、支付宝)
npm dev:wx
......
{
"appid": "wx559ad07b5033016f",
"appid": "wx48091b1fd1f7ad7d",
"setting": {
"urlCheck": false
},
......
......@@ -34,7 +34,7 @@
},
"miniprogramRoot": "dist/wx/",
"compileType": "miniprogram",
"appid": "wx559ad07b5033016f",
"appid": "wx48091b1fd1f7ad7d",
"projectname": "miniappc-main",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册