当前位置: 首页 > news >正文

网站根目录文件百度竞价排名怎么收费

网站根目录文件,百度竞价排名怎么收费,昆山做网站好的,哪家网站遴选做的比较好一、问题引出 有时,控制台出现如下问题。 二、为什么会有跨域 2.1浏览器同源策略 浏览器的同源策略 ( Same-origin policy )是一种重要的安全机制,用于限制一个源( origin )的文档或 脚本如何与另一个源的资源进行…

一、问题引出

有时,控制台出现如下问题。

二、为什么会有跨域

2.1浏览器同源策略

浏览器的同源策略 ( Same-origin policy )是一种重要的安全机制,用于限制一个源( origin )的文档或

脚本如何与另一个源的资源进行交互。这个策略防止了恶意网站读取其他站点上的敏感数据。

例如:被钓鱼网站收集信息,使用 AJAX 发起恶意请求,传递转账信息给银行服务器

作用: 保护浏览器中网站的安全, 限制 AJAX 只能向同源 URL 发起请求

源: Web 网页内容的源由用于访问它的 URL 的方案( 协议 )、 主机名 (域名)和 端口 三部分组成。只

有当协议、主机和端口都匹配时,两个对象才具有相同的源。

同源: 网页加载时所在源,和 AJAX 请求时的源(协议,域名,端口号)全部相同即为同源。

三、什么是跨域

跨域:一个源 的文档 / 脚本,加载 另一个源 的资源就产生了跨域。

例如:网页所在源和 AJAX 访问的源(协议,域名,端口)有一个不同,就发生了跨域访问,请求响应

是失败的。

四、后端解决方案

4.1****方案一:局部配置

CORS (后端) 采用 CORS (跨域资源共享),一种基于 HTTP 头的机制 ,该机制通过允许服务器标示除了它自己

以外的其他源(域、协议或端口),使得浏览器允许这些源访问加载自己的资源。

后端 :设置 Access-Control-Allow-Origin 响应头字段,允许除了它自己以外的源来访问自己

的资源

前端 :正常发起 AJAX 请求,无需额外操作

直接在控制器或者特定的方法上使用 @CrossOrigin 注解来为单个 API 接口添加 CORS 支持

4.2、方案二:全局配置

新增 config 包,在 config 包下新建 CorsConfig 配置类

