wechat-article / composables /useLoginCheck.ts
Antigravity
Initialize wechat-article without git history and binary assets
70e483f
Raw
History Blame Contribute Delete
361 Bytes
import LoginModal from '~/components/modal/Login.vue';
export default () => {
const modal = useModal();
const loginAccount = useLoginAccount();
// 检查是否有登录信息
function checkLogin() {
if (loginAccount.value === null) {
modal.open(LoginModal);
return false;
}
return true;
}
return {
checkLogin,
};
};