From a6014876501da1f63f6a77198e9698fbb10ffa5b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=99=88=E4=BD=B3=E6=B4=9B?=
<73123406+pchpub@users.noreply.github.com>
Date: Wed, 21 Sep 2022 20:58:27 +0800
Subject: [PATCH] add: allow no access to online blacklist
---
src/html/admin.html | 86 +++++++++++++++++++++++++++++++++++++++
src/mods/get_user_info.rs | 4 ++
src/mods/types.rs | 2 +
3 files changed, 92 insertions(+)
create mode 100644 src/html/admin.html
diff --git a/src/html/admin.html b/src/html/admin.html
new file mode 100644
index 00000000..2d7c9333
--- /dev/null
+++ b/src/html/admin.html
@@ -0,0 +1,86 @@
+
+
+
+
+BiliRust-panel
+
+
+
+
+
+ BiliRoaming-Rust-Panel
+
+
+
diff --git a/src/mods/get_user_info.rs b/src/mods/get_user_info.rs
index 56ad1ea3..4f0fd571 100644
--- a/src/mods/get_user_info.rs
+++ b/src/mods/get_user_info.rs
@@ -159,6 +159,10 @@ pub async fn auth_user(redis: &Pool,uid: &u64,config: &BiliConfig) -> Result<(bo
None => (),
}
+ if !config.online_blacklist_open {
+ return Ok((false,false));
+ }
+
match getusercer_list(redis, uid).await{
Ok(data) => {
if config.one_click_run {
diff --git a/src/mods/types.rs b/src/mods/types.rs
index 02890092..0bb3357a 100644
--- a/src/mods/types.rs
+++ b/src/mods/types.rs
@@ -116,6 +116,8 @@ pub struct BiliConfig {
pub cache: HashMap,
pub local_wblist: HashMap,
+ #[serde(default = "default_true")]
+ pub online_blacklist_open: bool,
#[serde(default = "default_false")]
pub one_click_run: bool,
pub appsearch_remake: HashMap,