kopia lustrzana https://codeberg.org/nmkj/audon
rodzic
150ad6df05
commit
fec8e75a74
|
@ -15,8 +15,8 @@ const router = createRouter({
|
||||||
component: ErrorView,
|
component: ErrorView,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/error/:type",
|
path: "/offline",
|
||||||
name: "error",
|
name: "offline",
|
||||||
meta: {
|
meta: {
|
||||||
noauth: true,
|
noauth: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -6,10 +6,7 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const type = this.$route.params.type;
|
if (this.name === "offline") {
|
||||||
if (!type) return;
|
|
||||||
|
|
||||||
if (type === "offline") {
|
|
||||||
alert(this.$t("errors.offline"));
|
alert(this.$t("errors.offline"));
|
||||||
this.$router.push({ name: "home" });
|
this.$router.push({ name: "home" });
|
||||||
}
|
}
|
||||||
|
|
12
user.go
12
user.go
|
@ -4,7 +4,6 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
|
@ -110,16 +109,7 @@ func redirectUserHandler(c echo.Context) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query := make(url.Values)
|
return c.Redirect(http.StatusFound, "/offline")
|
||||||
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())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AudonUser) Equal(u *AudonUser) bool {
|
func (a *AudonUser) Equal(u *AudonUser) bool {
|
||||||
|
|
Ładowanie…
Reference in New Issue