Code Monkey home page Code Monkey logo

Comments (3)

ClarkXia avatar ClarkXia commented on July 22, 2024

提供下具体的代理设置和问题复现步骤

from ice-scripts.

sanlangguo avatar sanlangguo commented on July 22, 2024

1.ice.config.js 配置详情如下

const path = require('path');

module.exports = {
 hash: true,
 entry: 'src/index.jsx',
 publicPath: './',
 outputDir: 'dist',
 plugins: [
 ['ice-plugin-fusion', {
  themePackage: '@icedesign/theme',
 }],
 ['ice-plugin-moment-locales', {
  locales: ['zh-cn'],
 }],
 ['ice-plugin-load-assets', {
 assets: {
 dev: ['https://unpkg.com/[email protected]/umd/react.development.js',           'https://cdnjs.cloudflare.com/ajax/libs/axios/0.19.2/axios.min.js', 'https://unpkg.com/[email protected]/umd/react-dom.development.js'],
    build: ['https://unpkg.com/[email protected]/umd/react.production.min.js', 'https://cdnjs.cloudflare.com/ajax/libs/axios/0.19.2/axios.min.js', 'https://unpkg.com/[email protected]/umd/react-dom.production.min.js'],
  },
}],
 ],
 alias: {
  '@': path.resolve(__dirname, './src/'),
  },
 chainWebpack: (config) => {
 config.devServer.hot(true);
 },
 define: {
  ENV: JSON.stringify(process.env.ENV),
 },
 proxy: {
  "/**": {
   "enable": true,
    "target": "http://127.0.0.1:4444" 或者 http://192.168.3.17:4444
}
  }
 };
  1. axios 配置如下

    const service = axios.create({
    baseURL: ‘https://exam.com’,
    headers: {
    'content-type': 'application/json;charset=UTF-8;',
    },
    });

3.然后访问 http://192.168.3.17:4444或者 http://127.0.0.1:4444,均出现

Error occurred while trying to proxy request /d08f25d3db064a8b5efb.hot-update.json from 127.0.0.1
:4444 to http://127.0.0.1:4444 (EADDRINUSE) (https://nodejs.org/api/errors.html#errors_common_system_er
rors)

Error occurred while trying to proxy request /api/mobile/management/login from 192.168.3.17:4444
to http://192.168.3.17:4444/ (ENOBUFS) (https://nodejs.org/api/errors.html#errors_common_system_errors)

from ice-scripts.

ClarkXia avatar ClarkXia commented on July 22, 2024

默认 devserver 访问就是 http://127.0.0.1:4444 ,不需要再代理了, 可以尝试下代理到其他地址是否正常

from ice-scripts.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.