删除无用输出

This commit is contained in:
iyear 2020-03-31 09:14:27 +08:00
parent cc38a99542
commit a020b0a1ae
4 changed files with 3 additions and 8 deletions

View File

@ -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)

View File

@ -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,

View File

@ -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……")

View File

@ -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 ")