Skip to content

zhaoyao91/meteor-accounts-wechat

Repository files navigation

zhaoyao91:accounts-wechat

Meteor accounts package for wechat. Because this package is generally used in China, this doc will be written in chinese.

简介

用法

1. 添加包

meteor add zhaoyao91:accounts-wechat
meteor add service-configuration

2. 配置

server端:

ServiceConfiguration.configurations.upsert({
    service: WeChat.serviceName // 可以通过Meteor.settings.public.wechatServiceName来修改这个值
}, {
    $set: {
        appId: '...',
        secret: '...',
        scope: 'snsapi_login',
        mainId: 'openId'
    }
});

3. 登录

client端:

Meteor.loginWithWeChat(function(err, res){
   ... 
})

Note

微信开放平台相关应用的授权回调域、对应Meteor应用的ROOT_URL以及用户访问该应用的实际url必须保持一致。

参考

About

meteor accounts package for wechat

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published