Skip to content

Commit

Permalink
删除无用输出
Browse files Browse the repository at this point in the history
  • Loading branch information
iyear committed Mar 31, 2020
1 parent cc38a99 commit a020b0a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
5 changes: 2 additions & 3 deletions control.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 "获取用户信息错误"
Expand All @@ -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)
Expand Down
1 change: 0 additions & 1 deletion handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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……")
Expand Down
4 changes: 1 addition & 3 deletions outlook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ")
Expand All @@ -107,15 +106,14 @@ 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 ""
}

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 ")
Expand Down

0 comments on commit a020b0a

Please sign in to comment.