feat: 初步完成GUI界面添加
Some checks failed
构建上传工具 / build-tool (push) Failing after 2m9s

This commit is contained in:
2025-10-13 21:32:02 +08:00
parent 3b6705d6ef
commit cccb31cbc5
10 changed files with 607 additions and 74 deletions

View File

@@ -1,20 +1,19 @@
package api
import (
"dypid-client/config"
"io"
"net/http"
"net/url"
"strings"
"github.com/spf13/viper"
)
func uploadDataToServer(httpClient *http.Client, data string) error {
func UploadDataToServer(httpClient *http.Client, data string) error {
params := url.Values{}
params.Set("token", viper.GetString("token"))
params.Set("token", config.APPConfig.Token)
params.Set("data", data)
resp, err := httpClient.Post(viper.GetString("url")+"/api/data?"+params.Encode(), "application/x-www-form-urlencoded", strings.NewReader(""))
resp, err := httpClient.Post(config.APPConfig.Url+"/api/data?"+params.Encode(), "application/x-www-form-urlencoded", strings.NewReader(""))
if err != nil {
return err
}