diff --git a/src/main/java/com/io/realworld/security/WebConfig.java b/src/main/java/com/io/realworld/security/WebConfig.java index 332e1f4..c272838 100644 --- a/src/main/java/com/io/realworld/security/WebConfig.java +++ b/src/main/java/com/io/realworld/security/WebConfig.java @@ -38,27 +38,19 @@ public class WebConfig { } @Bean - @Order(0) - public SecurityFilterChain resources(HttpSecurity http) throws Exception { - http.csrf().disable() - .requestMatchers((matchers) -> {matchers.antMatchers("/h2-console/**"); - matchers.antMatchers(HttpMethod.GET,"/api/articles/**","/**");}) + public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { + http.csrf() + .disable() + .requestMatchers((matchers) -> { + matchers.antMatchers("/h2-console/**"); + matchers.antMatchers(HttpMethod.GET,"/api/articles/**","/**"); + matchers.mvcMatchers("/api/users/**"); + }) .authorizeHttpRequests((authorize) -> authorize.anyRequest().permitAll()) .requestCache().disable() .securityContext().disable() .sessionManagement().disable() - .headers().frameOptions().disable(); - - return http.build(); - } - - @Bean - public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { - http.csrf() - .disable() - .authorizeRequests() - .mvcMatchers("/api/users/**").permitAll() - .anyRequest().authenticated() + .headers().frameOptions().disable() .and() .formLogin() .disable() diff --git a/src/vite-frontend/src/components/ArticleListFeed.vue b/src/vite-frontend/src/components/ArticleListFeed.vue index 7331ed3..a6c531c 100644 --- a/src/vite-frontend/src/components/ArticleListFeed.vue +++ b/src/vite-frontend/src/components/ArticleListFeed.vue @@ -52,6 +52,7 @@ export default defineComponent({ }) onMounted(() => { + axios.get(url + "/api/articles/feed",{ headers:{ Authorization : "TOKEN " + token diff --git a/src/vite-frontend/src/components/ArticleListGlobal.vue b/src/vite-frontend/src/components/ArticleListGlobal.vue index a5817d6..faf0623 100644 --- a/src/vite-frontend/src/components/ArticleListGlobal.vue +++ b/src/vite-frontend/src/components/ArticleListGlobal.vue @@ -13,7 +13,9 @@ {{art.favoritesCount}} - +

{{art.title}}

{{art.description}}

Read more... @@ -23,7 +25,7 @@ diff --git a/src/vite-frontend/src/views/TheHome.vue b/src/vite-frontend/src/views/TheHome.vue index 8d00e47..3e526bf 100644 --- a/src/vite-frontend/src/views/TheHome.vue +++ b/src/vite-frontend/src/views/TheHome.vue @@ -46,7 +46,6 @@ :value2="isEmpty" @loading="onChangeLoading" @emptied="emptyCheck"> -
@@ -67,7 +66,7 @@ import articleList from '@/components/ArticleListFeed.vue' import articleListGlobal from "@/components/ArticleListGlobal.vue"; import tagLists from "@/components/TagList.vue"; -import {ref} from "vue"; +import {ref, getCurrentInstance, onMounted} from "vue"; import {useStore} from "vuex"; export default { name: "TheHome", @@ -91,6 +90,7 @@ export default { isEmpty.value = val; } + const feedSelect = () => { feedActive.value=true; globalActive.value=false;