diff --git a/.env.example b/.env.example index 453ab33..965f191 100644 --- a/.env.example +++ b/.env.example @@ -6,6 +6,7 @@ MONGODB_URI=mongodb://127.0.0.1:27017 MONGODB_DB=torrent_console # 站点访问密码(留空则站点完全开放;设置后进入站点需在 /gate 输入此密码,cookie 由服务端校验) +# 同一 IP 输错 5 次锁定 1 小时 WEBPASSWORD= # 访问搜索源时使用的 HTTP 代理(国内网络连不上公开磁力站时配这里) diff --git a/app/layouts/default.vue b/app/layouts/default.vue index a5dfeff..6a7bef5 100644 --- a/app/layouts/default.vue +++ b/app/layouts/default.vue @@ -19,6 +19,11 @@ const mongoPill = computed(() => { ? { cls: 'on', text: 'MONGO' } : { cls: 'off', text: 'MONGO 未连接' } }) + +async function logout() { + await $fetch('/api/logout', { method: 'POST' }).catch(() => {}) + await navigateTo('/gate', { reload: true }) +}