73 lines
2.5 KiB
Python
73 lines
2.5 KiB
Python
import os
|
|
import datetime
|
|
import secrets
|
|
import string
|
|
|
|
|
|
def JoinPath(*args: str):
|
|
if not args:
|
|
return ""
|
|
Result = args[0].rstrip('/').rstrip('\\')
|
|
for Path in args[1:]:
|
|
CleanedPath = Path.lstrip('/').lstrip('\\').rstrip('/').rstrip('\\')
|
|
if CleanedPath:
|
|
Result += '/' + CleanedPath
|
|
return os.path.abspath(Result)
|
|
|
|
|
|
def Gender2Str(c):
|
|
if c == -1:
|
|
return "未更改"
|
|
elif c == 1:
|
|
return "男"
|
|
elif c == 0:
|
|
return "女"
|
|
else:
|
|
return "错误"
|
|
|
|
|
|
def RandomAccountActivationNumber():
|
|
first = secrets.choice('123456789')
|
|
rest = ''.join(secrets.choice(string.digits) for _ in range(11))
|
|
return first + rest
|
|
|
|
|
|
def PreSVE(SVEID: str):
|
|
SVEID = str(SVEID).replace("SVE-", "").replace("-", "")
|
|
if not len(SVEID) == 9:
|
|
return False
|
|
for i in SVEID:
|
|
if i not in "0123456789":
|
|
return False
|
|
SVEID = "0" + SVEID
|
|
return SVEID
|
|
|
|
|
|
def PreSQLSVE(SVEID: str):
|
|
return SVEID[1:]
|
|
|
|
|
|
BadH = ["*", "git", "www", "mail", "mc", "manage", "ugm", "aks", "cc", "doc", "email", "project", "pro", "share",
|
|
"alist", "wx", "qq", "t4", "static",
|
|
"invite", "github", "config", "chat", "ccgo", "cap", "ss", "pop3", "smtp", "iamp", "api", "apis",
|
|
"nanjingmassacre", "msoc", "cdn", "ycbz", "yc8z", "omc",
|
|
"node1", "node2", "node3", "node4", "history", "his", "maozedong", "maozhuxi", "114", "termanage",
|
|
"manager", "system", "pay", "file", "files", "weixin",
|
|
"3crb", "3c", "shop", "org", "dev", "studio", "python", "java", "jdk", "nginx", "tailwind", "tailwindcss"]
|
|
|
|
Timezone_UTFA8 = datetime.timezone(datetime.timedelta(hours=8))
|
|
|
|
StoreValueRule = {
|
|
"1": {"Name": "活期利零五", "InterestRate": 5, "MinDay": -1, "MinGC": -1, "MaxGC": -1, "ExpirationGameDate": 72},
|
|
"2": {"Name": "定六利一二", "InterestRate": 12, "MinDay": 6 * 30, "MinGC": -1, "MaxGC": -1,
|
|
"ExpirationGameDate": 30 * 6},
|
|
"3": {"Name": "定年上十万利一五", "InterestRate": 15, "MinDay": 360, "MinGC": -1, "MaxGC": 100000,
|
|
"ExpirationGameDate": 360},
|
|
"4": {"Name": "定年下万利二", "InterestRate": 20, "MinDay": 360, "MinGC": 10000, "MaxGC": -1,
|
|
"ExpirationGameDate": 360},
|
|
"5": {"Name": "定年下百万利二五", "InterestRate": 25, "MinDay": 360, "MinGC": 1000000, "MaxGC": -1,
|
|
"ExpirationGameDate": 360},
|
|
"6": {"Name": "定年下千万利三", "InterestRate": 30, "MinDay": 360, "MinGC": 10000000, "MaxGC": -1,
|
|
"ExpirationGameDate": 360},
|
|
}
|