修复微信端登录的bug

This commit is contained in:
johlanse 2022-08-20 12:27:18 +08:00
parent 679a443efe
commit f15d0e4ded
2 changed files with 3 additions and 4 deletions

View File

@ -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),

View File

@ -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,
})