Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

await alipaySdk.exec(method, params, options)调用异常 #1

Closed
codeWinson opened this issue Jul 25, 2018 · 3 comments
Closed

await alipaySdk.exec(method, params, options)调用异常 #1

codeWinson opened this issue Jul 25, 2018 · 3 comments

Comments

@codeWinson
Copy link

codeWinson commented Jul 25, 2018

{ accessToken: 'accessToken',
alipayUserId: '****',
expiresIn: 1296000,
reExpiresIn: 2592000,
refreshToken: 'refreshToken',
userId: 'userId' }
image
image
image
image
image

@tudou527
Copy link
Contributor

tudou527 commented Aug 8, 2018

exec 返回的基础类型是 AlipaySdkCommonResult 你可以这样写:

interface IOauthToken extends AlipaySdkCommonResult {
  accessToken: string;
  alipayUserId: string;
  expiresIn: number;
  reExpiresIn: number;
  refreshToken: string;
  userId: string;
}

await alipaySdk.exec('alipay.system.oauth.token', { ... }, { ... })
  .then((res: IOauthToken) => {
    const token = res.accessToken;
  });

@tudou527
Copy link
Contributor

IOauthToken 你定义在哪里的,这个提示是找不到这个定义。

@tudou527
Copy link
Contributor

贴代码出来看看

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants