feat: 个人中心发布
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
|
||||
// GetMiniAccessToken 获取小程序的access_token
|
||||
func GetMiniAccessToken() string {
|
||||
ak, err := global.Redis.Get(context.Background(), "mini_access_token").Result()
|
||||
ak, err := global.Redis.Get(context.Background(), "zeeq_mini_access_token").Result()
|
||||
if errors.Is(err, redis.Nil) {
|
||||
// 从微信服务器获取
|
||||
//重新从微信服务器获取
|
||||
@@ -44,7 +44,7 @@ func GetMiniAccessToken() string {
|
||||
}
|
||||
ak = data["access_token"].(string)
|
||||
ex := data["expires_in"].(float64)
|
||||
global.Redis.Set(context.Background(), "mini_access_token", ak, time.Duration(ex)*time.Second) //秒
|
||||
global.Redis.Set(context.Background(), "zeeq_mini_access_token", ak, time.Duration(ex)*time.Second) //秒
|
||||
} else if err != nil {
|
||||
log.Fatalf("Error getting access token from Redis: %s", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user