kopia lustrzana https://codeberg.org/nmkj/audon
rodzic
150ad6df05
commit
fec8e75a74
|
@ -15,8 +15,8 @@ const router = createRouter({
|
|||
component: ErrorView,
|
||||
},
|
||||
{
|
||||
path: "/error/:type",
|
||||
name: "error",
|
||||
path: "/offline",
|
||||
name: "offline",
|
||||
meta: {
|
||||
noauth: true,
|
||||
},
|
||||
|
|
|
@ -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" });
|
||||
}
|
||||
|
|
12
user.go
12
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 {
|
||||
|
|
Ładowanie…
Reference in New Issue