Skip to content

Commit 494f943

Browse files
committed
polish:优化初始化流程
1 parent b0ea053 commit 494f943

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

client.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ func New(options Options) (client *Client, err error) {
5959
isCloseCache: options.IsCloseCache,
6060
}
6161

62-
if err = client.initAccessToken(); err != nil {
63-
return nil, err
62+
if options.Secret != "" {
63+
if err = client.initAccessToken(); err != nil {
64+
return nil, err
65+
}
6466
}
6567

6668
return client, nil

0 commit comments

Comments
 (0)