請求方式:
當前域地址:http://192.168.1.78:9080/testGit/
(index):1 Failed toload http://192.168.1.78:8800/bronzecoll/share/shareNews?id=1: No'Access-Control-Allow-Origin' header is present on the requested resource.Origin 'http://192.168.1.78:9080' is therefore not allowed access.
請求服務端地址:http://192.168.1.78:8800/bronzecoll/share/shareNews?id=1
服務端配置:
Controller頭部配置註解:@CrossOrigin(origins = "*", maxAge = 3600)//跨越請求配置
數據獲取就正常了
怎麼樣,很簡單吧!第一次使用記錄下來。