第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

怎么解決fetch的跨域問(wèn)題?現(xiàn)在在用react-router做一個(gè)SPA

怎么解決fetch的跨域問(wèn)題?現(xiàn)在在用react-router做一個(gè)SPA

MMTTMM 2018-10-18 13:11:47
現(xiàn)在在用react-router做一個(gè)SPA應(yīng)用,也存在跨域問(wèn)題,但是我在網(wǎng)上看見(jiàn)別人有的web頁(yè)面可以請(qǐng)求到,是不是別人自己用服務(wù)器做處理了?項(xiàng)目地址fetch(getLatestNews(),{          method: 'GET',          mode: 'cors',      })      .then((response) => {          console.log(response)        if (response.ok) {          return response.json()        }      })      .then((responseData) => {                  this.setState({          isLoaded: true,        })      })      .catch(() => {        this.setState({          isLoaded: false,        })      });警告Fetch API cannot load http://news-at.zhihu.com/api/... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.xboxyan.com' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 862 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)