错误信息如下:
OPTIONS https://ip:1234/... 405 (Method Not Allowed)
XMLHttpRequest cannot load https://IP:1234/.... Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://IP:8443' is therefore not allowed access. The response had HTTP status code 405.
跨域原因引起的,个人服务端web.py新增OPTIONS函数
# 解决跨域访问问题
def OPTIONS(self):
web.header('Access-Control-Allow-Origin', '*')
web.header('Access-Control-Allow-Headers', 'Content-Type, Access-Control-Allow-Origin, Access-Control-Allow-Headers, X-Requested-By, Access-Control-Allow-Methods')
web.header('Access-Control-Allow-Methods', 'POST, GET,