重新索引

This commit is contained in:
hoteas 2023-03-07 17:46:47 +08:00
parent 7c427d8692
commit c2a07b75a5
4 changed files with 438 additions and 439 deletions

View File

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

View File

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

Binary file not shown.