mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
♻️ 内核中的 HTTP 客户端拆分项目 https://github.com/siyuan-note/siyuan/issues/5269
This commit is contained in:
parent
25ddad5957
commit
779e4fc4ae
13 changed files with 59 additions and 150 deletions
|
|
@ -25,6 +25,7 @@ import (
|
|||
|
||||
"github.com/dustin/go-humanize"
|
||||
ants "github.com/panjf2000/ants/v2"
|
||||
"github.com/siyuan-note/httpclient"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
|
|
@ -63,7 +64,7 @@ func Widgets(proxyURL string) (widgets []*Widget) {
|
|||
bazaarIndex := getBazaarIndex(proxyURL)
|
||||
bazaarHash := result["bazaar"].(string)
|
||||
result = map[string]interface{}{}
|
||||
request := util.NewBrowserRequest(proxyURL)
|
||||
request := httpclient.NewBrowserRequest(proxyURL)
|
||||
u := util.BazaarOSSServer + "/bazaar@" + bazaarHash + "/stage/widgets.json"
|
||||
resp, err := request.SetResult(&result).Get(u)
|
||||
if nil != err {
|
||||
|
|
@ -86,7 +87,7 @@ func Widgets(proxyURL string) (widgets []*Widget) {
|
|||
|
||||
widget := &Widget{}
|
||||
innerU := util.BazaarOSSServer + "/package/" + repoURL + "/widget.json"
|
||||
innerResp, innerErr := util.NewBrowserRequest(proxyURL).SetResult(widget).Get(innerU)
|
||||
innerResp, innerErr := httpclient.NewBrowserRequest(proxyURL).SetResult(widget).Get(innerU)
|
||||
if nil != innerErr {
|
||||
util.LogErrorf("get bazaar package [%s] failed: %s", repoURL, innerErr)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue