Giter VIP home page Giter VIP logo

cml-yanxuan's Issues

cml build后的发布包首页无法正常显示

bug描述 cml build后的发布包首页无法正常显示

复现bug的步骤

npm install -g http-server
cd cml-yanxuan
修改 chameleon.config.js
const publicPath = 'http://192.168.0.108:8080/cml-yanxuan/dist';
// 设置api请求前缀
const apiPrefix = 'http://192.168.0.108:8080';
cml build
cd ..
http-server
访问 http://192.168.0.108:8080/cml-yanxuan/dist/web/cml-yanxuan.html#/
无法正常显示
但是点击进入/cml/h5/list 页面却显示正常

试了下官方发布的地址也是同样的问题
https://chameleon-team.github.io/cml-yanxuan/dist/web/cml-yanxuan.html#/

经调试发现index页下相关cml.get的调用返回的res都是string,因此res.code为undefined,if(res.code ==0){} 这个逻辑不会被调用,而list页面确实正常的

      cml.get({
        url: '/cml-yanxuan/mock/getHomeImgList.json'
      }).then(res => {
        if (res.code == 0) {
          const {special, disscountPriceImgUrl} = res.data;
          this.special = special;
          this.disscountPriceImgUrl = disscountPriceImgUrl;
        }
      }).catch(err => {
        console.log(err)
      })

问题截图

编译环境信息
chameleon-tool 版本:[email protected]
nodejs版本、npm版本:[node v10.9.0、npm 6.2.0]
电脑操作系统:windows8 amd64
运行环境信息

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.