12 lines
291 B
JavaScript
12 lines
291 B
JavaScript
export const checkLogin = () => {
|
|
const token = uni.getStorageSync("access_token");
|
|
if (!token) {
|
|
uni.showToast({ title: "请先登录", icon: "none" });
|
|
setTimeout(() => {
|
|
uni.navigateTo({ url: "/pages/login/index" });
|
|
}, 300);
|
|
return false;
|
|
}
|
|
return true;
|
|
};
|