【发布时间】:2019-05-01 07:22:31
【问题描述】:
从源“http://127.0.0.1:8080”访问“http://localhost:8545/”处的 XMLHttpRequest 已被 CORS 策略阻止:对预检请求的响应未通过访问控制检查:“Access-Control-Allow-Credentials”的值' 响应中的标头是 '',当请求的凭据模式为 'include' 时,它必须为 'true'。 XMLHttpRequest 发起的请求的凭证模式由 withCredentials 属性控制。
Web3js 版本:0.20.7
使用以下命令运行:
geth --datadir ./peer2DataDir --rpc --rpcport 8545 --rpcaddr 127.0.0.1 --rpccorsdomain "http://127.0.0.1:8080" --networkid 1114 --port 30303 console 2>> myEth.log
【问题讨论】:
-
--rpccorsdomain "*"怎么样? -
@ZulhilmiZainudin 没有帮助:(