Files
DanDingNoneBot/danding_bot/plugins/danding_api/config.py
Mr.Xia d1f97eccc2 fix(danding_api): 修复配置未从环境变量读取导致API鉴权失败
Token 和 EMAIL_PASSWORD 字段缺少 Field(env=...) 声明,
导致 .env 中的 DANDING_API_TOKEN 始终无法被读取,
后端 API 返回"你没有权限这样做"。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 11:17:26 +08:00

30 lines
1.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import os
from pydantic import BaseModel, Field
class Config(BaseModel):
"""Plugin Config Here"""
HelpStr:str = """
这是一个蛋定助手的RoBot控制插件功能菜单
在线人数 : 查询当前蛋定助手在线用户数量;
添加卡密 [天|周|月] [指定卡密]: 添加一张指定天数的指定卡密;
生成卡密 [天|周|月]: 生成一张指定天数的卡密;
用户加时 [用户名] [天|周|月] : 添加指定用户时长;
绑定QQ: 为当前QQ号生成绑定验证码
查看日志: 查看当前QQ号绑定日志
"""
Token:str = Field(default="", env="DANDING_API_TOKEN")
"""对接服务器的Token"""
DDApi_Host:str = "https://api.danding.vip/DD/" # https://api.danding.vip/DD/ http://192.168.5.11:8002/DD/
"""蛋定服务器连接地址 必须指向DD路由开发环境"""
# 邮件设置
EMAIL_API: str = "https://pmail.danding.vip/api/email/send"
EMAIL_LOGIN: str = "https://pmail.danding.vip/api/login"
EMAIL_USER: str = "admin"
EMAIL_FROM: str = "admin@danding.vip"
EMAIL_PASSWORD: str = Field(default="", env="DANDING_EMAIL_PASSWORD")