diff --git a/api/core/app_server.go b/api/core/app_server.go index 4e4f3a1f..96f70713 100644 --- a/api/core/app_server.go +++ b/api/core/app_server.go @@ -141,13 +141,10 @@ func authorizeMiddleware(s *AppServer, client *redis.Client) gin.HandlerFunc { if c.Request.URL.Path == "/api/user/login" || c.Request.URL.Path == "/api/admin/login" || c.Request.URL.Path == "/api/user/register" || - c.Request.URL.Path == "/api/reward/notify" || - c.Request.URL.Path == "/api/mj/notify" || c.Request.URL.Path == "/api/chat/history" || c.Request.URL.Path == "/api/chat/detail" || c.Request.URL.Path == "/api/role/list" || c.Request.URL.Path == "/api/mj/jobs" || - c.Request.URL.Path == "/api/mj/proxy" || c.Request.URL.Path == "/api/sd/jobs" || strings.HasPrefix(c.Request.URL.Path, "/api/sms/") || strings.HasPrefix(c.Request.URL.Path, "/api/captcha/") || diff --git a/api/handler/admin/admin_handler.go b/api/handler/admin/admin_handler.go index baecad81..dbb2611d 100644 --- a/api/handler/admin/admin_handler.go +++ b/api/handler/admin/admin_handler.go @@ -5,13 +5,10 @@ import ( "chatplus/core/types" "chatplus/handler" logger2 "chatplus/logger" - "chatplus/store/model" - "chatplus/utils" "chatplus/utils/resp" "context" "github.com/go-redis/redis/v8" "github.com/golang-jwt/jwt/v5" - "strings" "time" "github.com/gin-gonic/gin" @@ -82,67 +79,3 @@ func (h *ManagerHandler) Session(c *gin.Context) { resp.SUCCESS(c) } } - -// Migrate 数据修正 -func (h *ManagerHandler) Migrate(c *gin.Context) { - opt := c.Query("opt") - switch opt { - case "user": - // 将用户订阅角色的数据结构从 map 改成数组 - var users []model.User - h.db.Find(&users) - for _, u := range users { - var m map[string]int - var roleKeys = make([]string, 0) - err := utils.JsonDecode(u.ChatRoles, &m) - if err != nil { - continue - } - - for k := range m { - roleKeys = append(roleKeys, k) - } - u.ChatRoles = utils.JsonEncode(roleKeys) - h.db.Updates(&u) - - } - break - case "role": - // 修改角色图片,改成绝对路径 - var roles []model.ChatRole - h.db.Find(&roles) - for _, r := range roles { - if !strings.HasPrefix(r.Icon, "/") { - r.Icon = "/" + r.Icon - h.db.Updates(&r) - } - } - break - case "history": - // 修改角色图片,改成绝对路径 - var message []model.HistoryMessage - h.db.Find(&message) - for _, r := range message { - if !strings.HasPrefix(r.Icon, "/") { - r.Icon = "/" + r.Icon - h.db.Updates(&r) - } - - } - break - - case "avatar": - // 更新用户的头像地址 - var users []model.User - h.db.Find(&users) - for _, u := range users { - if !strings.HasPrefix(u.Avatar, "/") { - u.Avatar = "/" + u.Avatar - h.db.Updates(&u) - } - } - break - } - - resp.SUCCESS(c, "SUCCESS") -} diff --git a/api/static/hello.txt b/api/static/hello.txt deleted file mode 100644 index 270c611e..00000000 --- a/api/static/hello.txt +++ /dev/null @@ -1 +0,0 @@ -hello, world! diff --git a/web/.env.development b/web/.env.development index bbfdc65e..276ad755 100644 --- a/web/.env.development +++ b/web/.env.development @@ -1,5 +1,5 @@ -VUE_APP_API_HOST=http://localhost:5678 -VUE_APP_WS_HOST=ws://localhost:5678 +VUE_APP_API_HOST=http://localhost:6789 +VUE_APP_WS_HOST=ws://localhost:6789 VUE_APP_USER=18575670125 VUE_APP_PASS=12345678 VUE_APP_ADMIN_USER=admin