"dingtalk QR login" button auto appears when dingtalk_corpid is set

This commit is contained in:
LawyZHENG
2021-03-25 15:31:24 +08:00
parent ae780418b5
commit c768845a45
2 changed files with 5 additions and 1 deletions

View File

@@ -33,8 +33,11 @@ func (c *AccountController) referer() string {
func (c *AccountController) Prepare() {
c.BaseController.Prepare()
c.EnableXSRF = beego.AppConfig.DefaultBool("enablexsrf", true)
c.Data["xsrfdata"] = template.HTML(c.XSRFFormHTML())
c.Data["corpID"] = beego.AppConfig.String("dingtalk_corpid")
c.Data["ENABLE_QR_DINGTALK"] = (beego.AppConfig.String("dingtalk_corpid") != "")
if !c.EnableXSRF {
return
}