删除无用输出
This commit is contained in:
parent
cc38a99542
commit
a020b0a1ae
@ -19,7 +19,7 @@ func BindUser(m *tb.Message, cid, cse string) string {
|
|||||||
fmt.Println("alias: " + tmp[1])
|
fmt.Println("alias: " + tmp[1])
|
||||||
alias := tmp[1]
|
alias := tmp[1]
|
||||||
code := GetURLValue(tmp[0], "code")
|
code := GetURLValue(tmp[0], "code")
|
||||||
fmt.Println(code)
|
//fmt.Println(code)
|
||||||
access, refresh := MSFirGetToken(code, cid, cse)
|
access, refresh := MSFirGetToken(code, cid, cse)
|
||||||
if refresh == "" {
|
if refresh == "" {
|
||||||
fmt.Printf("%d Bind error:GetRefreshToken\n", m.Chat.ID)
|
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
|
//token has gotten
|
||||||
bot.Send(m.Chat, "Token获取成功!")
|
bot.Send(m.Chat, "Token获取成功!")
|
||||||
info := MSGetUserInfo(access)
|
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 == "" {
|
if info == "" {
|
||||||
fmt.Printf("%d Bind error:Getinfo\n", m.Chat.ID)
|
fmt.Printf("%d Bind error:Getinfo\n", m.Chat.ID)
|
||||||
return "获取用户信息错误"
|
return "获取用户信息错误"
|
||||||
@ -46,7 +46,6 @@ func BindUser(m *tb.Message, cid, cse string) string {
|
|||||||
u.clientId = cid
|
u.clientId = cid
|
||||||
u.clientSecret = cse
|
u.clientSecret = cse
|
||||||
u.other = ""
|
u.other = ""
|
||||||
//u.other = SetJsonValue(u.other, "sign", Get16MD5Encode(u.msId))
|
|
||||||
//MS User Is Exist
|
//MS User Is Exist
|
||||||
if MSAppIsExist(u.tgId, u.clientId) {
|
if MSAppIsExist(u.tgId, u.clientId) {
|
||||||
fmt.Printf("%d Bind error:MSUserHasExisted\n", m.Chat.ID)
|
fmt.Printf("%d Bind error:MSUserHasExisted\n", m.Chat.ID)
|
||||||
|
|||||||
@ -56,7 +56,6 @@ func bMy(m *tb.Message) {
|
|||||||
data := QueryDataByTG(db, m.Chat.ID)
|
data := QueryDataByTG(db, m.Chat.ID)
|
||||||
var inlineKeys [][]tb.InlineButton
|
var inlineKeys [][]tb.InlineButton
|
||||||
for _, u := range data {
|
for _, u := range data {
|
||||||
fmt.Println(u)
|
|
||||||
inlineBtn := tb.InlineButton{
|
inlineBtn := tb.InlineButton{
|
||||||
Unique: "my" + u.msId,
|
Unique: "my" + u.msId,
|
||||||
Text: u.alias,
|
Text: u.alias,
|
||||||
|
|||||||
1
main.go
1
main.go
@ -95,7 +95,6 @@ func MakeHandle() {
|
|||||||
bot.Handle("/notice", bNotice)
|
bot.Handle("/notice", bNotice)
|
||||||
bot.Handle("/help", bHelp)
|
bot.Handle("/help", bHelp)
|
||||||
bot.Handle(tb.OnText, bOnText)
|
bot.Handle(tb.OnText, bOnText)
|
||||||
//bot.Handle(tb.InlineButton{Unique: ""})
|
|
||||||
}
|
}
|
||||||
func TaskLaunch() {
|
func TaskLaunch() {
|
||||||
fmt.Println("Begin First SignTask……")
|
fmt.Println("Begin First SignTask……")
|
||||||
|
|||||||
@ -96,7 +96,6 @@ func MSGetToken(refreshtoken, cid, cse string) (access string) {
|
|||||||
//Get User's Information
|
//Get User's Information
|
||||||
func MSGetUserInfo(accesstoken string) (json string) {
|
func MSGetUserInfo(accesstoken string) (json string) {
|
||||||
client := http.Client{}
|
client := http.Client{}
|
||||||
//r.Header.Set("Host","graph.microsoft.com")
|
|
||||||
req, err := http.NewRequest("GET", MsGraUrl+"/v1.0/me", nil)
|
req, err := http.NewRequest("GET", MsGraUrl+"/v1.0/me", nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("MSGetUserInfo ERROR ")
|
fmt.Println("MSGetUserInfo ERROR ")
|
||||||
@ -107,7 +106,7 @@ func MSGetUserInfo(accesstoken string) (json string) {
|
|||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
content, _ := ioutil.ReadAll(resp.Body)
|
content, _ := ioutil.ReadAll(resp.Body)
|
||||||
if gjson.Get(string(content), "id").String() != "" {
|
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 string(content)
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
@ -115,7 +114,6 @@ func MSGetUserInfo(accesstoken string) (json string) {
|
|||||||
|
|
||||||
func OutLookGetMails(accesstoken string) bool {
|
func OutLookGetMails(accesstoken string) bool {
|
||||||
client := http.Client{}
|
client := http.Client{}
|
||||||
//r.Header.Set("Host","graph.microsoft.com")
|
|
||||||
req, err := http.NewRequest("GET", MsGraUrl+"/v1.0/me/messages", nil)
|
req, err := http.NewRequest("GET", MsGraUrl+"/v1.0/me/messages", nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("MSGetMils ERROR ")
|
fmt.Println("MSGetMils ERROR ")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user