Tushare token 写死在代码中

This commit is contained in:
2026-07-04 14:46:38 +08:00
parent b774899655
commit 44fb305f8a
4 changed files with 7 additions and 20 deletions
+4 -5
View File
@@ -8,12 +8,11 @@ import (
"net/http"
"strconv"
"time"
"stock-user-system/internal/config"
)
const (
tushareBaseURL = "http://api.tushare.pro"
tushareToken = "76efd8465f9f2591aa42a385268e06acf6b80b7a15be2267ad2281b7"
defaultTimeout = 60 * time.Second
maxRetries = 3
retryBaseDelay = 1 * time.Second
@@ -38,10 +37,10 @@ type Client struct {
client *http.Client
}
// NewClient 从配置创建 Tushare 客户端。
func NewClient(cfg *config.Config) *Client {
// NewClient 创建 Tushare 客户端。
func NewClient() *Client {
return &Client{
token: cfg.TushareToken,
token: tushareToken,
baseURL: tushareBaseURL,
client: &http.Client{Timeout: defaultTimeout},
}