![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
前后端数据交互
走马川行雪
这个作者很懒,什么都没留下…
展开
-
前端通过ajax同时上传文件和其它信息,SpringMVC后台接收
1、前端写法描述:通过前端上传一些注册信息,其中包括选择的文件信息。代码://标签写法<input type="text" name="username" id="username" /><input type="password" name="password" id="password" /><input type="file" name="i...原创 2019-07-29 22:01:31 · 1437 阅读 · 1 评论 -
解决ajax中No ‘Access-Control-Allow-Origin‘ header is present on the requested resource跨域问题
ajax跨域只是属于浏览器“同源策略”中的一部分,如果前端html页面通过ajax访问后台服务时,两个服务不在同一个域上会存在跨域问题。具体报错如下:解决办法:1、如果是spring或SpringBoot项目在访问的接口处添加@CrossOrigin注解,其中有两个参数如下,如果不加则代表允许所有ip访问origins: 允许可访问的域列表 maxAge:准备响应前的...原创 2019-08-07 14:17:38 · 6304 阅读 · 1 评论