SDK for 微信小程序
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
$ git clone https://github.com/Authing/authing-wxapp-sdkvar Authing = require('path/to/authing/authing.js')var auth = new Authing({
clientId: 'your_client_id',
secret: 'your_app_secret'
});
auth.then(function(validAuth) {
//验证成功后返回新的 authing-js-sdk 实例(validAuth),可以将此实例挂在全局
validAuth.login({
unionid: 'test@testmail.com',
}).then(function(user) {
console.log(user);
}).catch(function(error) {
console.log(error);
});
}).catch(function(error) {
//验证失败
console.log(error);
});