CORS跨域问题:No 'Access-Control-Allow-Origin' header is present on the requested resource.

问题描述

服务器成功返回,但是报异常


image

image

image

问题分析

报错信息中存在CORS关键字,考虑为跨域问题

解决方式

在返回的响应头中加入以下信息

Access-Control-Allow-Origin: http://192.168.1.102
Access-Control-Allow-Credentials: true
Content-Type: text/html; charset=utf-8

你可能感兴趣的:(CORS跨域问题:No 'Access-Control-Allow-Origin' header is present on the requested resource.)