diff --git a/control.go b/control.go index a6d1003..18dc93b 100644 --- a/control.go +++ b/control.go @@ -19,7 +19,7 @@ func BindUser(m *tb.Message, cid, cse string) string { fmt.Println("alias: " + tmp[1]) alias := tmp[1] code := GetURLValue(tmp[0], "code") - fmt.Println(code) + //fmt.Println(code) access, refresh := MSFirGetToken(code, cid, cse) if refresh == "" { fmt.Printf("%d Bind error:GetRefreshToken\n", m.Chat.ID) @@ -29,7 +29,7 @@ func BindUser(m *tb.Message, cid, cse string) string { //token has gotten bot.Send(m.Chat, "Token获取成功!") info := MSGetUserInfo(access) - fmt.Printf("TGID:%d Refresh Token: %s\n", m.Chat.ID, refresh) + //fmt.Printf("TGID:%d Refresh Token: %s\n", m.Chat.ID, refresh) if info == "" { fmt.Printf("%d Bind error:Getinfo\n", m.Chat.ID) return "获取用户信息错误" @@ -46,7 +46,6 @@ func BindUser(m *tb.Message, cid, cse string) string { u.clientId = cid u.clientSecret = cse u.other = "" - //u.other = SetJsonValue(u.other, "sign", Get16MD5Encode(u.msId)) //MS User Is Exist if MSAppIsExist(u.tgId, u.clientId) { fmt.Printf("%d Bind error:MSUserHasExisted\n", m.Chat.ID) diff --git a/handle.go b/handle.go index aa0a4fd..28b888c 100644 --- a/handle.go +++ b/handle.go @@ -56,7 +56,6 @@ func bMy(m *tb.Message) { data := QueryDataByTG(db, m.Chat.ID) var inlineKeys [][]tb.InlineButton for _, u := range data { - fmt.Println(u) inlineBtn := tb.InlineButton{ Unique: "my" + u.msId, Text: u.alias, diff --git a/main.go b/main.go index c7c30fc..b1c2039 100644 --- a/main.go +++ b/main.go @@ -95,7 +95,6 @@ func MakeHandle() { bot.Handle("/notice", bNotice) bot.Handle("/help", bHelp) bot.Handle(tb.OnText, bOnText) - //bot.Handle(tb.InlineButton{Unique: ""}) } func TaskLaunch() { fmt.Println("Begin First SignTask……") diff --git a/outlook.go b/outlook.go index dab0e26..7cb78ce 100644 --- a/outlook.go +++ b/outlook.go @@ -96,7 +96,6 @@ func MSGetToken(refreshtoken, cid, cse string) (access string) { //Get User's Information func MSGetUserInfo(accesstoken string) (json string) { client := http.Client{} - //r.Header.Set("Host","graph.microsoft.com") req, err := http.NewRequest("GET", MsGraUrl+"/v1.0/me", nil) if err != nil { fmt.Println("MSGetUserInfo ERROR ") @@ -107,7 +106,7 @@ func MSGetUserInfo(accesstoken string) (json string) { defer resp.Body.Close() content, _ := ioutil.ReadAll(resp.Body) if gjson.Get(string(content), "id").String() != "" { - fmt.Println("UserName: " + gjson.Get(string(content), "displayName").String()) + //fmt.Println("UserName: " + gjson.Get(string(content), "displayName").String()) return string(content) } return "" @@ -115,7 +114,6 @@ func MSGetUserInfo(accesstoken string) (json string) { func OutLookGetMails(accesstoken string) bool { client := http.Client{} - //r.Header.Set("Host","graph.microsoft.com") req, err := http.NewRequest("GET", MsGraUrl+"/v1.0/me/messages", nil) if err != nil { fmt.Println("MSGetMils ERROR ")