XMLHttpRequest cannot load http://127.0.0.1:8090/api/list. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
XMLHttpRequest cannot load http://127.0.0.1:8090/api/list. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
2019-06-15
跨域了,不過你是本地請求一般不會出現。。。有可能你電腦上訪問html頁面 使用的localhost,host文件里面沒有localhost的dns配置?
在Handler函數內第一行添加w.Header().Set("Access-Control-Allow-Origin", "*"),設置請求的域名可以為任意域名。
2020-11-28
在函數getFileListHandler中第一行添加w.Header().Set("Access-Control-Allow-Origin", "*"),就解決獲取視頻列表跨越問題了。?