2022-05-07 18:06:46 +08:00
|
|
|
package conf
|
|
|
|
|
|
|
|
import (
|
2023-04-20 13:24:28 +08:00
|
|
|
"github.com/beego/beego/v2/server/web"
|
2022-05-07 18:06:46 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
type WorkWeixinConf struct {
|
2023-04-20 13:24:28 +08:00
|
|
|
CorpId string // 企业ID
|
|
|
|
AgentId string // 应用ID
|
|
|
|
Secret string // 应用密钥
|
|
|
|
// ContactSecret string // 通讯录密钥
|
2022-05-07 18:06:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func GetWorkWeixinConfig() *WorkWeixinConf {
|
2023-04-20 13:24:28 +08:00
|
|
|
corpid, _ := web.AppConfig.String("workweixin_corpid")
|
|
|
|
agentid, _ := web.AppConfig.String("workweixin_agentid")
|
|
|
|
secret, _ := web.AppConfig.String("workweixin_secret")
|
|
|
|
// contact_secret, _ := web.AppConfig.String("workweixin_contact_secret")
|
2022-05-07 18:06:46 +08:00
|
|
|
|
2023-04-20 13:24:28 +08:00
|
|
|
c := &WorkWeixinConf{
|
|
|
|
CorpId: corpid,
|
|
|
|
AgentId: agentid,
|
|
|
|
Secret: secret,
|
|
|
|
// ContactSecret: contact_secret,
|
|
|
|
}
|
|
|
|
return c
|
2022-05-07 18:06:46 +08:00
|
|
|
}
|