ERRORNetwork ErrorAxiosError@webpack-internal:///./node_modules/axios/lib/core/AxiosError.js:23:18

这篇具有很好参考价值的文章主要介绍了ERRORNetwork ErrorAxiosError@webpack-internal:///./node_modules/axios/lib/core/AxiosError.js:23:18。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

错误:

ERROR
Network Error
AxiosError@webpack-internal:///./node_modules/axios/lib/core/AxiosError.js:23:18
handleError@webpack-internal:///./node_modules/axios/lib/adapters/xhr.js:155:14
EventHandlerNonNull*dispatchXhrRequest@webpack-internal:///./node_modules/axios/lib/adapters/xhr.js:152:5
__webpack_exports__.default<@webpack-internal:///./node_modules/axios/lib/adapters/xhr.js:57:10
dispatchRequest@webpack-internal:///./node_modules/axios/lib/core/dispatchRequest.js:53:10
promise callback*request@webpack-internal:///./node_modules/axios/lib/core/Axios.js:117:27
forEachMethodNoData/Axios.prototype[method]@webpack-internal:///./node_modules/axios/lib/core/Axios.js:157:17
wrap@webpack-internal:///./node_modules/axios/lib/helpers/bind.js:9:15
mounted@webpack-internal:///./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/views/HomeView.vue?vue&type=script&lang=js&:22:60
invokeWithErrorHandling@webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:2889:57
callHook$1@webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:3862:30
insert@webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:4227:17
invokeInsertHook@webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:6518:30
patch@webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:6706:21
lifecycleMixin/Vue.prototype._update@webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:3605:19
updateComponent@webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:3703:10
Watcher</Watcher.prototype.get@webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:3295:27
Watcher</Watcher.prototype.run@webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:3366:24
flushSchedulerQueue@webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:3949:13
nextTick/<@webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:3008:12
flushCallbacks@webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:2936:14
promise callback*timerFunc@webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:2961:9
nextTick@webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:3018:5
queueWatcher@webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:4031:13
Watcher</Watcher.prototype.update@webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:3357:19
Dep</Dep.prototype.notify@webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:761:11
reactiveSetter@webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:971:13
init/</<@webpack-internal:///./node_modules/vue-router/dist/vue-router.esm.js:2503:7
init/<@webpack-internal:///./node_modules/vue-router/dist/vue-router.esm.js:2502:19
updateRoute@webpack-internal:///./node_modules/vue-router/dist/vue-router.esm.js:2031:19
transitionTo/<@webpack-internal:///./node_modules/vue-router/dist/vue-router.esm.js:1898:14
confirmTransition/</<@webpack-internal:///./node_modules/vue-router/dist/vue-router.esm.js:2020:17
step@webpack-internal:///./node_modules/vue-router/dist/vue-router.esm.js:1746:7
step@webpack-internal:///./node_modules/vue-router/dist/vue-router.esm.js:1753:13
怎么解决

不知道为什么,明明已经加了注解@CrossOrigin,但是还是跨域问题,数据不响应!

还是加了配置才可以访问文章来源地址https://www.toymoban.com/news/detail-767208.html

package com.xtc.common;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;

@Configuration
public class CorsConfig {

    // 当前跨域请求最大有效时长。这里默认1天
    private static final long MAX_AGE = 24 * 60 * 60;

    @Bean
    public CorsFilter corsFilter() {
        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
        CorsConfiguration corsConfiguration = new CorsConfiguration();
        corsConfiguration.addAllowedOrigin("*"); // 1 设置访问源地址
        corsConfiguration.addAllowedHeader("*"); // 2 设置访问源请求头
        corsConfiguration.addAllowedMethod("*"); // 3 设置访问源请求方法
        corsConfiguration.setMaxAge(MAX_AGE);
        source.registerCorsConfiguration("/**", corsConfiguration); // 4 对接口配置跨域设置
        return new CorsFilter(source);
    }
}

