feat(core): 邮箱推送功能调整,改由用户提供发信邮箱

This commit is contained in:
DLmaster
2025-02-09 21:36:33 +08:00
parent c7fbbf6f50
commit f07cd2b44a
7 changed files with 229 additions and 101 deletions

View File

@@ -59,10 +59,10 @@ import shutil
from app.core import Config, MainInfoBar, Task_manager
from app.services import Crypto
from .Widget import (
InputMessageBox,
LineEditMessageBox,
LineEditSettingCard,
SpinBoxSettingCard,
SetMessageBox,
ComboBoxMessageBox,
)
@@ -123,16 +123,15 @@ class MemberManager(QWidget):
def add_setting_box(self):
"""添加一个脚本实例"""
choice = InputMessageBox(
choice = ComboBoxMessageBox(
self.window(),
"选择一个脚本类型添加相应脚本实例",
"选择脚本类型",
"选择",
["MAA"],
"选择一个脚本类型添加相应脚本实例",
["选择脚本类型"],
[["MAA"]],
)
if choice.exec() and choice.input.currentIndex() != -1:
if choice.exec() and choice.input[0].currentIndex() != -1:
if choice.input.currentText() == "MAA":
if choice.input[0].currentText() == "MAA":
index = len(self.member_manager.search_member()) + 1
@@ -295,7 +294,7 @@ class MemberManager(QWidget):
def show_password(self):
if Config.PASSWORD == "":
choice = InputMessageBox(
choice = LineEditMessageBox(
self.window(),
"请输入管理密钥",
"管理密钥",
@@ -694,7 +693,7 @@ class MaaSettingBox(QWidget):
user_list = [_[0] for _ in data if _[15] == "simple"]
set_list = ["自定义基建"]
choice = SetMessageBox(
choice = ComboBoxMessageBox(
self.window(),
"用户选项配置",
["选择要配置的用户", "选择要配置的选项"],
@@ -734,7 +733,7 @@ class MaaSettingBox(QWidget):
user_list = [_[0] for _ in data if _[15] == "beta"]
set_list = ["MAA日常配置", "MAA剿灭配置"]
choice = SetMessageBox(
choice = ComboBoxMessageBox(
self.window(),
"用户选项配置",
["选择要配置的用户", "选择要配置的选项"],
@@ -989,7 +988,7 @@ class MaaSettingBox(QWidget):
item = QTableWidgetItem("******")
item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
else:
result = Crypto.decryptx(value, Config.PASSWORD)
result = Crypto.AUTO_decryptor(value, Config.PASSWORD)
item = QTableWidgetItem(result)
if result == "管理密钥错误":
item.setFlags(
@@ -1056,7 +1055,7 @@ class MaaSettingBox(QWidget):
item = QTableWidgetItem("******")
item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
else:
result = Crypto.decryptx(value, Config.PASSWORD)
result = Crypto.AUTO_decryptor(value, Config.PASSWORD)
item = QTableWidgetItem(result)
if result == "管理密钥错误":
item.setFlags(
@@ -1127,7 +1126,7 @@ class MaaSettingBox(QWidget):
games[game_in.strip()] = game_out.strip()
text = games.get(text, text)
if item.column() == 11: # 密码
text = Crypto.encryptx(text)
text = Crypto.AUTO_encryptor(text)
# 保存至本地数据库
if text != "":
@@ -1145,7 +1144,7 @@ class MaaSettingBox(QWidget):
self.update_user_info("normal")
return None
if item.column() == 6: # 密码
text = Crypto.encryptx(text)
text = Crypto.AUTO_encryptor(text)
# 保存至本地数据库
if text != "":
@@ -1227,7 +1226,7 @@ class MaaSettingBox(QWidget):
Config.cur.execute(
"INSERT INTO adminx VALUES('新用户','手机号码(官服)/B站IDB服','Official',-1,'y','2000-01-01','1-7','-','-','n','n','n',?,'',0,?,?)",
(
Crypto.encryptx("未设置"),
Crypto.AUTO_encryptor("未设置"),
set_book[0],
set_book[1],
),