mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-10-08 00:14:26 +08:00
重写Auth2.0登录逻辑 (#851)
* go mod update * feat: change to new wxwork sso login * fix: can't log in by workwx browser * fix: workwx auto regist * fix: change app.conf.example * fix: workwx account can't be disabled * fix: workwx account delete * fix: workwx bind error * feat: optimize wecom login * feat: rewrite dingtalk login * feat: rewrite dingtalk login * feat: optimize auth2 login
This commit is contained in:
@@ -232,15 +232,6 @@ dingtalk_app_key="${MINDOC_DINGTALK_APPKEY}"
|
||||
# 钉钉AppSecret
|
||||
dingtalk_app_secret="${MINDOC_DINGTALK_APPSECRET}"
|
||||
|
||||
# 钉钉登录默认只读账号
|
||||
dingtalk_tmp_reader="${MINDOC_DINGTALK_READER}"
|
||||
|
||||
# 钉钉扫码登录Key
|
||||
dingtalk_qr_key="${MINDOC_DINGTALK_QRKEY}"
|
||||
|
||||
# 钉钉扫码登录Secret
|
||||
dingtalk_qr_secret="${MINDOC_DINGTALK_QRSECRET}"
|
||||
|
||||
########企业微信登录配置##############
|
||||
|
||||
# 企业ID
|
||||
@@ -252,8 +243,5 @@ workweixin_agentid="${MINDOC_WORKWEIXIN_AGENTID}"
|
||||
# 应用密钥
|
||||
workweixin_secret="${MINDOC_WORKWEIXIN_SECRET}"
|
||||
|
||||
# 通讯录密钥
|
||||
workweixin_contact_secret="${MINDOC_WORKWEIXIN_CONTACT_SECRET}"
|
||||
|
||||
# i18n config
|
||||
default_lang="zh-cn"
|
||||
|
@@ -22,7 +22,9 @@ captcha = Captcha
|
||||
keep_login = Stay signed in
|
||||
forgot_password = Forgot password?
|
||||
register = Create New Account
|
||||
dingtalk_login = DingTalk QrCode login
|
||||
third_party_login = Third Party Login
|
||||
dingtalk_login = DingTalk Login
|
||||
wecom_login = WeCom Login
|
||||
account_recovery = Account recovery
|
||||
new_password = New password
|
||||
confirm_password = Confirm password
|
||||
|
@@ -22,7 +22,9 @@ captcha = 验证码
|
||||
keep_login = 保持登录
|
||||
forgot_password = 忘记密码?
|
||||
register = 立即注册
|
||||
dingtalk_login = 扫码登录
|
||||
third_party_login = 第三方登录
|
||||
dingtalk_login = 钉钉登录
|
||||
wecom_login = 企业微信登录
|
||||
account_recovery = 找回密码
|
||||
new_password = 新密码
|
||||
confirm_password = 确认密码
|
||||
|
@@ -1,27 +1,27 @@
|
||||
package conf
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
)
|
||||
|
||||
type WorkWeixinConf struct {
|
||||
CorpId string // 企业ID
|
||||
AgentId string // 应用ID
|
||||
Secret string // 应用密钥
|
||||
ContactSecret string // 通讯录密钥
|
||||
CorpId string // 企业ID
|
||||
AgentId string // 应用ID
|
||||
Secret string // 应用密钥
|
||||
// ContactSecret string // 通讯录密钥
|
||||
}
|
||||
|
||||
func GetWorkWeixinConfig() *WorkWeixinConf {
|
||||
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")
|
||||
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")
|
||||
|
||||
c := &WorkWeixinConf{
|
||||
CorpId: corpid,
|
||||
AgentId: agentid,
|
||||
Secret: secret,
|
||||
ContactSecret: contact_secret,
|
||||
}
|
||||
return c
|
||||
c := &WorkWeixinConf{
|
||||
CorpId: corpid,
|
||||
AgentId: agentid,
|
||||
Secret: secret,
|
||||
// ContactSecret: contact_secret,
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
Reference in New Issue
Block a user