Я вывожу фотки через api ( использую для этого fetch ) и мне прилетает CORB, я много чего пробовал, но без успешно, получаю ошибку :
Cross-Origin Read Blocking (CORB) blocked cross-origin response with MIME type application/json. See for more details.
vuex код для доступа к api
export default{
state: {
posts: [],
perPage: 15,
page: 1,
total: 0,
loading: false,
s: []
},
getters: {
numPages: state => Math.ceil( state.total / state.perPage ),
},
mutations: {
updateLoading: ( state, loading ) => state.loading = loading,
updatePosts: ( state, { posts, total, page } ) => Object.assign( state, { posts, total, page } ),
},
actions: {
async fetchPosts( { commit, state }, page ) {
commit('updateLoading', true)
const params = router.currentRoute
const start = ( page - 1 ) * state.perPage;
const url = `/api/photos?${ params.name }=true&start=${ start }&limit=15`
try {
const response = await fetch( url, { headers: { 'Content-Type': 'application/json', } } )
const posts = await response.json()
const total = posts.totalItems
commit( 'updatePosts', { posts, total, page })
} catch (e) {
console.error(e)
}
commit( 'updateLoading', false )
},
}
}
и настройка proxy
devServer: {
proxy: {
'/api': {
target: 'http://gallery.dev.webant.ru',
ws: true,
changeOrigin: true,
}
}
},