From 412120689c6e8315a1c08817a0caa2e12985359a Mon Sep 17 00:00:00 2001 From: johlanse Date: Fri, 12 Nov 2021 16:38:26 +0800 Subject: [PATCH] init code --- config/user.json | 1 - lib/core.go | 31 +++++++++++++++---------------- 2 files changed, 15 insertions(+), 17 deletions(-) delete mode 100644 config/user.json diff --git a/config/user.json b/config/user.json deleted file mode 100644 index ae74fe4..0000000 --- a/config/user.json +++ /dev/null @@ -1 +0,0 @@ -[{"cookies":[{"name":"_uab_collina","value":"163662103329486079242507","domain":"pc.xuexi.cn","path":"/points","expires":1951981033,"httpOnly":false,"secure":false,"same_site":"None"},{"name":"__UID__","value":"5cdc19a0-42cd-11ec-b6bc-e3c5195d165e","domain":".xuexi.cn","path":"/","expires":1668157033,"httpOnly":false,"secure":false,"same_site":"None"},{"name":"tmzw","value":"1636621034119","domain":".xuexi.cn","path":"/","expires":1636707434,"httpOnly":false,"secure":false,"same_site":"None"},{"name":"zwfigprt","value":"297bce38be89bc8a076e6e29b6282c1c","domain":".xuexi.cn","path":"/","expires":1636707434,"httpOnly":false,"secure":false,"same_site":"None"},{"name":"aliyungf_tc","value":"003c420ac17482ba6ad5550439dfb427add3b6076673bc476f0beeb76d7abdf6","domain":"pc-api.xuexi.cn","path":"/","expires":-1,"httpOnly":true,"secure":false,"same_site":"None"},{"name":"acw_tc","value":"2f6fc10416366210318943764e7c9b024dcd55ba787fb0c5064287171f5d3d","domain":"pc-api.xuexi.cn","path":"/","expires":1636622834,"httpOnly":true,"secure":false,"same_site":"None"},{"name":"aliyungf_tc","value":"171ba83785f1d8fb9d76af9bbb376840828ef4710300b5854145bf5e7fec3c1f","domain":"login.xuexi.cn","path":"/","expires":-1,"httpOnly":true,"secure":false,"same_site":"None"},{"name":"acw_tc","value":"2f6fc10416366210325768127e7c9adce9f228d7e2f62ece3cd09618ee90d6","domain":"login.xuexi.cn","path":"/","expires":1636622835,"httpOnly":true,"secure":false,"same_site":"None"},{"name":"_bl_uid","value":"nhkb8v0kuyzpFzw6Xptyftdj3b03","domain":"login.xuexi.cn","path":"/","expires":1652173035,"httpOnly":false,"secure":false,"same_site":"None"},{"name":"_bl_uid","value":"bhkFmvUOuw7p1swt3pe4kCdf22g3","domain":"www.xuexi.cn","path":"/","expires":1652173036,"httpOnly":false,"secure":false,"same_site":"None"},{"name":"_bl_uid","value":"94k6yvb2u6apejwFCpekkm5u6e79","domain":"pc.xuexi.cn","path":"/","expires":1652173036,"httpOnly":false,"secure":false,"same_site":"None"},{"name":"token","value":"143ed9a00afe4c1fbcf1eae8acfdeca3","domain":".xuexi.cn","path":"/","expires":1636642691,"httpOnly":false,"secure":false,"same_site":"None"}],"nick":"苟江山","uid":"151142372517"}] \ No newline at end of file diff --git a/lib/core.go b/lib/core.go index 4b0bd19..4a2148b 100644 --- a/lib/core.go +++ b/lib/core.go @@ -8,7 +8,6 @@ import ( "strings" qrcodeTerminal "github.com/Baozisoftware/qrcode-terminal-go" - "github.com/guonaihong/gout" "github.com/mxschmitt/playwright-go" log "github.com/sirupsen/logrus" "github.com/tuotoo/qrcode" @@ -150,7 +149,7 @@ func (c *Core) Login() ([]cookie, error) { return nil, err } img = strings.ReplaceAll(img, "data:image/png;base64,", "") - go sendToQQ(img) + //go sendToQQ(img) data, err := base64.StdEncoding.DecodeString(img) if err != nil { return nil, err @@ -211,17 +210,17 @@ func (c *Core) Login() ([]cookie, error) { return cos, err } -func sendToQQ(img string) { - err := gout.POST("http://127.0.0.1:5700/send_private_msg").SetJSON(map[string]interface{}{ - "user_id": 3343780376, - "message": map[string]interface{}{ - "type": "image", - "data": map[string]interface{}{ - "file": "base64://" + img, - }, - }, - }).Do() - if err != nil { - return - } -} +//func sendToQQ(img string) { +// err := gout.POST("http://127.0.0.1:5700/send_private_msg").SetJSON(map[string]interface{}{ +// "user_id": int64(3343780376), +// "message": map[string]interface{}{ +// "type": "image", +// "data": map[string]interface{}{ +// "file": "base64://" + img, +// }, +// }, +// }).Do() +// if err != nil { +// return +// } +//}