alipay / alipay-sdk-nodejs-all

支付宝开放平台 Alipay SDK for Node.js
https://docs.open.alipay.com/54/103419/
Other
406 stars 62 forks source link

授权信息加载失败 #115

Closed willin closed 1 month ago

willin commented 7 months ago
image

快捷登录 授权信息加载失败

为保证账号安全,建议你返回重新授权登录

https://opendocs.alipay.com/open/02aile?scene=common&pathHash=4efd837f

示例的代码为:

const AlipaySdk = require("alipay-sdk").default;

const alipaySdk = new AlipaySdk({
  appId: "<-- 请填写您的AppId,例如:2019091767145019 -->",
  privateKey: "<-- 请填写您的应用私钥,例如:MIIEvQIBADANB ... ... -->",
  alipayPublicKey: "<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->",
  gateway: "https://openapi-sandbox.dl.alipaydev.com/gateway.do",
});
const result = await alipaySdk.pageExec("alipay.user.info.auth", {
  bizContent: {
    state: "init",
    scopes: {
      0: "auth_base",
    },
  },
});
fengmk2 commented 1 month ago

沙箱环境可能不够文档,建议使用生产环境试试。

欢迎前往 支付宝开放社区 发帖与支付宝工作人员和其他开发者一起交流, 或联系 支付宝开放平台客服 协助解决。