Initial commit

This commit is contained in:
2026-03-13 20:43:44 +08:00
commit 17cdb7ad0d
19 changed files with 4744 additions and 0 deletions

23
config/config.go Normal file
View File

@@ -0,0 +1,23 @@
package config
import (
"os"
)
// 配置变量
var (
BaseURL = getEnv("JWTS_BASE_URL", "http://jwts.hitwh.edu.cn")
Username = getEnv("JWTS_USERNAME", "")
Password = getEnv("JWTS_PASSWORD", "")
Semester = getEnv("JWTS_SEMESTER", "2025-20262")
TWFID = getEnv("JWTS_TWFID", "")
)
// getEnv 从环境变量获取配置,提供默认值
func getEnv(key, defaultValue string) string {
value := os.Getenv(key)
if value == "" {
return defaultValue
}
return value
}