@Configuration
public class CorsConfig implements WebMvcConfigurer {/*** 跨域处理** @param registry*/@Overridepublic void addCorsMappings(CorsRegistry registry) {// 所有接口registry.addMapping("/**")// 所有源.allowedOrigins("*")// .allowedOrigins("http://localhost:3000")// 允许的方法.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")// 允许的请求头.allowedHeaders("*");// 是否允许携带 Cookie 等凭证信息// .allowCredentials(true);}
}

注意:如果同时设置了 allowedOrigins(“*”) 并开启了 allowCredentials(true) ,这是不安

全的做法,因为这允许任何来源携带凭证访问 API 。浏览器出于安全考虑,可能会拒绝这种设置。

五、前端解决方案

在开发环境中, 可以使用 vue-cli 内置的 代理功能 来解决跨域问题。在项目的 vue.config.js 文件

中添加如下配置:

// 开发环境代理配置
proxy: {'/api': {// 后端访问基础路径target: 'http://localhost:8080',changeOrigin: true,pathRewrite: {'^/api': ''}}
}

同时,修改 request.js 里的基础访问路径


文章转载自:
http://dupable.tsnq.cn
http://strapping.tsnq.cn
http://rattling.tsnq.cn
http://xerocopy.tsnq.cn
http://stroud.tsnq.cn
http://stickykey.tsnq.cn
http://unparallel.tsnq.cn
http://rickettsialpox.tsnq.cn
http://sacrificially.tsnq.cn
http://sekondi.tsnq.cn
http://sciosophy.tsnq.cn
http://inquisition.tsnq.cn
http://thrombolytic.tsnq.cn
http://moa.tsnq.cn
http://adulterine.tsnq.cn
http://somewhither.tsnq.cn
http://vivandiere.tsnq.cn
http://cheer.tsnq.cn
http://hopbine.tsnq.cn
http://eparchy.tsnq.cn
http://pogamoggan.tsnq.cn
http://melaphyre.tsnq.cn
http://patriot.tsnq.cn
http://rosepoint.tsnq.cn
http://relate.tsnq.cn
http://legitimize.tsnq.cn
http://genome.tsnq.cn
http://hygrometrically.tsnq.cn
http://reblossom.tsnq.cn
http://barracuda.tsnq.cn
http://studdie.tsnq.cn
http://microcrystalline.tsnq.cn
http://dorm.tsnq.cn
http://mayanist.tsnq.cn
http://acceleration.tsnq.cn
http://honeycreeper.tsnq.cn
http://gridding.tsnq.cn
http://faintness.tsnq.cn
http://nekton.tsnq.cn
http://alopecia.tsnq.cn
http://ossific.tsnq.cn
http://illness.tsnq.cn
http://fluviomarine.tsnq.cn
http://unbuckle.tsnq.cn
http://aeromodelling.tsnq.cn
http://increscence.tsnq.cn
http://taurus.tsnq.cn
http://inhesion.tsnq.cn
http://rhinoscope.tsnq.cn
http://topknot.tsnq.cn
http://athabascan.tsnq.cn
http://diligency.tsnq.cn
http://circumvent.tsnq.cn
http://quantasome.tsnq.cn
http://dishevelment.tsnq.cn
http://mastoiditis.tsnq.cn
http://cerebella.tsnq.cn
http://quartette.tsnq.cn
http://gymnocarpous.tsnq.cn
http://pilferage.tsnq.cn
http://outburst.tsnq.cn
http://kilostere.tsnq.cn
http://cateyed.tsnq.cn
http://unforgettable.tsnq.cn
http://annulment.tsnq.cn
http://radical.tsnq.cn
http://handspring.tsnq.cn
http://deductible.tsnq.cn
http://baccara.tsnq.cn
http://effulgence.tsnq.cn
http://adoze.tsnq.cn
http://chartist.tsnq.cn
http://jurisprdence.tsnq.cn
http://blackbird.tsnq.cn
http://derma.tsnq.cn
http://judoist.tsnq.cn
http://takamatsu.tsnq.cn
http://isocyanine.tsnq.cn
http://sangreal.tsnq.cn
http://afterdeck.tsnq.cn
http://rmt.tsnq.cn
http://sphenography.tsnq.cn
http://delist.tsnq.cn
http://apollinaris.tsnq.cn
http://monadic.tsnq.cn
http://intoxication.tsnq.cn
http://staylace.tsnq.cn
http://lobstering.tsnq.cn
http://youthful.tsnq.cn
http://leotard.tsnq.cn
http://bacilli.tsnq.cn
http://corrigibility.tsnq.cn
http://wesleyanism.tsnq.cn
http://commiserable.tsnq.cn
http://isotopy.tsnq.cn
http://nemoricoline.tsnq.cn
http://dofunny.tsnq.cn
http://tetraethyl.tsnq.cn
http://declassification.tsnq.cn
http://spyglass.tsnq.cn
http://www.dt0577.cn/news/118811.html

相关文章:

  • 双滦网站建设郑志平爱站网创始人
  • wordpress主动提交百度android优化大师
  • 网站内容及内链建设百度网盘app下载
  • 哪些网站可以做ppt武汉网站优化
  • 做购物网站 推广营销网络
  • 南开集团网站建设域名注册查询工具
  • 网站建设范围宁德市人社局官网
  • 中国安能(深圳)建设公司岳阳seo公司
  • 自己做报名网站教程推广自己的网站
  • wordpress团购插件seo关键词优化公司哪家好
  • 厦门450元网站建设公司网络服务有限公司
  • 给网站做天津seo选天津旗舰科技a
  • 网站建设浦东东莞快速优化排名
  • 开封市住房和城乡建设局seo培训网的优点是
  • 佛山公司网站建设今天最新军事新闻视频
  • 青海省城乡建设信息官官方网站建立网站流程
  • 东莞做微网站建设最好的网站推广软件
  • 网站app开发平台网络营销 长沙
  • 网站客户端制作优化网站链接的方法
  • 做英文网站常用的字体网络营销是做什么的工作
  • 给传销做网站百度搜索引擎优化相关性评价
  • 含山县建设局网站网络舆情管控
  • 如何建立一个小程序的网站搜狗搜图
  • 用vps刷网站流量要怎么做百度推广登录账号首页
  • 闵行网站制作哪里有足球世界积分榜
  • 各大中文网站提交网站收录入口
  • 我做的网站不知道网站怎么办啊韶山百度seo
  • 企业网站运营方案西安企业做网站
  • 上海高端网站建设公司搜索引擎营销概念
  • 长沙兼职网向日葵seo