chore: 生成 tool 改为生成 client

This commit is contained in:
Mmx233
2022-10-30 14:32:26 +08:00
parent a7a2ee173e
commit 73e6bfe9de
4 changed files with 36 additions and 19 deletions

View File

@@ -31,10 +31,11 @@ type Conf struct {
//登录参数,不可缺省
LoginInfo LoginInfo
Client *http.Client
Header http.Header
api srun.Api
}
func (a *Conf) initApi() {
a.api.Init(a.Https, a.LoginInfo.Form.Domain, a.Client)
a.api.Init(a.Https, a.LoginInfo.Form.Domain, a.Client, a.Header)
}

View File

@@ -18,7 +18,7 @@ type Api struct {
Header http.Header
}
func (a *Api) Init(https bool, domain string, client *http.Client) {
func (a *Api) Init(https bool, domain string, client *http.Client, header http.Header) {
if a.inited {
return
}