let that = this;
console.log('授权登录')
plus.oauth.getServices((servies)=>{
console.log(servies)
var auths = servies;
var s = auths[1];
s.authorize(function(e) {
let data = {
code : e.code
}
let sys = plus.push.getClientInfo();
data.cid = sys.clientid;
console.log(data)
that.authLogin(data);
})
})
Among them servies are
You can traverse to get the authentication service whose ID is weixin. It is the authentication service for WeChat login. Mine is the second one and I am too lazy to change it.
Then get the code through authorize, and use the code and cid as parameters to request the interface to implement login.