Skip to content

Commit

Permalink
feat: 增加对环境变量的判断
Browse files Browse the repository at this point in the history
  • Loading branch information
chengazhen committed Jan 13, 2025
1 parent fa313d6 commit 7ce80bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ def __init__(self):
self.check_config()

def get_temp_mail(self):
logging.info(f"\033[32m临时邮箱: {self.temp_mail}\033[0m")

return self.temp_mail

def get_domain(self):
logging.info(f"\033[32m域名: {self.domain}\033[0m")
return self.domain

def check_config(self):
Expand All @@ -42,6 +41,9 @@ def check_config(self):
if not self.check_is_valid(self.domain):
raise ValueError("域名未配置,请在 .env 文件中设置 DOMAIN")

logging.info(f"\033[32m临时邮箱: {self.temp_mail}\033[0m")
logging.info(f"\033[32m域名: {self.domain}\033[0m")

def check_is_valid(self, str):
return len(str.strip()) > 0

Expand Down

0 comments on commit 7ce80bd

Please sign in to comment.