diff --git a/audon-fe/src/router/index.js b/audon-fe/src/router/index.js index 55523cf..319ab2e 100644 --- a/audon-fe/src/router/index.js +++ b/audon-fe/src/router/index.js @@ -15,8 +15,8 @@ const router = createRouter({ component: ErrorView, }, { - path: "/error/:type", - name: "error", + path: "/offline", + name: "offline", meta: { noauth: true, }, diff --git a/audon-fe/src/views/ErrorView.vue b/audon-fe/src/views/ErrorView.vue index 777c872..6802f91 100644 --- a/audon-fe/src/views/ErrorView.vue +++ b/audon-fe/src/views/ErrorView.vue @@ -6,10 +6,7 @@ export default { }; }, created() { - const type = this.$route.params.type; - if (!type) return; - - if (type === "offline") { + if (this.name === "offline") { alert(this.$t("errors.offline")); this.$router.push({ name: "home" }); } diff --git a/user.go b/user.go index 50d7f36..edb705d 100644 --- a/user.go +++ b/user.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "net/http" - "net/url" "time" "github.com/labstack/echo/v4" @@ -110,16 +109,7 @@ func redirectUserHandler(c echo.Context) error { } } - query := make(url.Values) - query.Add("url", user.RemoteURL) - result := url.URL{ - Path: "/error/offline", - ForceQuery: true, - OmitHost: true, - RawQuery: query.Encode(), - } - - return c.Redirect(http.StatusFound, result.String()) + return c.Redirect(http.StatusFound, "/offline") } func (a *AudonUser) Equal(u *AudonUser) bool {