登录授权
auth
方法用来唤起微信客户端进行授权登录。
参数说明
参数名 | 参数类型 | 是否必须 | 说明 |
---|---|---|---|
scope | string | 是 | 授权域 |
state | string | 是 | 标识符唯一即可 |
示例代码
var scope = "snsapi_userinfo",
state = "_" + (+new Date());
Wechat.auth(function (installed) {
alert("Wechat installed: " + (installed ? "Yes" : "No"));
}, function (reason) {
alert("Failed: " + reason);
});