From 37176b753f5e650c34bd12a4b200cd33153b7d5f Mon Sep 17 00:00:00 2001 From: iyear Date: Sat, 19 Jun 2021 15:06:07 +0800 Subject: [PATCH] fix getUserInfo wrong url --- config/config.go | 5 ++--- model/client.go | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/config/config.go b/config/config.go index 97e23e8..26b8ff7 100644 --- a/config/config.go +++ b/config/config.go @@ -43,12 +43,11 @@ func InitConfig() { BotToken = viper.GetString("bot_token") Cron = viper.GetString("cron") Socks5 = viper.GetString("socks5") - //if Socks5[:5] != "socks5" { - // Socks5 = "socks5://" + Socks5 - //} viper.SetDefault("errlimit", 5) viper.SetDefault("bindmax", 5) + viper.SetDefault("goroutine", 10) + viper.SetDefault("bindmax", 5) BindMaxNum = viper.GetInt("bindmax") MaxErrTimes = viper.GetInt("errlimit") diff --git a/model/client.go b/model/client.go index 7f37716..2c39db5 100644 --- a/model/client.go +++ b/model/client.go @@ -106,7 +106,7 @@ func (c *Client) GetUserInfo() (string, error) { if accessToken, err = c.getToken(); err != nil { return "", err } - err = gout.GET(msGraUrl + "/v1.0/me/messages"). + err = gout.GET(msGraUrl + "/v1.0/me"). SetHeader(gout.H{ "Authorization": accessToken, }).