将多个图像上传到服务器而无需同时访问两个 ajax 调用的同一会话?

Uploading multiple image to server without accessing same session with two ajax call simultaneously ?

我正在尝试使用 ajax 调用上传多张图片,但是当两个 ajax 调用请求同一个会话时,我的登录信息会注销,所以我正在尝试同步上传它使用 ajax 的方式。 我应该如何使用 ajax 进行异步上传

Chrome: 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/.

由于同步 XMLHttpRequest 在 Chrome 和 Firefox 中 已弃用 ,您可以像这样执行同步操作:

async function sendRequest() {
    let response = await this.$http.get('/someUrl')
    console.log(response.body)
}