|
|
@@ -2,6 +2,7 @@ package authentication |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.gitea.io/gitea/modules/auth/wechat" |
|
|
|
"code.gitea.io/gitea/modules/base" |
|
|
|
"code.gitea.io/gitea/modules/context" |
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
|
"code.gitea.io/gitea/modules/redis/redis_client" |
|
|
@@ -13,6 +14,8 @@ import ( |
|
|
|
"time" |
|
|
|
) |
|
|
|
|
|
|
|
const tplBindPage base.TplName = "repo/wx_autorize" |
|
|
|
|
|
|
|
type QRCodeResponse struct { |
|
|
|
Url string |
|
|
|
Ticket string |
|
|
@@ -77,6 +80,11 @@ func UnbindWechat(ctx *context.Context) { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// GetBindPage |
|
|
|
func GetBindPage(ctx *context.Context) { |
|
|
|
ctx.HTML(200, tplBindPage) |
|
|
|
} |
|
|
|
|
|
|
|
func createQRCode4Bind(userId int64) (*QRCodeResponse, error) { |
|
|
|
sceneStr := gouuid.NewV4().String() |
|
|
|
r := wechat.GetWechatQRCode4Bind(sceneStr) |
|
|
|