重新索引

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 ( import (
. "code.hoteas.com/golang/hotime" . "code.hoteas.com/golang/hotime"
. "code.hoteas.com/golang/hotime/common" . "code.hoteas.com/golang/hotime/common"
"code.hoteas.com/golang/hotime/dri/download"
"code.hoteas.com/golang/hotime/dri/tencent" "code.hoteas.com/golang/hotime/dri/tencent"
"encoding/base64" "encoding/base64"
"fmt" "fmt"
@ -216,15 +215,15 @@ var User = Ctr{
} }
} else { } else {
data["create_time"] = t data["create_time"] = t
if wechat != nil { //if wechat != nil {
data["nickname"] = wechat.GetString("nickname") // data["nickname"] = wechat.GetString("nickname")
path := time.Now().Format(this.Config.GetString("imgPath")) // path := time.Now().Format(this.Config.GetString("imgPath"))
filename := Md5(ObjToStr(t)) + ".jpg" // filename := Md5(ObjToStr(t)) + ".jpg"
down := download.Down(wechat.GetString("avatar"), this.Config.GetString("tpt")+"/"+path, filename) // down := download.Down(wechat.GetString("avatar"), this.Config.GetString("tpt")+"/"+path, filename)
if down { // if down {
data["avatar"] = path + filename // data["avatar"] = path + filename
} // }
} //}
user = data user = data
user["id"] = this.Db.Insert("user", data) user["id"] = this.Db.Insert("user", data)
if user.GetCeilInt("id") == 0 { if user.GetCeilInt("id") == 0 {

View File

@ -101,24 +101,24 @@ var Wechat = Ctr{
return return
} }
//getUserInfo //getUserInfo
userInfo, err := auth.GetUserInfo(resToken.AccessToken, resToken.OpenID) //userInfo, err := auth.GetUserInfo(resToken.AccessToken, resToken.OpenID)
if err != nil { //if err != nil {
this.Display(6, "微信个人信息无法获取") // this.Display(6, "微信个人信息无法获取")
return // return
} //}
fmt.Println(userInfo) //fmt.Println(userInfo)
//wechatInfo := ObjToMap(userInfo) //wechatInfo := ObjToMap(userInfo)
t := time.Now().Unix() t := time.Now().Unix()
wechatInfo := Map{ wechatInfo := Map{
"openid": userInfo.OpenID, "openid": resToken.OpenID,
"acttoken": resToken.AccessToken, "acttoken": resToken.AccessToken,
"retoken": resToken.RefreshToken, "retoken": resToken.RefreshToken,
"appid": this.Config.GetString("wechatAppID"), "appid": this.Config.GetString("wechatAppID"),
"unionid": userInfo.Unionid, "unionid": resToken.UnionID,
"nickname": userInfo.Nickname, //"nickname": userInfo.Nickname,
"avatar": userInfo.HeadImgURL, //"avatar": userInfo.HeadImgURL,
} }
if orgId != 0 { if orgId != 0 {
wechatInfo["org_id"] = orgId wechatInfo["org_id"] = orgId

File diff suppressed because it is too large Load Diff

Binary file not shown.