1.0.3 • Published 7 years ago
sd-passport v1.0.3
sd-passport
水滴多平台登录认证
INSTALL
yarn add sd-passportUSEAGE
import account from 'sd-passport'
Vue.use(account, {
ua: '', // 可选,默认取`navigator.userAgent`
appid: '新浪开放平台App Key',
thirdType: 372,
url: '应用地址回调,需要与开放平台中配置一致',
state: '回调状态'
})
// 登陆
this.$sdPassport.login().then((res) => {
console.log('login success')
}).catch(e => {
console.log('login fail')
})
// 或者重置参数, 注意:ua参数不支持重置
this.$sdPassport.login({
appid: '',
thirdType: 0,
url: ''
}).then((res) => {
console.log('login success')
}).catch(e => {
console.log('login fail')
})API
| 平台 | API详情地址 |
|---|---|
| 微信 | sd-account |
| 小程序 | sd-miniprogram-account |
| QQ小程序 | sd-qq-miniprogram-account |
| 微博 | sd-sina-account |