3.1.2 • Published 5 years ago

fetch-auth-code v3.1.2

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

fetch-auth-code

解决本地开发调试时,redirect_uri 回调公网的不便

登录开放平台,将授权回调地址配置为以下地址

www.mockdata.cn

授权回调


下载依赖

npm install fetch-auth-code --save-dev

项目引入

import { qr } from './fetchAuthCode.js';

使用

// 生成二维码
const q = qr({
  id: 'xx',
  appid: 'xxx'
})

// 查询 code
const code = await q.fetchCode()
console.log(code)
//{ code: '051wQKFa1UmB0A0LoGFa1j7YlK2wQKFe', state: 'undefined', type: 'code'|'error' }

// 停止查询
q.stop()
console.log(code)
// {code: code, type: "stop", state: 'undefined'}

// 清除二维码
q.clear()
console.log(code)
// {code: code, type: "clear", state: 'undefined'}

version

3.1.1
删除 fetchAuthCode 持续轮询

3.1.0
修改轮询方式

参数说明

https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/Wechat_Login.html

参数说明

3.1.2

5 years ago

3.1.1

5 years ago

3.1.0

5 years ago

2.1.3

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.0.2

5 years ago

2.1.0

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago