zoukankan      html  css  js  c++  java
  • vue-socket.io跨域问题的解决方法

    报错信息:

    1 Access to XMLHttpRequest at 'http://192.168.37.130:5050/socket.io/?EIO=3&transport=polling&t=N0oqNsW' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    2 vue-socketio.js?70bb:8 GET http://192.168.37.130:5050/socket.io/?EIO=3&transport=polling&t=N0oqNsW net::ERR_FAILED

    解决办法:

     1 //vue.config.js
     2 
     3 module.exports = {
     4   devServer: {
     5     proxy: {
     6         '/socket.io': {
     7           target: 'http://192.168.37.130:5050',
     8           ws: true,
     9           changeOrigin: true
    10         },
    11         'sockjs-node': {
    12           target: 'http://192.168.37.130:5050',
    13           ws: false,
    14           changeOrigin: true
    15         },
    16     }
    17 
    18   }
    19 }
  • 相关阅读:
    sort()
    type()
    reverse()
    pop()
    remove()
    max()
    len()
    Ext.Js核心函数( 三)
    聚簇索引和非聚簇索引区别
    Ext.js入门(二)
  • 原文地址:https://www.cnblogs.com/zhengze/p/12294916.html
Copyright © 2011-2022 走看看