You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
568 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

```js
// 调用接口前判断是否已登录
var openId = localStorage.getItem("openId");
if (openId != null && openId != 'null' && openId != '' && openId !== undefined) {
alert("已登录你的ID是" + openId);
window.location.href = 'index.html';
return api;
}
// 轮询登录校验返回
if (payload.data != 'NO_LOGIN' && payload.status == '0') {
localStorage.setItem("openId", payload.data.openId);
alert("扫码已登录成功你的ID是" + payload.data.openId);
window.location.href = 'index.html';
}
return payload;
```