sd-passport

水滴用户登录认证

Usage no npm install needed!

<script type="module">
  import sdPassport from 'https://cdn.skypack.dev/sd-passport';
</script>

README

sd-passport

水滴多平台登录认证

INSTALL

yarn add sd-passport

USEAGE

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|