mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-04 11:50:15 +01:00
♻️ 重构内核代理设置 Fix https://github.com/siyuan-note/siyuan/issues/5380
This commit is contained in:
parent
2880222bc6
commit
70b8a7d8eb
16 changed files with 89 additions and 93 deletions
|
|
@ -38,7 +38,7 @@ func StartFreeTrial() (err error) {
|
|||
}
|
||||
|
||||
requestResult := gulu.Ret.NewResult()
|
||||
request := httpclient.NewCloudRequest(Conf.System.NetworkProxy.String())
|
||||
request := httpclient.NewCloudRequest()
|
||||
_, err = request.
|
||||
SetResult(requestResult).
|
||||
SetCookies(&http.Cookie{Name: "symphony", Value: Conf.User.UserToken}).
|
||||
|
|
@ -55,7 +55,7 @@ func StartFreeTrial() (err error) {
|
|||
|
||||
func DeactivateUser() (err error) {
|
||||
requestResult := gulu.Ret.NewResult()
|
||||
request := httpclient.NewCloudRequest(Conf.System.NetworkProxy.String())
|
||||
request := httpclient.NewCloudRequest()
|
||||
resp, err := request.
|
||||
SetResult(requestResult).
|
||||
SetCookies(&http.Cookie{Name: "symphony", Value: Conf.User.UserToken}).
|
||||
|
|
@ -80,7 +80,7 @@ func DeactivateUser() (err error) {
|
|||
func SetCloudBlockReminder(id, data string, timed int64) (err error) {
|
||||
requestResult := gulu.Ret.NewResult()
|
||||
payload := map[string]interface{}{"dataId": id, "data": data, "timed": timed}
|
||||
request := httpclient.NewCloudRequest(Conf.System.NetworkProxy.String())
|
||||
request := httpclient.NewCloudRequest()
|
||||
resp, err := request.
|
||||
SetResult(requestResult).
|
||||
SetBody(payload).
|
||||
|
|
@ -113,7 +113,7 @@ func LoadUploadToken() (err error) {
|
|||
}
|
||||
|
||||
requestResult := gulu.Ret.NewResult()
|
||||
request := httpclient.NewCloudRequest(Conf.System.NetworkProxy.String())
|
||||
request := httpclient.NewCloudRequest()
|
||||
resp, err := request.
|
||||
SetResult(requestResult).
|
||||
SetCookies(&http.Cookie{Name: "symphony", Value: Conf.User.UserToken}).
|
||||
|
|
@ -252,7 +252,7 @@ func loadUserFromConf() *conf.User {
|
|||
|
||||
func RemoveCloudShorthands(ids []string) (err error) {
|
||||
result := map[string]interface{}{}
|
||||
request := httpclient.NewCloudRequest(Conf.System.NetworkProxy.String())
|
||||
request := httpclient.NewCloudRequest()
|
||||
body := map[string]interface{}{
|
||||
"ids": ids,
|
||||
}
|
||||
|
|
@ -283,7 +283,7 @@ func RemoveCloudShorthands(ids []string) (err error) {
|
|||
|
||||
func GetCloudShorthands(page int) (result map[string]interface{}, err error) {
|
||||
result = map[string]interface{}{}
|
||||
request := httpclient.NewCloudRequest(Conf.System.NetworkProxy.String())
|
||||
request := httpclient.NewCloudRequest()
|
||||
resp, err := request.
|
||||
SetResult(&result).
|
||||
SetCookies(&http.Cookie{Name: "symphony", Value: Conf.User.UserToken}).
|
||||
|
|
@ -320,7 +320,7 @@ var errInvalidUser = errors.New("invalid user")
|
|||
|
||||
func getUser(token string) (*conf.User, error) {
|
||||
result := map[string]interface{}{}
|
||||
request := httpclient.NewCloudRequest(Conf.System.NetworkProxy.String())
|
||||
request := httpclient.NewCloudRequest()
|
||||
_, err := request.
|
||||
SetResult(&result).
|
||||
SetBody(map[string]string{"token": token}).
|
||||
|
|
@ -351,7 +351,7 @@ func getUser(token string) (*conf.User, error) {
|
|||
|
||||
func UseActivationcode(code string) (err error) {
|
||||
requestResult := gulu.Ret.NewResult()
|
||||
request := httpclient.NewCloudRequest(Conf.System.NetworkProxy.String())
|
||||
request := httpclient.NewCloudRequest()
|
||||
_, err = request.
|
||||
SetResult(requestResult).
|
||||
SetBody(map[string]string{"data": code}).
|
||||
|
|
@ -370,7 +370,7 @@ func UseActivationcode(code string) (err error) {
|
|||
func CheckActivationcode(code string) (retCode int, msg string) {
|
||||
retCode = 1
|
||||
requestResult := gulu.Ret.NewResult()
|
||||
request := httpclient.NewCloudRequest(Conf.System.NetworkProxy.String())
|
||||
request := httpclient.NewCloudRequest()
|
||||
_, err := request.
|
||||
SetResult(requestResult).
|
||||
SetBody(map[string]string{"data": code}).
|
||||
|
|
@ -390,7 +390,7 @@ func CheckActivationcode(code string) (retCode int, msg string) {
|
|||
|
||||
func Login(userName, password, captcha string) (ret *gulu.Result, err error) {
|
||||
result := map[string]interface{}{}
|
||||
request := httpclient.NewCloudRequest(Conf.System.NetworkProxy.String())
|
||||
request := httpclient.NewCloudRequest()
|
||||
_, err = request.
|
||||
SetResult(&result).
|
||||
SetBody(map[string]string{"userName": userName, "userPassword": password, "captcha": captcha}).
|
||||
|
|
@ -416,7 +416,7 @@ func Login(userName, password, captcha string) (ret *gulu.Result, err error) {
|
|||
|
||||
func Login2fa(token, code string) (map[string]interface{}, error) {
|
||||
result := map[string]interface{}{}
|
||||
request := httpclient.NewCloudRequest(Conf.System.NetworkProxy.String())
|
||||
request := httpclient.NewCloudRequest()
|
||||
_, err := request.
|
||||
SetResult(&result).
|
||||
SetBody(map[string]string{"twofactorAuthCode": code}).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue