1.vue項目為了打包后運維人員能夠修改后臺服務地址,所以使用了ajax同步請求,但是chrome給了警告??我的項目的根目錄是可以請求到的,然后和相對應的地址拼接的。let baseUrlimport { Ajax } from './components/commonjs/ajax.js'Ajax.get('./static/baseApi.json', function (res) {let jsonRes = JSON.parse(res)console.log('請求的內容:', jsonRes.baseUrl)baseUrl = jsonRes.baseUrltempstaticUrl = jsonRes.staticUrltempmodelLoadedUrl = jsonRes.modelLoadedUrl})// let baseUrl = '/CpyService'console.log('當前訪問的后臺地址是:', baseUrl)export default {authCode: baseUrl + '/AuthImageCode/authCode'}但是chrome的控制臺給出了警告:ajax.js?4a26:6 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
vue項目為了打包后運維人員能夠修改后臺服務地址,所以使用了ajax同步請求,但是chrome給了警
一只名叫tom的貓
2018-11-14 14:15:51