в публичных страницах убрал мидлварь

This commit is contained in:
Dhaverd 2025-04-02 16:44:39 +08:00
parent 0f66d00f96
commit 2f03560ef1
4 changed files with 15 additions and 5 deletions

View File

@ -5,6 +5,9 @@ function auth(to, from, next){
if (to.path === '/'){
next({path: '/wishlist'});
}
if (to.path.includes('/api')){
next();
}
if (to.path === '/auth_options' || to.path === '/login' || to.path === '/registration'){
if (useUserStore().token !== null){
next({path: '/wishlist'});

View File

@ -16,6 +16,13 @@ const vuetify = createVuetify({
const pinia = createPinia()
import router from './js/router.js'
// import router from './js/router.js'
const routes = [
]
const router = createRouter({
history: createMemoryHistory(),
routes,
})
createApp(PublicApp).use(vuetify).use(router).use(pinia).mount("#app")

View File

@ -44,7 +44,7 @@
</v-dialog>
</v-card-title>
<v-card-text class="d-flex justify-center align-center h-auto">
<ShowWhishlist/>
<ShowWishlist/>
</v-card-text>
</v-card>
<FeedbackFooter/>
@ -53,7 +53,7 @@
</template>
<script>
import ShowWhishlist from "./PublicWishlist/ShowWhishlist.vue";
import ShowWishlist from "./PublicWishlist/ShowWishlist.vue";
import {useUserStore} from "../store/user.js";
import { watch } from "vue";
import Login from "./Auth/Login.vue";
@ -61,7 +61,7 @@ import Registration from "./Auth/Registration.vue";
import FeedbackFooter from "./PublicWishlist/FeedbackFooter.vue";
export default {
name: "Public",
components: {FeedbackFooter, Registration, Login, ShowWhishlist},
components: {FeedbackFooter, Registration, Login, ShowWishlist},
data: ()=>({
isAuthenticated: false,
isWide: window.innerWidth >= 800,

View File

@ -6,7 +6,7 @@ import CreateWish from "../Wishlist/CreateWish.vue";
import EditWish from "../Wishlist/EditWish.vue";
import {watch} from "vue";
export default {
name: "ShowWhishlist",
name: "ShowWishlist",
components: {EditWish, CreateWish, DeleteWish},
data: () => ({
isAuthenticated: false,