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

问题描述

服务器成功返回,但是报异常
CORS跨域问题:No 'Access-Control-Allow-Origin' header is present on the requested resource.
CORS跨域问题:No 'Access-Control-Allow-Origin' header is present on the requested resource.
CORS跨域问题:No 'Access-Control-Allow-Origin' header is present on the requested resource.

问题分析

报错信息中存在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.

上一篇:MySQL 游标


下一篇:MFC 提供的ODBC类