Refactor WeChat integration to support multiple mini programs, removing hardcoded WeChat credentials and updating user model and authentication flow accordingly.

This commit is contained in:
nepiedg
2025-12-29 11:25:35 +00:00
parent 9b47421b45
commit 589223ebd3
10 changed files with 224 additions and 79 deletions
-10
View File
@@ -10,7 +10,6 @@ import (
type Config struct {
Server ServerConfig
Database DatabaseConfig
WeChat WeChatConfig
JWT JWTConfig
}
@@ -27,11 +26,6 @@ type DatabaseConfig struct {
DBName string
}
type WeChatConfig struct {
AppID string
AppSecret string
}
type JWTConfig struct {
Secret string
Expire int
@@ -57,10 +51,6 @@ func LoadConfig() {
Password: getEnv("DB_PASSWORD", ""),
DBName: getEnv("DB_NAME", "wx_service"),
},
WeChat: WeChatConfig{
AppID: getEnv("WECHAT_APP_ID", ""),
AppSecret: getEnv("WECHAT_APP_SECRET", ""),
},
JWT: JWTConfig{
Secret: getEnv("JWT_SECRET", "your-secret-key"),
Expire: 86400, // 24小时