到了这里,关于ERRORNetwork ErrorAxiosError@webpack-internal:///./node_modules/axios/lib/core/AxiosError.js:23:18的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • improve-gzip引入后node_modules中.cache compression-webpack-plugin占用内存过多

    1.Gzip Gzip(GNU zip)是一种常见的文件压缩格式和压缩算法,通常用于在 Web 服务器上对静态资源文件进行压缩,以减小文件大小并加快文件传输速度。在前端开发中,经常会使用 Gzip 压缩来优化网站的性能。 Gzip 压缩通过移除文件中的重复数据和不必要的信息来减小文件大小

    2024年02月20日
    浏览(30)
  • webpack报错:Module build failed (from ./node_modules/babel-loader/lib/index.js)

    webpack打包的时候报错,报错信息如下: ERROR in ./static/js/index.js Module build failed (from ./node_modules/babel-loader/lib/index.js): TypeError: this.getOptions is not a function 报错原因 :使用了高版本的babel-loader,导致babel-loader和babel-core版本冲突,我降低之前babel-loader为9版本 解决办法 :降低babel

    2024年02月12日
    浏览(35)
  • 运行 npm run build,报错:Module build failed (from ./node_modules/image-webpack-loader/index.js)

    目录 问题描述: 解决方案: 第一步卸载image-webpack-loader 第二步下载image-webpack-loader 方式一 方式二 第三步再次执行打包 运行 npm run build,报错 下载呢,有两种方式,方式一不行了就尝试方式二吧~ 方式一 --save-dev  选项的作用是将该软件包添加为项目的开发依赖项。 方式二

    2024年02月07日
    浏览(33)
  • webpack 使用打包报错 ERROR in node_modules\@types\node\ts4.8\assert.d.ts

    报错如下: 解决方式,先查看自己的 node 版本 然后再安装 @types/node 对应版本,比如我的如下 然后再次打包,就没有报错了

    2024年02月04日
    浏览(36)
  • 在uniapp开发编译成小程序时,模板编译错误Module build failed (from ./node_modules/@dcloudio/webpack-uni-mp-loader/lib/

    解决方案:应该是你的ifdef 和 endif不匹配。你自己看看你的代码,是不是有的地方只有一个endif或者只有ifdef,或者说写错了,检查下。我的就是少了endif. 希望我的解决方案能帮到你

    2024年02月16日
    浏览(42)
  • ide internal errors【bug】

    2023-8-15 12:36:59 以下内容源自《【bug】》 仅供学习交流使用 禁止其他平台发布时删除以下此话 本文首次发布于CSDN平台 作者是CSDN@日星月云 博客主页是https://blog.csdn.net/qq_51625007 禁止其他平台发布时删除以上此话 内存不够 导致IDEA运行不了 浏览器也运行不了 使用命令行配置

    2024年02月12日
    浏览(30)
  • Internal connection fatal error

    mssql数据库的一个错误。打开mssql数据库连接的时候会报出这个错误。 数据库是mssql 2019。 语言是NET 8. 项目类型是 .NET WebAPI。 首先排除了代码问题。连接数据库代码复用到其他项目里面完全没有问题。 同一个链接字符串放到这个代码里面也没有问题。 于是我怀疑是这个类库

    2024年02月04日
    浏览(32)
  • .NET Moq mock internal类型

    在AssemblyInfo.cs文件里添加 InternalsVisibleTo 声明 参考:https://github.com/devlooped/moq/wiki/Quickstart .NET 5以后默认不再生成AssemblyInfo.cs文件,因此需要在项目的csproj文件里添加 InternalsVisibleTo 配置 https://github.com/devlooped/moq/wiki/Quickstart https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-p

    2024年02月04日
    浏览(28)
  • QMimeDatabase: Error loading internal MIME data An error has been encountered at line 1 of <internal

    QMimeDatabase: Error loading internal MIME data An error has been encountered at line 1 of : Premature end of document.: Traceback (most recent call last): File “D:anacondalibsite-packageslibscanvas.py”, line 530, in paintEvent p.drawLine(self.prev_point.x(), 0, self.prev_point.x(), self.pixmap.height()) TypeError: arguments did not match any overlo

    2024年02月06日
    浏览(33)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包