【微信小程序错误】登录失败 Error: 响应错误Error: ERR_GET_SESSION_KEY {"code":5100,message(-1)服务内部错误,请稍后重试或联系客服人员解决

错误全貌:
koa-weapp-demo Catch Error: Error: ERR_GET_SESSION_KEY {"code":5100,"message":"(-1)服务内部错误,请稍后重试或联系客服人员解决。","codeDesc":"ResourceOpFailed"} at qcloudProxyLogin.then.res (/Users/xuzhaoning/my-project/server/node_modules/wafer-node-sdk/lib/auth/index.js:162:23) at processTicksAndRejections (internal/process/next_tick.js:81:5)

或者

Error: 响应错误,{"code":-1,"error":"ERR_GET_SESSION_KEY\n{\"code\":0,\"message\":\"\",\"codeDesc\":\"Success\",\"data\":{\"errcode\":40029,\"errmsg\":\"invalid code, hints: [ req_id: fHkA67aLRa-4Pe9ea ]\"}}"}

解决方法:
完善server/config.js文件中的下列字段

// qcloudAppId   https://console.cloud.tencent.com/developer
qcloudAppId: '必填',
// qcloudSecretId   https://console.cloud.tencent.com/capi
qcloudSecretId: '必填',
qcloudSecretKey: '必填',
// 微信小程序 App ID
appId: '必填',
// 微信小程序 App Secret
appSecret: '必填',
// 是否使用腾讯云代理登录小程序,设置为false
useQcloudLogin: false,

将上列信息完善后,重启项目,就可以登录成功了。

你可能感兴趣的:(平时遇到的小问题)