yindu-auth
v1.0.8
Published
yindu auth
Downloads
3
Readme
银都奥美微信授权
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('授权失败')
})