Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
aurorax-neo authored Jun 26, 2024
2 parents 922ee60 + c6baefa commit 1f8ecf7
Show file tree
Hide file tree
Showing 10 changed files with 197 additions and 439 deletions.
2 changes: 1 addition & 1 deletion AccessTokenPool/AccessTokenPool.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var (
once sync.Once
)

const AccAuthAuthorizationPre = "ac"
const AccAuthAuthorizationPre = "Bearer ac"

type AccessTokenPool struct {
AccessTokens []*AccessToken
Expand Down
52 changes: 25 additions & 27 deletions FreeChat/FreeChat.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,37 +57,42 @@ type turnstile struct {
Required bool `json:"required"`
}

func GetFreeChat(token string, retry int) *FreeChat {
func GetFreeChat(token string, retry int) (*FreeChat, error) {
// 判断是否为指定账号
if strings.HasPrefix(token, "Bearer eyJhbGciOiJSUzI1NiI") {
freeChat := newFreeChat(token)
auth := common.GetStrPreOrSuf(token, "#", 1)
if !common.IsStrInArray(auth, config.AtAuthorizations) {
return nil, fmt.Errorf("unauthorized, please add authkey in access_tokens (example: access_tokens#authkey)")
}
at := common.GetStrPreOrSuf(token, "#", -1)
freeChat, err := newFreeChat(at)
if freeChat == nil && retry > 0 {
return GetFreeChat(token, retry-1)
}
return freeChat
return freeChat, err
}
// 判断是否使用 AccessTokenPool
if strings.HasPrefix(token, "Bearer "+AccessTokenPool.AccAuthAuthorizationPre) && !AccessTokenPool.GetAccAuthPoolInstance().IsEmpty() {
token_ := AccessTokenPool.GetAccAuthPoolInstance().GetToken()
if token_ == "" {
return nil
if strings.HasPrefix(token, AccessTokenPool.AccAuthAuthorizationPre) && !AccessTokenPool.GetAccAuthPoolInstance().IsEmpty() {
at := AccessTokenPool.GetAccAuthPoolInstance().GetToken()
if at == "" {
return nil, fmt.Errorf("AccessTokenPool is Empty")
}
freeChat := newFreeChat(token_)
freeChat, err := newFreeChat(at)
if freeChat == nil && retry > 0 {
return GetFreeChat(token, retry-1)
}
return freeChat
return freeChat, err
}
// 返回免登 FreeChat 实例
freeChat := newFreeChat(token)
freeChat, err := newFreeChat(token)
if freeChat == nil && retry > 0 {
return GetFreeChat(token, retry-1)
}
return freeChat
return freeChat, err
}

// newFreeChat 创建 FreeChat 实例
func newFreeChat(token string) *FreeChat {
func newFreeChat(token string) (*FreeChat, error) {
// 创建 FreeChat 实例
freeChat := &FreeChat{
FreeAuth: &freeAuth{},
Expand All @@ -103,36 +108,33 @@ func newFreeChat(token string) *FreeChat {
err := freeChat.newRequestClient()
if err != nil {
logger.Debug(err.Error())
return nil
return nil, err
}
// 获取并设置代理
err = freeChat.getProxy()
if err != nil {
logger.Debug(err.Error())
return nil
return nil, err
}
// 获取cookies
if common.IsStrInArray(BaseUrl, OfficialBaseURLS) {
err = freeChat.getCookies()
if err != nil {
logger.Debug(err.Error())
return nil
return nil, err
}
}
// 获取 FreeAuth
err = freeChat.newFreeAuth()
if err != nil {
logger.Debug(err.Error())
return nil
return nil, err
}
return freeChat
return freeChat, nil
}

func (f *FreeChat) GetHC(url string) (tls_client_httpi.Headers, tls_client_httpi.Cookies) {
headers := tls_client_httpi.Headers{}
if f.AccAuth != "" {
headers.Set("Token", f.AccAuth)
}
headers.Set("accept", "*/*")
headers.Set("accept-language", "zh-CN,zh;q=0.9,zh-Hans;q=0.8,en;q=0.7")
headers.Set("oai-language", "en-US")
Expand All @@ -146,11 +148,10 @@ func (f *FreeChat) GetHC(url string) (tls_client_httpi.Headers, tls_client_httpi
headers.Set("sec-fetch-site", "same-origin")
headers.Set("user-agent", f.Ua)
headers.Set("Connection", "close")
cookies := tls_client_httpi.Cookies{}
for _, cookie := range f.Cookies {
cookies.Append(cookie)
if f.AccAuth != "" {
headers.Set("Authorization", f.AccAuth)
}
return headers, cookies
return headers, f.Cookies
}

func (f *FreeChat) newRequestClient() error {
Expand Down Expand Up @@ -185,9 +186,6 @@ func (f *FreeChat) getCookies() error {
headers, cookies := f.GetHC(BaseUrl)
// 设置请求头
headers.Set("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7")
if f.AccAuth != "" {
headers.Set("Token", f.AccAuth)
}
// 发送 GET 请求 获取cookies
response, err := f.Http.Request(tls_client_httpi.GET, fmt.Sprint(BaseUrl, "/?oai-dm=1"), headers, cookies, nil)
if err != nil {
Expand Down
39 changes: 30 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,22 @@
#### 环境变量

```
LOG_LEVEL=info # debug, info, warn, error
LOG_PATH= # 日志文件路径,默认为空(不生成日志文件)
BIND=0.0.0.0 # 127.0.0.1
LOG_LEVEL=info # debug, info, warn, error
LOG_PATH= # 日志文件路径,默认为空(不生成日志文件)
BIND=0.0.0.0 # 127.0.0.1
PORT=3040
TOKENS_FILE= # 账号token文件,默认 tokens.yml
PROXY= # http://127.0.0.1:7890,http://127.0.0.1:7890 已支持多个代理(英文 "," 分隔)
AUTHORIZATIONS= # abc,bac (英文 "," 分隔)
BASE_URL= # 默认:https://chat.openai.com
TOKENS_FILE= # 账号token文件,默认 tokens.yml
PROXY= # http://127.0.0.1:7890,http://127.0.0.1:7890 已支持多个代理(英文 "," 分隔)
AUTHORIZATIONS= # abc,bac (英文 "," 分隔) 注:必须
AT_AUTHORIZATIONS= # abc,bac (英文 "," 分隔) 注:必须
BASE_URL= # 默认:https://chatgpt.com
```

###### 也可使用与程序同目录下 `.env` 文件配置上述字段

##### 若要使用TOKENS_FILE内的账号,AUTHORIZATIONS字段内必须配置`ac-`开头的AUTHORIZATION并使用ac-***调用本程序,若ACCESS_TOKENS无可用账号则返回401错误,`tokens.yml`详见`tokens.template.yml`
- ##### 若要使用TOKENS_FILE内的账号,AUTHORIZATIONS字段内必须配置`ac-`开头的AUTHORIZATION并使用ac-***调用本程序,若ACCESS_TOKENS无可用账号则返回401错误,`tokens.yml`详见`tokens.template.yml`

- ##### `AT_AUTHORIZATIONS `功能:防止使用求头access_token的API接口被刷,使用方式 `access_token#{abc}` ,{abc}替换为 `AT_AUTHORIZATIONS` 内的任意一项

## 三、部署

Expand All @@ -42,9 +45,11 @@ mkdir -p $PWD/free-gpt3.5-2api
##### 2.拉取镜像启动

```
docker run -itd --name=free-gpt3.5-2api -p 9846:3040 ghcr.io/aurorax-neo/free-gpt3.5-2api
docker run -itd --name=free-gpt3.5-2api -e AUTHORIZATIONS=abc,bac -e AT_AUTHORIZATIONS=abc,bac -p 9846:3040 ghcr.io/aurorax-neo/free-gpt3.5-2api
```

###### 注意:-e AUTHORIZATIONS=abc,bac -e AT_AUTHORIZATIONS=abc,bac 请自行修改,避免接口被刷

##### 3.更新容器

```
Expand All @@ -65,6 +70,8 @@ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtow

#### 1./v1/accTokens

`Authorization`使用 `AUTHORIZATIONS`其中任意一个

```
curl --location --request GET 'http://127.0.0.1:9846/v1/accTokens' \
--header 'Authorization: Bearer abc'
Expand Down Expand Up @@ -109,6 +116,20 @@ curl --location --request POST 'http://127.0.0.1:9846/v1/chat/completions' \
}'
```

## 五、模型映射

```
"gpt-3.5-turbo": "text-davinci-002-render-sha",
"gpt-3.5-turbo-16k": "text-davinci-002-render-sha",
"gpt-3.5-turbo-16k-0613": "text-davinci-002-render-sha",
"gpt-3.5-turbo-0301": "text-davinci-002-render-sha",
"gpt-3.5-turbo-0613": "text-davinci-002-render-sha",
"gpt-3.5-turbo-1106": "text-davinci-002-render-sha",
"gpt-4o": "gpt-4o",
"auto": "auto",
"gpt-4o-av": "gpt-4o-av",
```

## 参考项目

- https://github.com/aurora-develop/aurora
Expand Down
96 changes: 96 additions & 0 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,99 @@ func ReadFile(filePath string) ([]byte, error) {
}
return all, nil
}

// GetStrPreOrSuf 获取 指定字符串 前或后的字符串 0-原 1-前 1-后,没有返回原
func GetStrPreOrSuf(str string, sep string, t int) string {
switch t {
case 0:
return str
case -1:
index := strings.Index(str, sep)
if index != -1 {
before := str[:index]
return before
}
return str
case 1:
index := strings.Index(str, sep)
if index != -1 {
after := str[index+len(sep):]
return after
}
return str
default:
return str
}
}

func FakeUaAgent() string {
var userAgent = []string{
"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36",
"Mozilla/5.0 (Linux; Android 7.1.1; CPH1723 Build/N6F26Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.98 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 5.1; A37f Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.93 Mobile Safari/537.36",
"Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36",
"Mozilla/5.0 (Linux; Android 7.0; SM-G610M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.80 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 6.0.1; SM-G532G Build/MMB29T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.83 Mobile Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36",
"Mozilla/5.0 (Linux; Android 8.0.0; WAS-LX3 Build/HUAWEIWAS-LX3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36",
"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.237 Safari/534.10",
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36",
"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.237 Safari/534.10",
"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36",
"Mozilla/5.0 (Linux; Android 7.1.2; Redmi Note 5A Build/N2G47H; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/63.0.3239.111 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 5.1.1; A37fw Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36",
"Mozilla/5.0 (Linux; Android 5.1; A1601 Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36",
"Mozilla/5.0 (Linux; Android 8.0.0; FIG-LX3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.80 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 6.0; vivo 1610 Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.124 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 6.0.1; SM-G532G Build/MMB29T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.83 Mobile Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36",
"Mozilla/5.0 (Linux; Android 4.4.2; SM-G7102 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 7.0; SM-G570M Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 6.0.1; SM-G532M Build/MMB29T; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/55.0.2883.91 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 6.0.1; SM-J700M Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36",
"Mozilla/5.0 (X11; Datanyze; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36",
"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.237 Safari/534.10",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36",
"Mozilla/5.0 (Linux; Android 7.1.1; CPH1723 Build/N6F26Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.98 Mobile Safari/537.36",
"Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.30 (KHTML, like Gecko) Slackware/Chrome/12.0.742.100 Safari/534.30",
"Mozilla/5.0 (Windows; U; Windows NT 6.1; de-DE) AppleWebKit/534.17 (KHTML, like Gecko) Chrome/10.0.649.0 Safari/534.17",
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.63 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31",
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36",
"Mozilla/5.0 (Linux; Android 6.0.1; CPH1607 Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/63.0.3239.111 Mobile Safari/537.36",
"Mozilla/5.0 (Windows NT 6.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36",
}
rng := GetRand()
randomIndex := rng.Intn(len(userAgent) - 1)
return userAgent[randomIndex]
}
5 changes: 2 additions & 3 deletions common/tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package common

import (
"free-gpt3.5-2api/constant"
"github.com/EDDYCJY/fake-useragent"
"github.com/bogdanfinn/tls-client/profiles"
"math/rand"
"time"
Expand All @@ -12,7 +11,7 @@ const retry = 5

var (
clientProfile = getRandomClientProfile()
ua = browser.Random()
ua = FakeUaAgent()
updateThreshold = retry
)

Expand Down Expand Up @@ -44,7 +43,7 @@ func GetClientProfile() profiles.ClientProfile {

func GetUa() string {
if updateThreshold < 0 {
ua = browser.Random()
ua = FakeUaAgent()
updateThreshold = constant.ReTry
}
return ua
Expand Down
29 changes: 19 additions & 10 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ import (
)

var (
LogLevel string
LogPath string
LogFile string
Bind string
Port string
Proxy []string
TokensFile string
AUTHORIZATIONS []string
BaseUrl string
LogLevel string
LogPath string
LogFile string
Bind string
Port string
Proxy []string
TokensFile string
AUTHORIZATIONS []string
AtAuthorizations []string
BaseUrl string
)

type Tokens struct {
Expand Down Expand Up @@ -108,11 +109,19 @@ func init() {
// AUTH_TOKEN
authorizations := os.Getenv("AUTHORIZATIONS")
if authorizations == "" {
AUTHORIZATIONS = []string{}
panic("please add AUTHORIZATIONS in environment variable or .env file (example: AUTHORIZATIONS=authkey1,authkey2)")
} else {
//以,分割 AUTH_TOKEN 并且为每个AUTH_TOKEN前面加上Bearer
AUTHORIZATIONS = common.SplitAndAddPre("Bearer ", authorizations, ",")
}
// AT_AUTHORIZATIONS
atAuthorizations := os.Getenv("AT_AUTHORIZATIONS")
if atAuthorizations == "" {
panic("please add AT_AUTHORIZATIONS in environment variable or .env file (example: AT_AUTHORIZATIONS=authkey1,authkey2)")
} else {
//以,分割 AT_AUTH_TOKEN 并且为每个AT_AUTH_TOKEN前面加上Bearer
AtAuthorizations = common.SplitAndAddPre("", atAuthorizations, ",")
}
// BASE_URL
BaseUrl = os.Getenv("BASE_URL")
if BaseUrl == "" {
Expand Down
Loading

0 comments on commit 1f8ecf7

Please sign in to comment.