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