yindu-auth

1.0.8 • Public • Published

银都奥美微信授权

yindu-auth

使用方式

yarn add yindu-auth 
npm/cnpm install --save yindu-auth
import { WeChatAuth, WECHAT_STATE_TYPE }  from 'yindu-auth'

const wa = new WeChatAuth({
  appid: '公众号appid',
  componentAppid: '第三方开发平台 APPid',
  apiHost: '授权接口',
  scope: WECHAT_STATE_TYPE.snsapi_userinfo, // WECHAT_STATE_TYPE.snsapi_userinfo(获取用户信息授权) WECHAT_STATE_TYPE.snsapi_base(静默授权)
  cookieTime: 1, // 1小时 cookie 有效期
  cookieKey: 'yindu_training_online01' // cookie 键值
})
wa.auth().then(res => {
  console.log('授权成功')
}).catch(err => {
  console.log('授权失败')
})

Readme

Keywords

none

Package Sidebar

Install

npm i yindu-auth

Weekly Downloads

2

Version

1.0.8

License

MIT

Unpacked Size

1.17 MB

Total Files

37

Last publish

Collaborators

  • chinazhanghai