forked from golang/hotime
重新索引
This commit is contained in:
parent
7c427d8692
commit
c2a07b75a5
19
app/user.go
19
app/user.go
@ -3,7 +3,6 @@ package app
|
||||
import (
|
||||
. "code.hoteas.com/golang/hotime"
|
||||
. "code.hoteas.com/golang/hotime/common"
|
||||
"code.hoteas.com/golang/hotime/dri/download"
|
||||
"code.hoteas.com/golang/hotime/dri/tencent"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
@ -216,15 +215,15 @@ var User = Ctr{
|
||||
}
|
||||
} else {
|
||||
data["create_time"] = t
|
||||
if wechat != nil {
|
||||
data["nickname"] = wechat.GetString("nickname")
|
||||
path := time.Now().Format(this.Config.GetString("imgPath"))
|
||||
filename := Md5(ObjToStr(t)) + ".jpg"
|
||||
down := download.Down(wechat.GetString("avatar"), this.Config.GetString("tpt")+"/"+path, filename)
|
||||
if down {
|
||||
data["avatar"] = path + filename
|
||||
}
|
||||
}
|
||||
//if wechat != nil {
|
||||
// data["nickname"] = wechat.GetString("nickname")
|
||||
// path := time.Now().Format(this.Config.GetString("imgPath"))
|
||||
// filename := Md5(ObjToStr(t)) + ".jpg"
|
||||
// down := download.Down(wechat.GetString("avatar"), this.Config.GetString("tpt")+"/"+path, filename)
|
||||
// if down {
|
||||
// data["avatar"] = path + filename
|
||||
// }
|
||||
//}
|
||||
user = data
|
||||
user["id"] = this.Db.Insert("user", data)
|
||||
if user.GetCeilInt("id") == 0 {
|
||||
|
@ -101,24 +101,24 @@ var Wechat = Ctr{
|
||||
return
|
||||
}
|
||||
//getUserInfo
|
||||
userInfo, err := auth.GetUserInfo(resToken.AccessToken, resToken.OpenID)
|
||||
if err != nil {
|
||||
this.Display(6, "微信个人信息无法获取")
|
||||
return
|
||||
}
|
||||
//userInfo, err := auth.GetUserInfo(resToken.AccessToken, resToken.OpenID)
|
||||
//if err != nil {
|
||||
// this.Display(6, "微信个人信息无法获取")
|
||||
// return
|
||||
//}
|
||||
|
||||
fmt.Println(userInfo)
|
||||
//fmt.Println(userInfo)
|
||||
|
||||
//wechatInfo := ObjToMap(userInfo)
|
||||
t := time.Now().Unix()
|
||||
wechatInfo := Map{
|
||||
"openid": userInfo.OpenID,
|
||||
"openid": resToken.OpenID,
|
||||
"acttoken": resToken.AccessToken,
|
||||
"retoken": resToken.RefreshToken,
|
||||
"appid": this.Config.GetString("wechatAppID"),
|
||||
"unionid": userInfo.Unionid,
|
||||
"nickname": userInfo.Nickname,
|
||||
"avatar": userInfo.HeadImgURL,
|
||||
"unionid": resToken.UnionID,
|
||||
//"nickname": userInfo.Nickname,
|
||||
//"avatar": userInfo.HeadImgURL,
|
||||
}
|
||||
if orgId != 0 {
|
||||
wechatInfo["org_id"] = orgId
|
||||
|
File diff suppressed because it is too large
Load Diff
BIN
iedc_go.exe
BIN
iedc_go.exe
Binary file not shown.
Loading…
Reference in New Issue
Block a user