Skip to content

Commit

Permalink
优化缓存key规则
Browse files Browse the repository at this point in the history
  • Loading branch information
royalmorty committed Jan 11, 2022
1 parent 999adeb commit 67235a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion auth.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package weapp

import (
"fmt"

"github.com/medivhzhan/weapp/v3/request"
)

Expand Down Expand Up @@ -60,7 +62,7 @@ type TokenResponse struct {

// access_token 缓存 KEY
func (cli *Client) tokenCacheKey() string {
return "weapp.access.token"
return fmt.Sprintf("weapp.%s.access.token", cli.appid)
}

func (cli *Client) GetAccessToken() (*TokenResponse, error) {
Expand Down

0 comments on commit 67235a8

Please sign in to comment.