feat: openid login

This commit is contained in:
zzw
2026-09-02 17:37:12 +08:00
parent 540f74f9b7
commit bb14f9e324
38 changed files with 1627 additions and 1091 deletions
+18
View File
@@ -0,0 +1,18 @@
package config
import (
"fmt"
"lone-services/pkg/utils"
"lone-services/pkg/wechat/auth"
)
func NewWechatClient(clientCode string) (*auth.Client, error) {
prefix := "wechat." + clientCode
appID := utils.GetConfigString(prefix + ".app_id")
secret := utils.GetConfigString(prefix + ".app_secret")
if appID == utils.StringEmpty || secret == utils.StringEmpty {
return nil, fmt.Errorf("wechat config missing for client %s", clientCode)
}
return auth.NewClient(appID, secret), nil
}