更新记录

1.0.0(2020-06-12)

1.0


平台兼容性

plus-login 封装APP的登录接口,利用PLUS的api实现,所以只支持APP

引入JS SDK

import plusLogin from '@/common/app-plus/plus-login.js';// 具体路径应该写你自己的

使用JSSDK

//#ifdef APP-PLUS
async apple(){
    const logout = await plusLogin.logout('apple'); // 退出
    const userinfo = await plusLogin.login('apple', {}).catch(err => {
        uni.showToast({
            title: err.message || '您的设备不支持Apple登录',
            icon: 'none'
        });
        return false;
    });
    console.log(userinfo)
}

async weixin(){
    const logout = await plusLogin.logout('weixin'); // 退出
    const userinfo = await plusLogin.login('weixin', {}).catch(err => {
        uni.showToast({
            title: err.message || '您的设备不支持weixin登录',
            icon: 'none'
        });
        return false;
    });
    console.log(userinfo)
}

async authorize_weixin(){
    // 微信也可以利用 authorize 获取到code 然后从服务器换取用户信息
    const res = await plusLogin.authorize('weixin').catch(err => {
        uni.showToast({
            title: err.message || '获取授权信息失败',
            icon: 'none'
        });
    });
    var code = res.code
    console.log(code);
}
//#endif

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT协议

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问