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/.
添加回答
举报
0/150
提交
取消