修复微信端登录的bug
This commit is contained in:
parent
679a443efe
commit
f15d0e4ded
|
@ -176,7 +176,7 @@ func (c *Core) RespondDaily(user *model.User, model string) {
|
|||
if err != nil {
|
||||
return
|
||||
}
|
||||
//id = 81
|
||||
//id = 71
|
||||
// 跳转到专项答题界面
|
||||
_, err = page.Goto(fmt.Sprintf("https://pc.xuexi.cn/points/exam-paper-detail.html?id=%d", id), playwright.PageGotoOptions{
|
||||
Referer: playwright.String(MyPointsUri),
|
||||
|
|
|
@ -251,12 +251,11 @@ func HandleWechat(rep http.ResponseWriter, req *http.Request) {
|
|||
//
|
||||
func handleLogin(id string) {
|
||||
core := &lib.Core{Push: func(id1 string, kind, message string) {
|
||||
if kind == "flush" && strings.HasPrefix(message, "登录链接") {
|
||||
l := strings.ReplaceAll(message, "登录链接:\r\n", "")
|
||||
if kind == "flush" && strings.Contains(message, "login.xuexi.cn") {
|
||||
_, err := wx.SendTemplateMessage(&mp.TemplateMessage{
|
||||
ToUser: id,
|
||||
TemplateId: conf.GetConfig().Wechat.LoginTempID,
|
||||
URL: l,
|
||||
URL: message,
|
||||
TopColor: "",
|
||||
RawJSONData: nil,
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue