workweixin.go 653 B

123456789101112131415161718192021222324252627
  1. package conf
  2. import (
  3. "github.com/beego/beego/v2/server/web"
  4. )
  5. type WorkWeixinConf struct {
  6. CorpId string // 企业ID
  7. AgentId string // 应用ID
  8. Secret string // 应用密钥
  9. // ContactSecret string // 通讯录密钥
  10. }
  11. func GetWorkWeixinConfig() *WorkWeixinConf {
  12. corpid, _ := web.AppConfig.String("workweixin_corpid")
  13. agentid, _ := web.AppConfig.String("workweixin_agentid")
  14. secret, _ := web.AppConfig.String("workweixin_secret")
  15. // contact_secret, _ := web.AppConfig.String("workweixin_contact_secret")
  16. c := &WorkWeixinConf{
  17. CorpId: corpid,
  18. AgentId: agentid,
  19. Secret: secret,
  20. // ContactSecret: contact_secret,
  21. }
  22. return c
  23. }