From 7117e5a78eca0351a7166e7dfc8b88bef57fc51f Mon Sep 17 00:00:00 2001 From: wanglu Date: Thu, 24 Mar 2022 17:30:43 +0800 Subject: [PATCH] =?UTF-8?q?format:=20=E8=A7=84=E8=8C=83=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 2 + .gitignore | 2 + Dockerfile | 6 + handlers.go | 237 +++++++++++++++ jwt.go | 69 +++++ main.go | 383 +------------------------ nginx-dev/{proxy.conf => default.conf} | 12 +- nginx-dev/run.sh | 2 + types.go | 68 +++++ ui/package.json | 5 - ui/pnpm-lock.yaml | 74 ----- ui/website/package.json | 93 +++--- ui/website/pnpm-lock.yaml | 162 +++++++---- ui/website/src/utils/api.tsx | 2 +- utils.go | 9 + 15 files changed, 570 insertions(+), 556 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 jwt.go rename nginx-dev/{proxy.conf => default.conf} (85%) create mode 100644 nginx-dev/run.sh create mode 100644 types.go delete mode 100644 ui/package.json delete mode 100644 ui/pnpm-lock.yaml create mode 100644 utils.go diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..7e1c5bd --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +public +ui diff --git a/.gitignore b/.gitignore index 3aead0d..2ee622e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,8 @@ dist .umi .vscode draft.md +data +data/* # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f338358 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM ubuntu:20.04 +WORKDIR /app +COPY ./nav /app/nav +# VOLUME [ "/data" ] +EXPOSE 8233 +ENTRYPOINT [ "/app/nav" ] \ No newline at end of file diff --git a/handlers.go b/handlers.go index 9353104..c8f6c5f 100644 --- a/handlers.go +++ b/handlers.go @@ -33,3 +33,240 @@ func ImportToolsHandler(c *gin.Context) { "message": "导入工具成功", }) } + +func UpdateSettingHandler(c *gin.Context) { + var data Setting + if err := c.ShouldBindJSON(&data); err != nil { + checkErr(err) + c.JSON(http.StatusBadRequest, gin.H{ + "success": false, + "errorMessage": err.Error(), + }) + return + } + updateSetting(data, db) + c.JSON(200, gin.H{ + "success": true, + "message": "更新配置成功", + }) +} + +func UpdateUserHandler(c *gin.Context) { + var data updateUserDto + if err := c.ShouldBindJSON(&data); err != nil { + checkErr(err) + c.JSON(http.StatusBadRequest, gin.H{ + "success": false, + "errorMessage": err.Error(), + }) + return + } + updateUser(data, db) + c.JSON(200, gin.H{ + "success": true, + "message": "更新用户成功", + }) +} + +func GetAllHandler(c *gin.Context) { + // 获取全部数据 + tools := getAllTool(db) + catelogs := getAllCatelog(db) + setting := getSetting(db) + c.JSON(200, gin.H{ + "success": true, + "data": gin.H{ + "tools": tools, + "catelogs": catelogs, + "setting": setting, + }, + }) +} + +func GetAdminAllDataHandler(c *gin.Context) { + // 管理员获取全部数据,还有个用户名。 + tools := getAllTool(db) + catelogs := getAllCatelog(db) + setting := getSetting(db) + userId, ok := c.Get("uid") + if !ok { + c.JSON(http.StatusBadRequest, gin.H{ + "success": false, + "errorMessage": "不存在该用户!", + }) + return + } + c.JSON(200, gin.H{ + "success": true, + "data": gin.H{ + "tools": tools, + "catelogs": catelogs, + "setting": setting, + "user": gin.H{ + "name": c.GetString("username"), + "id": userId, + }, + }, + }) +} + +func LoginHandler(c *gin.Context) { + var data loginDto + if err := c.ShouldBindJSON(&data); err != nil { + checkErr(err) + c.JSON(http.StatusBadRequest, gin.H{ + "success": false, + "errorMessage": err.Error(), + }) + return + } + user := getUser(data.Name, db) + if user.Name == "" { + c.JSON(200, gin.H{ + "success": false, + "errorMessage": "用户名不存在", + }) + return + } + if user.Password != data.Password { + c.JSON(200, gin.H{ + "success": false, + "errorMessage": "密码错误", + }) + return + } + // 生成 token + token, err := SignJWT(user) + checkErr(err) + + c.JSON(200, gin.H{ + "success": true, + "message": "登录成功", + "data": gin.H{ + "user": user, + "token": token, + }, + }) + +} + +// 退出登录 +func LogoutHandler(c *gin.Context) { + // fmt.Println("TODO: 销毁 JWT") + c.JSON(200, gin.H{ + "success": true, + "message": "登出成功", + }) +} + +func AddToolHandler(c *gin.Context) { + // 添加工具 + var data addToolDto + if err := c.ShouldBindJSON(&data); err != nil { + checkErr(err) + c.JSON(http.StatusBadRequest, gin.H{ + "success": false, + "errorMessage": err.Error(), + }) + return + } + addTool(data, db) + c.JSON(200, gin.H{ + "success": true, + "message": "添加成功", + }) +} + +func DeleteToolHandler(c *gin.Context) { + // 删除工具 + id := c.Param("id") + sql_delete_tool := ` + DELETE FROM nav_table WHERE id = ?; + ` + stmt, err := db.Prepare(sql_delete_tool) + checkErr(err) + res, err := stmt.Exec(id) + checkErr(err) + _, err = res.RowsAffected() + checkErr(err) + // fmt.Println(affect) + c.JSON(200, gin.H{ + "success": true, + "message": "删除成功", + }) +} + +func UpdateToolHandler(c *gin.Context) { + // 更新工具 + var data updateToolDto + if err := c.ShouldBindJSON(&data); err != nil { + checkErr(err) + c.JSON(http.StatusBadRequest, gin.H{ + "success": false, + "errorMessage": err.Error(), + }) + return + } + updateTool(data, db) + c.JSON(200, gin.H{ + "success": true, + "message": "更新成功", + }) +} + +func AddCatelogHandler(c *gin.Context) { + // 添加分类 + var data addCatelogDto + if err := c.ShouldBindJSON(&data); err != nil { + checkErr(err) + c.JSON(http.StatusBadRequest, gin.H{ + "success": false, + "errorMessage": err.Error(), + }) + return + } + addCatelog(data, db) + + c.JSON(200, gin.H{ + "success": true, + "message": "增加分类成功", + }) +} + +func DeleteCatelogHandler(c *gin.Context) { + // 删除分类 + id := c.Param("id") + sql_delete_catelog := ` + DELETE FROM nav_catelog WHERE id = ?; + ` + stmt, err := db.Prepare(sql_delete_catelog) + checkErr(err) + res, err := stmt.Exec(id) + checkErr(err) + _, err = res.RowsAffected() + checkErr(err) + // fmt.Println(affect) + c.JSON(200, gin.H{ + "success": true, + "message": "删除分类成功", + }) +} + +func UpdateCatelogHandler(c *gin.Context) { + // 更新分类 + var data updateCatelogDto + if err := c.ShouldBindJSON(&data); err != nil { + checkErr(err) + c.JSON(http.StatusBadRequest, gin.H{ + "success": false, + "errorMessage": err.Error(), + }) + return + } + updateCatelog(data, db) + + c.JSON(200, gin.H{ + "success": true, + "message": "更新分类成功", + }) +} diff --git a/jwt.go b/jwt.go new file mode 100644 index 0000000..517170c --- /dev/null +++ b/jwt.go @@ -0,0 +1,69 @@ +package main + +import ( + "net/http" + "time" + + "github.com/gin-gonic/gin" + "github.com/golang-jwt/jwt" +) + +// JTW 密钥 +var jwtSecret = []byte("boy_next_door") + +// 签名一个 JTW +func SignJWT(user User) (string, error) { + token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{ + "name": user.Name, + "id": user.Id, + "exp": time.Now().Add(time.Hour * 24).Unix(), + }) + tokenString, err := token.SignedString([]byte(jwtSecret)) + return tokenString, err +} + +// 解密一个 JTW +func ParseJWT(tokenString string) (*jwt.Token, error) { + token, err := jwt.Parse(tokenString, func(token *jwt.Token) (i interface{}, e error) { + return jwtSecret, nil + }) + return token, err +} + +// 定义一个 JWT 的中间件 +func JWTMiddleware() gin.HandlerFunc { + return func(c *gin.Context) { + rawToken := c.Request.Header.Get("Authorization") + if rawToken == "" { + c.JSON(http.StatusUnauthorized, gin.H{ + "success": false, + "errorMessage": "未登录", + }) + c.Abort() + return + } + // 解析 token + token, err := ParseJWT(rawToken) + if err != nil { + c.JSON(http.StatusUnauthorized, gin.H{ + "success": false, + "errorMessage": "未登录", + }) + c.Abort() + return + } + // 把名称加到上下文 + if claims, ok := token.Claims.(jwt.MapClaims); ok && token.Valid { + c.Set("username", claims["name"]) + c.Set("uid", claims["id"]) + c.Next() + } else { + c.JSON(http.StatusUnauthorized, gin.H{ + "success": false, + "errorMessage": "未登录", + }) + c.Abort() + return + } + } +} diff --git a/main.go b/main.go index ee2cb61..74159a9 100644 --- a/main.go +++ b/main.go @@ -5,92 +5,19 @@ import ( "embed" "fmt" "net/http" + "os" "path" "strings" "time" "github.com/gin-gonic/contrib/static" "github.com/gin-gonic/gin" - "github.com/golang-jwt/jwt" _ "modernc.org/sqlite" // _ "github.com/mattn/go-sqlite3" ) const INDEX = "index.html" -// 默认是 0 -type Setting struct { - Id int `json:"id"` - Favicon string `json:"favicon"` - Title string `json:"title"` -} - -type User struct { - Id int `json:"id"` - Name string `json:"name"` - Password string `json:"password"` -} - -type resUserDto struct { - Name string `json:"name"` -} - -type updateUserDto struct { - Id int64 `json:"id"` - Name string `json:"name"` - Password string `json:"password"` -} - -type Tool struct { - Id int `json:"id"` - Name string `json:"name"` - Url string `json:"url"` - Logo string `json:"logo"` - Catelog string `json:"catelog"` - Desc string `json:"desc"` -} - -type addToolDto struct { - Name string `json:"name"` - Url string `json:"url"` - Logo string `json:"logo"` - Catelog string `json:"catelog"` - Desc string `json:"desc"` -} - -type updateToolDto struct { - Id int `json:"id"` - Name string `json:"name"` - Url string `json:"url"` - Logo string `json:"logo"` - Catelog string `json:"catelog"` - Desc string `json:"desc"` -} -type updateCatelogDto struct { - Id int `json:"id"` - Name string `json:"name"` -} - -type addCatelogDto struct { - Name string `json:"name"` -} - -type Catelog struct { - Id int `json:"id"` - Name string `json:"name"` -} - -func checkErr(err error) { - if err != nil { - fmt.Println("捕获到错误:", err) - } -} - -type loginDto struct { - Name string `json:"name"` - Password string `json:"password"` -} - func updateCatelog(data updateCatelogDto, db *sql.DB) { sql_update_catelog := ` UPDATE nav_catelog @@ -221,9 +148,18 @@ func generateId() int { var db *sql.DB +func PathExistsOrCreate(path string) { + _, err := os.Stat(path) + if err == nil { + return + } + os.Mkdir(path, os.ModePerm) +} + func initDB() { + PathExistsOrCreate("./data") // 创建数据库 - db, _ = sql.Open("sqlite", "./nav.db") + db, _ = sql.Open("sqlite", "./data/nav.db") // user 表 sql_create_table := ` CREATE TABLE IF NOT EXISTS nav_user ( @@ -395,23 +331,6 @@ func main() { router.Run(":8233") } -func UpdateSettingHandler(c *gin.Context) { - var data Setting - if err := c.ShouldBindJSON(&data); err != nil { - checkErr(err) - c.JSON(http.StatusBadRequest, gin.H{ - "success": false, - "errorMessage": err.Error(), - }) - return - } - updateSetting(data, db) - c.JSON(200, gin.H{ - "success": true, - "message": "更新配置成功", - }) -} - func importTools(data []Tool) { for _, v := range data { sql_add_tool := ` @@ -427,65 +346,6 @@ func importTools(data []Tool) { } } -func UpdateUserHandler(c *gin.Context) { - var data updateUserDto - if err := c.ShouldBindJSON(&data); err != nil { - checkErr(err) - c.JSON(http.StatusBadRequest, gin.H{ - "success": false, - "errorMessage": err.Error(), - }) - return - } - updateUser(data, db) - c.JSON(200, gin.H{ - "success": true, - "message": "更新用户成功", - }) -} - -func GetAllHandler(c *gin.Context) { - // 获取全部数据 - tools := getAllTool(db) - catelogs := getAllCatelog(db) - setting := getSetting(db) - c.JSON(200, gin.H{ - "success": true, - "data": gin.H{ - "tools": tools, - "catelogs": catelogs, - "setting": setting, - }, - }) -} - -func GetAdminAllDataHandler(c *gin.Context) { - // 管理员获取全部数据,还有个用户名。 - tools := getAllTool(db) - catelogs := getAllCatelog(db) - setting := getSetting(db) - userId, ok := c.Get("uid") - if !ok { - c.JSON(http.StatusBadRequest, gin.H{ - "success": false, - "errorMessage": "不存在该用户!", - }) - return - } - c.JSON(200, gin.H{ - "success": true, - "data": gin.H{ - "tools": tools, - "catelogs": catelogs, - "setting": setting, - "user": gin.H{ - "name": c.GetString("username"), - "id": userId, - }, - }, - }) -} - func getSetting(db *sql.DB) Setting { sql_get_user := ` SELECT * FROM nav_setting WHERE id = ?; @@ -507,224 +367,3 @@ func getUser(name string, db *sql.DB) User { checkErr(err) return user } - -func LoginHandler(c *gin.Context) { - var data loginDto - if err := c.ShouldBindJSON(&data); err != nil { - checkErr(err) - c.JSON(http.StatusBadRequest, gin.H{ - "success": false, - "errorMessage": err.Error(), - }) - return - } - user := getUser(data.Name, db) - if user.Name == "" { - c.JSON(200, gin.H{ - "success": false, - "errorMessage": "用户名不存在", - }) - return - } - if user.Password != data.Password { - c.JSON(200, gin.H{ - "success": false, - "errorMessage": "密码错误", - }) - return - } - // 生成 token - token, err := SignJWT(user) - checkErr(err) - - c.JSON(200, gin.H{ - "success": true, - "message": "登录成功", - "data": gin.H{ - "user": user, - "token": token, - }, - }) - -} - -// 退出登录 -func LogoutHandler(c *gin.Context) { - // fmt.Println("TODO: 销毁 JWT") - c.JSON(200, gin.H{ - "success": true, - "message": "登出成功", - }) -} - -func AddToolHandler(c *gin.Context) { - // 添加工具 - var data addToolDto - if err := c.ShouldBindJSON(&data); err != nil { - checkErr(err) - c.JSON(http.StatusBadRequest, gin.H{ - "success": false, - "errorMessage": err.Error(), - }) - return - } - addTool(data, db) - c.JSON(200, gin.H{ - "success": true, - "message": "添加成功", - }) -} - -func DeleteToolHandler(c *gin.Context) { - // 删除工具 - id := c.Param("id") - sql_delete_tool := ` - DELETE FROM nav_table WHERE id = ?; - ` - stmt, err := db.Prepare(sql_delete_tool) - checkErr(err) - res, err := stmt.Exec(id) - checkErr(err) - _, err = res.RowsAffected() - checkErr(err) - // fmt.Println(affect) - c.JSON(200, gin.H{ - "success": true, - "message": "删除成功", - }) -} - -func UpdateToolHandler(c *gin.Context) { - // 更新工具 - var data updateToolDto - if err := c.ShouldBindJSON(&data); err != nil { - checkErr(err) - c.JSON(http.StatusBadRequest, gin.H{ - "success": false, - "errorMessage": err.Error(), - }) - return - } - updateTool(data, db) - c.JSON(200, gin.H{ - "success": true, - "message": "更新成功", - }) -} - -func AddCatelogHandler(c *gin.Context) { - // 添加分类 - var data addCatelogDto - if err := c.ShouldBindJSON(&data); err != nil { - checkErr(err) - c.JSON(http.StatusBadRequest, gin.H{ - "success": false, - "errorMessage": err.Error(), - }) - return - } - addCatelog(data, db) - - c.JSON(200, gin.H{ - "success": true, - "message": "增加分类成功", - }) -} - -func DeleteCatelogHandler(c *gin.Context) { - // 删除分类 - id := c.Param("id") - sql_delete_catelog := ` - DELETE FROM nav_catelog WHERE id = ?; - ` - stmt, err := db.Prepare(sql_delete_catelog) - checkErr(err) - res, err := stmt.Exec(id) - checkErr(err) - _, err = res.RowsAffected() - checkErr(err) - // fmt.Println(affect) - c.JSON(200, gin.H{ - "success": true, - "message": "删除分类成功", - }) -} - -func UpdateCatelogHandler(c *gin.Context) { - // 更新分类 - var data updateCatelogDto - if err := c.ShouldBindJSON(&data); err != nil { - checkErr(err) - c.JSON(http.StatusBadRequest, gin.H{ - "success": false, - "errorMessage": err.Error(), - }) - return - } - updateCatelog(data, db) - - c.JSON(200, gin.H{ - "success": true, - "message": "更新分类成功", - }) -} - -// JTW 密钥 -var jwtSecret = []byte("boy_next_door") - -// 签名一个 JTW -func SignJWT(user User) (string, error) { - token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{ - "name": user.Name, - "id": user.Id, - "exp": time.Now().Add(time.Hour * 24).Unix(), - }) - tokenString, err := token.SignedString([]byte(jwtSecret)) - return tokenString, err -} - -// 解密一个 JTW -func ParseJWT(tokenString string) (*jwt.Token, error) { - token, err := jwt.Parse(tokenString, func(token *jwt.Token) (i interface{}, e error) { - return jwtSecret, nil - }) - return token, err -} - -// 定义一个 JWT 的中间件 -func JWTMiddleware() gin.HandlerFunc { - return func(c *gin.Context) { - rawToken := c.Request.Header.Get("Authorization") - if rawToken == "" { - c.JSON(http.StatusUnauthorized, gin.H{ - "success": false, - "errorMessage": "未登录", - }) - c.Abort() - return - } - // 解析 token - token, err := ParseJWT(rawToken) - if err != nil { - c.JSON(http.StatusUnauthorized, gin.H{ - "success": false, - "errorMessage": "未登录", - }) - c.Abort() - return - } - // 把名称加到上下文 - if claims, ok := token.Claims.(jwt.MapClaims); ok && token.Valid { - c.Set("username", claims["name"]) - c.Set("uid", claims["id"]) - c.Next() - } else { - c.JSON(http.StatusUnauthorized, gin.H{ - "success": false, - "errorMessage": "未登录", - }) - c.Abort() - return - } - } -} diff --git a/nginx-dev/proxy.conf b/nginx-dev/default.conf similarity index 85% rename from nginx-dev/proxy.conf rename to nginx-dev/default.conf index 96907c8..d401ca7 100644 --- a/nginx-dev/proxy.conf +++ b/nginx-dev/default.conf @@ -1,5 +1,5 @@ upstream nav_server { - server 127.0.0.1:8080; + server 127.0.0.1:8233; } upstream nav_ui { server 127.0.0.1:2333; @@ -8,8 +8,6 @@ upstream nav_admin { server 127.0.0.1:2334; } - - map $http_upgrade $connection_upgrade { default upgrade; '' close; @@ -41,6 +39,8 @@ server { # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; # index index.html index.htm; } location / { @@ -52,6 +52,8 @@ server { # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; # index index.html index.htm; } location /api { @@ -63,8 +65,8 @@ server { # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; - # proxy_set_header Upgrade $http_upgrade; - # proxy_set_header Connection $connection_upgrade; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; # proxy_pass_request_headers on; } } diff --git a/nginx-dev/run.sh b/nginx-dev/run.sh new file mode 100644 index 0000000..1cd2eeb --- /dev/null +++ b/nginx-dev/run.sh @@ -0,0 +1,2 @@ +docker rm -f nginx-dev +docker run --name nginx-dev --network host --rm -d -v $(pwd)/default.conf:/etc/nginx/conf.d/default.conf nginx \ No newline at end of file diff --git a/types.go b/types.go new file mode 100644 index 0000000..f702fc2 --- /dev/null +++ b/types.go @@ -0,0 +1,68 @@ +package main + +type loginDto struct { + Name string `json:"name"` + Password string `json:"password"` +} + +// 默认是 0 +type Setting struct { + Id int `json:"id"` + Favicon string `json:"favicon"` + Title string `json:"title"` +} + +type User struct { + Id int `json:"id"` + Name string `json:"name"` + Password string `json:"password"` +} + +type resUserDto struct { + Name string `json:"name"` +} + +type updateUserDto struct { + Id int64 `json:"id"` + Name string `json:"name"` + Password string `json:"password"` +} + +type Tool struct { + Id int `json:"id"` + Name string `json:"name"` + Url string `json:"url"` + Logo string `json:"logo"` + Catelog string `json:"catelog"` + Desc string `json:"desc"` +} + +type addToolDto struct { + Name string `json:"name"` + Url string `json:"url"` + Logo string `json:"logo"` + Catelog string `json:"catelog"` + Desc string `json:"desc"` +} + +type updateToolDto struct { + Id int `json:"id"` + Name string `json:"name"` + Url string `json:"url"` + Logo string `json:"logo"` + Catelog string `json:"catelog"` + Desc string `json:"desc"` +} +type updateCatelogDto struct { + Id int `json:"id"` + Name string `json:"name"` +} + +type addCatelogDto struct { + Name string `json:"name"` +} + +type Catelog struct { + Id int `json:"id"` + Name string `json:"name"` +} diff --git a/ui/package.json b/ui/package.json deleted file mode 100644 index 3ebf419..0000000 --- a/ui/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "react-helmet": "^6.1.0" - } -} diff --git a/ui/pnpm-lock.yaml b/ui/pnpm-lock.yaml deleted file mode 100644 index 7a2a658..0000000 --- a/ui/pnpm-lock.yaml +++ /dev/null @@ -1,74 +0,0 @@ -lockfileVersion: 5.3 - -specifiers: - react-helmet: ^6.1.0 - -dependencies: - react-helmet: registry.nlark.com/react-helmet/6.1.0 - -packages: - - registry.nlark.com/js-tokens/4.0.0: - resolution: {integrity: sha1-GSA/tZmR35jjoocFDUZHzerzJJk=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/js-tokens/download/js-tokens-4.0.0.tgz} - name: js-tokens - version: 4.0.0 - dev: false - - registry.nlark.com/object-assign/4.1.1: - resolution: {integrity: sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/object-assign/download/object-assign-4.1.1.tgz} - name: object-assign - version: 4.1.1 - engines: {node: '>=0.10.0'} - dev: false - - registry.nlark.com/prop-types/15.7.2: - resolution: {integrity: sha1-UsQedbjIfnK52TYOAga5ncv/psU=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/prop-types/download/prop-types-15.7.2.tgz} - name: prop-types - version: 15.7.2 - dependencies: - loose-envify: registry.npmmirror.com/loose-envify/1.4.0 - object-assign: registry.nlark.com/object-assign/4.1.1 - react-is: registry.npmmirror.com/react-is/16.13.1 - dev: false - - registry.nlark.com/react-helmet/6.1.0: - resolution: {integrity: sha1-p1DVFlyxPPIT5EdHUCZS55RGhyY=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/react-helmet/download/react-helmet-6.1.0.tgz} - name: react-helmet - version: 6.1.0 - peerDependencies: - react: '>=16.3.0' - dependencies: - object-assign: registry.nlark.com/object-assign/4.1.1 - prop-types: registry.nlark.com/prop-types/15.7.2 - react-fast-compare: registry.npmmirror.com/react-fast-compare/3.2.0 - react-side-effect: registry.nlark.com/react-side-effect/2.1.1 - dev: false - - registry.nlark.com/react-side-effect/2.1.1: - resolution: {integrity: sha1-ZsVwHD51YKtIIqTuJ0Le4hXXLrM=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/react-side-effect/download/react-side-effect-2.1.1.tgz} - name: react-side-effect - version: 2.1.1 - peerDependencies: - react: ^16.3.0 || ^17.0.0 - dev: false - - registry.npmmirror.com/loose-envify/1.4.0: - resolution: {integrity: sha1-ce5R+nvkyuwaY4OffmgtgTLTDK8=, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/loose-envify/download/loose-envify-1.4.0.tgz} - name: loose-envify - version: 1.4.0 - hasBin: true - dependencies: - js-tokens: registry.nlark.com/js-tokens/4.0.0 - dev: false - - registry.npmmirror.com/react-fast-compare/3.2.0: - resolution: {integrity: sha1-ZBqdqBtqYyDycOiXJPtFoLOeQ7s=, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/react-fast-compare/download/react-fast-compare-3.2.0.tgz} - name: react-fast-compare - version: 3.2.0 - dev: false - - registry.npmmirror.com/react-is/16.13.1: - resolution: {integrity: sha1-eJcppNw23imZ3BVt1sHZwYzqVqQ=, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/react-is/download/react-is-16.13.1.tgz} - name: react-is - version: 16.13.1 - dev: false diff --git a/ui/website/package.json b/ui/website/package.json index 2491dc6..5f7c6c6 100644 --- a/ui/website/package.json +++ b/ui/website/package.json @@ -1,46 +1,47 @@ -{ - "name": "tool", - "version": "1.6.1", - "author": "mereith", - "private": true, - "dependencies": { - "@testing-library/jest-dom": "^5.11.4", - "@testing-library/react": "^11.1.0", - "@testing-library/user-event": "^12.1.10", - "@types/jest": "^26.0.15", - "@types/node": "^12.0.0", - "@types/react": "^17.0.0", - "@types/react-dom": "^17.0.0", - "axios": "^0.21.1", - "node-sass": "4.14.1", - "react": "^17.0.2", - "react-dom": "^17.0.2", - "react-scripts": "4.0.3", - "typescript": "^4.1.2", - "web-vitals": "^1.0.1" - }, - "scripts": { - "start": "PORT=2333 react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" - }, - "eslintConfig": { - "extends": [ - "react-app", - "react-app/jest" - ] - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - } -} +{ + "name": "tool", + "version": "1.6.1", + "author": "mereith", + "private": true, + "dependencies": { + "@testing-library/jest-dom": "^5.11.4", + "@testing-library/react": "^11.1.0", + "@testing-library/user-event": "^12.1.10", + "@types/jest": "^26.0.15", + "@types/node": "^12.0.0", + "@types/react": "^17.0.0", + "@types/react-dom": "^17.0.0", + "axios": "^0.21.1", + "node-sass": "4.14.1", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "react-helmet": "^6.1.0", + "react-scripts": "4.0.3", + "typescript": "^4.1.2", + "web-vitals": "^1.0.1" + }, + "scripts": { + "start": "PORT=2333 react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject" + }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + } +} diff --git a/ui/website/pnpm-lock.yaml b/ui/website/pnpm-lock.yaml index 74b2692..f69ed76 100644 --- a/ui/website/pnpm-lock.yaml +++ b/ui/website/pnpm-lock.yaml @@ -12,6 +12,7 @@ specifiers: node-sass: 4.14.1 react: ^17.0.2 react-dom: ^17.0.2 + react-helmet: ^6.1.0 react-scripts: 4.0.3 typescript: ^4.1.2 web-vitals: ^1.0.1 @@ -28,6 +29,7 @@ dependencies: node-sass: registry.npmmirror.com/node-sass/4.14.1 react: registry.npmmirror.com/react/17.0.2 react-dom: registry.npmmirror.com/react-dom/17.0.2_react@17.0.2 + react-helmet: registry.npmmirror.com/react-helmet/6.1.0_react@17.0.2 react-scripts: registry.npmmirror.com/react-scripts/4.0.3_0baf1723d3880145d3a1d10a4c7af4d2 typescript: registry.npmmirror.com/typescript/4.5.4 web-vitals: registry.npmmirror.com/web-vitals/1.1.2 @@ -1095,16 +1097,6 @@ packages: dev: false optional: true - registry.nlark.com/bindings/1.5.0: - resolution: {integrity: sha1-EDU8npRTNLwFEabZCzj7x8nFBN8=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/bindings/download/bindings-1.5.0.tgz} - name: bindings - version: 1.5.0 - requiresBuild: true - dependencies: - file-uri-to-path: registry.npmmirror.com/file-uri-to-path/1.0.0 - dev: false - optional: true - registry.nlark.com/bluebird/3.7.2: resolution: {integrity: sha1-nyKcFb4nJFT/qXOs4NvueaGww28=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/bluebird/download/bluebird-3.7.2.tgz} name: bluebird @@ -2280,7 +2272,7 @@ packages: esutils: registry.nlark.com/esutils/2.0.3 optionator: registry.nlark.com/optionator/0.8.3 optionalDependencies: - source-map: registry.nlark.com/source-map/0.6.1 + source-map: registry.npmmirror.com/source-map/0.6.1 dev: false registry.nlark.com/esprima/4.0.1: @@ -2799,7 +2791,7 @@ packages: dependencies: array-union: registry.nlark.com/array-union/1.0.2 glob: registry.npmmirror.com/glob/7.2.0 - object-assign: registry.nlark.com/object-assign/4.1.1 + object-assign: registry.npmmirror.com/object-assign/4.1.1 pify: registry.nlark.com/pify/2.3.0 pinkie-promise: registry.nlark.com/pinkie-promise/2.0.1 dev: false @@ -4214,21 +4206,6 @@ packages: vm-browserify: registry.nlark.com/vm-browserify/1.1.2 dev: false - registry.nlark.com/node-notifier/8.0.2: - resolution: {integrity: sha1-8xZ6OO8NLIqGaoPjGMG6Dv63AsU=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/node-notifier/download/node-notifier-8.0.2.tgz} - name: node-notifier - version: 8.0.2 - requiresBuild: true - dependencies: - growly: registry.nlark.com/growly/1.3.0 - is-wsl: registry.nlark.com/is-wsl/2.2.0 - semver: registry.nlark.com/semver/7.3.5 - shellwords: registry.nlark.com/shellwords/0.1.1 - uuid: registry.npmmirror.com/uuid/8.3.2 - which: registry.nlark.com/which/2.0.2 - dev: false - optional: true - registry.nlark.com/nopt/3.0.6: resolution: {integrity: sha1-xkZdvwirzU2zWTF/eaxopkayj/k=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/nopt/download/nopt-3.0.6.tgz} name: nopt @@ -4278,7 +4255,7 @@ packages: version: 1.9.1 engines: {node: '>=4'} dependencies: - object-assign: registry.nlark.com/object-assign/4.1.1 + object-assign: registry.npmmirror.com/object-assign/4.1.1 prepend-http: registry.nlark.com/prepend-http/1.0.4 query-string: registry.nlark.com/query-string/4.3.4 sort-keys: registry.nlark.com/sort-keys/1.1.2 @@ -5031,16 +5008,6 @@ packages: asap: registry.nlark.com/asap/2.0.6 dev: false - registry.nlark.com/prop-types/15.7.2: - resolution: {integrity: sha1-UsQedbjIfnK52TYOAga5ncv/psU=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/prop-types/download/prop-types-15.7.2.tgz} - name: prop-types - version: 15.7.2 - dependencies: - loose-envify: registry.npmmirror.com/loose-envify/1.4.0 - object-assign: registry.nlark.com/object-assign/4.1.1 - react-is: registry.npmmirror.com/react-is/16.13.1 - dev: false - registry.nlark.com/proxy-addr/2.0.7: resolution: {integrity: sha1-8Z/mnOqzEe65S0LnDowgcPm6ECU=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/proxy-addr/download/proxy-addr-2.0.7.tgz} name: proxy-addr @@ -5142,7 +5109,7 @@ packages: version: 4.3.4 engines: {node: '>=0.10.0'} dependencies: - object-assign: registry.nlark.com/object-assign/4.1.1 + object-assign: registry.npmmirror.com/object-assign/4.1.1 strict-uri-encode: registry.nlark.com/strict-uri-encode/1.1.0 dev: false @@ -9476,7 +9443,7 @@ packages: terminal-link: registry.nlark.com/terminal-link/2.1.1 v8-to-istanbul: registry.npmmirror.com/v8-to-istanbul/7.1.2 optionalDependencies: - node-notifier: registry.nlark.com/node-notifier/8.0.2 + node-notifier: registry.npmmirror.com/node-notifier/8.0.2 transitivePeerDependencies: - supports-color dev: false @@ -10569,7 +10536,7 @@ packages: name: assert version: 1.5.0 dependencies: - object-assign: registry.nlark.com/object-assign/4.1.1 + object-assign: registry.npmmirror.com/object-assign/4.1.1 util: registry.nlark.com/util/0.10.3 dev: false @@ -10982,6 +10949,16 @@ packages: version: 5.2.2 dev: false + registry.npmmirror.com/bindings/1.5.0: + resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/bindings/-/bindings-1.5.0.tgz} + name: bindings + version: 1.5.0 + requiresBuild: true + dependencies: + file-uri-to-path: registry.npmmirror.com/file-uri-to-path/1.0.0 + dev: false + optional: true + registry.npmmirror.com/block-stream/0.0.9: resolution: {integrity: sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/block-stream/download/block-stream-0.0.9.tgz} name: block-stream @@ -11246,7 +11223,7 @@ packages: dev: false registry.npmmirror.com/chokidar/3.5.2: - resolution: {integrity: sha1-26OXb8rbAW9m/TZQIdkWANAcHnU=, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/chokidar/download/chokidar-3.5.2.tgz?cache=0&sync_timestamp=1636462322114&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fchokidar%2Fdownload%2Fchokidar-3.5.2.tgz} + resolution: {integrity: sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/chokidar/-/chokidar-3.5.2.tgz} name: chokidar version: 3.5.2 engines: {node: '>= 8.10.0'} @@ -12096,7 +12073,7 @@ packages: object.fromentries: registry.npmmirror.com/object.fromentries/2.0.5 object.hasown: registry.npmmirror.com/object.hasown/1.1.0 object.values: registry.npmmirror.com/object.values/1.1.5 - prop-types: registry.nlark.com/prop-types/15.7.2 + prop-types: registry.npmmirror.com/prop-types/15.7.2 resolve: registry.nlark.com/resolve/2.0.0-next.3 semver: registry.nlark.com/semver/6.3.0 string.prototype.matchall: registry.npmmirror.com/string.prototype.matchall/4.0.6 @@ -12513,7 +12490,7 @@ packages: dev: false registry.npmmirror.com/fsevents/1.2.13: - resolution: {integrity: sha1-8yXLBFVZJCi88Rs4M3DvcOO/zDg=, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/fsevents/download/fsevents-1.2.13.tgz} + resolution: {integrity: sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/fsevents/-/fsevents-1.2.13.tgz} name: fsevents version: 1.2.13 engines: {node: '>= 4.0'} @@ -12521,13 +12498,13 @@ packages: deprecated: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. requiresBuild: true dependencies: - bindings: registry.nlark.com/bindings/1.5.0 - nan: registry.nlark.com/nan/2.15.0 + bindings: registry.npmmirror.com/bindings/1.5.0 + nan: registry.npmmirror.com/nan/2.15.0 dev: false optional: true registry.npmmirror.com/fsevents/2.3.2: - resolution: {integrity: sha1-ilJveLj99GI7cJ4Ll1xSwkwC/Ro=, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/fsevents/download/fsevents-2.3.2.tgz} + resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/fsevents/-/fsevents-2.3.2.tgz} name: fsevents version: 2.3.2 engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -12556,7 +12533,7 @@ packages: aproba: registry.nlark.com/aproba/1.2.0 console-control-strings: registry.npmmirror.com/console-control-strings/1.1.0 has-unicode: registry.npmmirror.com/has-unicode/2.0.1 - object-assign: registry.nlark.com/object-assign/4.1.1 + object-assign: registry.npmmirror.com/object-assign/4.1.1 signal-exit: registry.npmmirror.com/signal-exit/3.0.6 string-width: registry.npmmirror.com/string-width/1.0.2 strip-ansi: registry.npmmirror.com/strip-ansi/3.0.1 @@ -13996,7 +13973,7 @@ packages: map-obj: registry.npmmirror.com/map-obj/1.0.1 minimist: registry.nlark.com/minimist/1.2.5 normalize-package-data: registry.nlark.com/normalize-package-data/2.5.0 - object-assign: registry.nlark.com/object-assign/4.1.1 + object-assign: registry.npmmirror.com/object-assign/4.1.1 read-pkg-up: registry.npmmirror.com/read-pkg-up/1.0.1 redent: registry.nlark.com/redent/1.0.0 trim-newlines: registry.npmmirror.com/trim-newlines/1.0.0 @@ -14130,6 +14107,13 @@ packages: thunky: registry.nlark.com/thunky/1.1.0 dev: false + registry.npmmirror.com/nan/2.15.0: + resolution: {integrity: sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/nan/-/nan-2.15.0.tgz} + name: nan + version: 2.15.0 + dev: false + optional: true + registry.npmmirror.com/nanoid/3.1.30: resolution: {integrity: sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/nanoid/download/nanoid-3.1.30.tgz} name: nanoid @@ -14186,6 +14170,21 @@ packages: which: registry.nlark.com/which/1.3.1 dev: false + registry.npmmirror.com/node-notifier/8.0.2: + resolution: {integrity: sha512-oJP/9NAdd9+x2Q+rfphB2RJCHjod70RcRLjosiPMMu5gjIfwVnOUGq2nbTjTUbmy0DJ/tFIVT30+Qe3nzl4TJg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/node-notifier/-/node-notifier-8.0.2.tgz} + name: node-notifier + version: 8.0.2 + requiresBuild: true + dependencies: + growly: registry.nlark.com/growly/1.3.0 + is-wsl: registry.nlark.com/is-wsl/2.2.0 + semver: registry.nlark.com/semver/7.3.5 + shellwords: registry.nlark.com/shellwords/0.1.1 + uuid: registry.npmmirror.com/uuid/8.3.2 + which: registry.nlark.com/which/2.0.2 + dev: false + optional: true + registry.npmmirror.com/node-releases/1.1.77: resolution: {integrity: sha1-ULDP7ehV3TdOdYW/Io/zTlfBwy4=, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/node-releases/download/node-releases-1.1.77.tgz} name: node-releases @@ -14267,6 +14266,13 @@ packages: version: 0.9.0 dev: false + registry.npmmirror.com/object-assign/4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/object-assign/-/object-assign-4.1.1.tgz} + name: object-assign + version: 4.1.1 + engines: {node: '>=0.10.0'} + dev: false + registry.npmmirror.com/object-inspect/1.12.0: resolution: {integrity: sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/object-inspect/download/object-inspect-1.12.0.tgz} name: object-inspect @@ -15164,6 +15170,16 @@ packages: sisteransi: registry.nlark.com/sisteransi/1.0.5 dev: false + registry.npmmirror.com/prop-types/15.7.2: + resolution: {integrity: sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/prop-types/-/prop-types-15.7.2.tgz} + name: prop-types + version: 15.7.2 + dependencies: + loose-envify: registry.npmmirror.com/loose-envify/1.4.0 + object-assign: registry.npmmirror.com/object-assign/4.1.1 + react-is: registry.npmmirror.com/react-is/16.13.1 + dev: false + registry.npmmirror.com/qs/6.5.2: resolution: {integrity: sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/qs/download/qs-6.5.2.tgz} name: qs @@ -15213,7 +15229,7 @@ packages: engines: {node: '>=10'} dependencies: core-js: registry.npmmirror.com/core-js/3.20.0 - object-assign: registry.nlark.com/object-assign/4.1.1 + object-assign: registry.npmmirror.com/object-assign/4.1.1 promise: registry.nlark.com/promise/8.1.0 raf: registry.nlark.com/raf/3.4.1 regenerator-runtime: registry.nlark.com/regenerator-runtime/0.13.9 @@ -15272,8 +15288,29 @@ packages: version: 6.0.10 dev: false + registry.npmmirror.com/react-fast-compare/3.2.0: + resolution: {integrity: sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/react-fast-compare/-/react-fast-compare-3.2.0.tgz} + name: react-fast-compare + version: 3.2.0 + dev: false + + registry.npmmirror.com/react-helmet/6.1.0_react@17.0.2: + resolution: {integrity: sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/react-helmet/-/react-helmet-6.1.0.tgz} + id: registry.npmmirror.com/react-helmet/6.1.0 + name: react-helmet + version: 6.1.0 + peerDependencies: + react: '>=16.3.0' + dependencies: + object-assign: registry.npmmirror.com/object-assign/4.1.1 + prop-types: registry.npmmirror.com/prop-types/15.7.2 + react: registry.npmmirror.com/react/17.0.2 + react-fast-compare: registry.npmmirror.com/react-fast-compare/3.2.0 + react-side-effect: registry.npmmirror.com/react-side-effect/2.1.1_react@17.0.2 + dev: false + registry.npmmirror.com/react-is/16.13.1: - resolution: {integrity: sha1-eJcppNw23imZ3BVt1sHZwYzqVqQ=, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/react-is/download/react-is-16.13.1.tgz} + resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/react-is/-/react-is-16.13.1.tgz} name: react-is version: 16.13.1 dev: false @@ -15386,6 +15423,17 @@ packages: - webpack-plugin-serve dev: false + registry.npmmirror.com/react-side-effect/2.1.1_react@17.0.2: + resolution: {integrity: sha512-2FoTQzRNTncBVtnzxFOk2mCpcfxQpenBMbk5kSVBg5UcPqV9fRbgY2zhb7GTWWOlpFmAxhClBDlIq8Rsubz1yQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/react-side-effect/-/react-side-effect-2.1.1.tgz} + id: registry.npmmirror.com/react-side-effect/2.1.1 + name: react-side-effect + version: 2.1.1 + peerDependencies: + react: ^16.3.0 || ^17.0.0 + dependencies: + react: registry.npmmirror.com/react/17.0.2 + dev: false + registry.npmmirror.com/react/17.0.2: resolution: {integrity: sha1-0LXMUW0p6z7uOD91tihkz7aAADc=, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/react/download/react-17.0.2.tgz} name: react @@ -15695,7 +15743,7 @@ packages: version: 0.20.2 dependencies: loose-envify: registry.npmmirror.com/loose-envify/1.4.0 - object-assign: registry.nlark.com/object-assign/4.1.1 + object-assign: registry.npmmirror.com/object-assign/4.1.1 dev: false registry.npmmirror.com/schema-utils/1.0.0: @@ -15829,6 +15877,14 @@ packages: source-map: registry.nlark.com/source-map/0.6.1 dev: false + registry.npmmirror.com/source-map/0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz} + name: source-map + version: 0.6.1 + engines: {node: '>=0.10.0'} + dev: false + optional: true + registry.npmmirror.com/spdx-exceptions/2.3.0: resolution: {integrity: sha1-PyjOGnegA3JoPq3kpDMYNSeiFj0=, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/spdx-exceptions/download/spdx-exceptions-2.3.0.tgz} name: spdx-exceptions @@ -16484,7 +16540,7 @@ packages: dev: false registry.npmmirror.com/watchpack-chokidar2/2.0.1: - resolution: {integrity: sha1-OFAAcu5uzmbzdpk2lQ6hdxvhyVc=, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/watchpack-chokidar2/download/watchpack-chokidar2-2.0.1.tgz} + resolution: {integrity: sha512-nCFfBIPKr5Sh61s4LPpy1Wtfi0HE8isJ3d2Yb5/Ppw2P2B/3eVSEBjKfN0fmHJSK14+31KwMKmcrzs2GM4P0Ww==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz} name: watchpack-chokidar2 version: 2.0.1 requiresBuild: true diff --git a/ui/website/src/utils/api.tsx b/ui/website/src/utils/api.tsx index 58dbfd4..8789ff7 100644 --- a/ui/website/src/utils/api.tsx +++ b/ui/website/src/utils/api.tsx @@ -1,6 +1,6 @@ import axios from "axios"; const baseUrl = "/api/"; -// const baseUrl = "https://api.mereith.com"; +// const baseUrl = "https://tools.mereith.com/api/"; export const FetchList =async () => { const response = await axios.get(baseUrl); return response.data; diff --git a/utils.go b/utils.go new file mode 100644 index 0000000..a0e81b7 --- /dev/null +++ b/utils.go @@ -0,0 +1,9 @@ +package main + +import "fmt" + +func checkErr(err error) { + if err != nil { + fmt.Println("捕获到错误:", err) + } +}