Giter Site home page Giter Site logo

eyes-world-fe's Introduction

eyes-world-fe

A Vue.js project

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

For detailed explanation on how things work, checkout the guide and docs for vue-loader.

前端从后端取数据

**注意:**fetch 的请求网址为后端接口,不同页面可能有不同的接口,具体请参考接口文档 https://github.com/eyes-world/eyes-world-api/blob/master/api.md

// 代码示例
fetch('http://39.108.149.106/login/tv/login', {
  mode: 'cors',
  method: 'POST',
  headers: {
    'Access-Control-Allow-Credentials': true,
    'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8',
  },
  credentials: "include",
  body: 'marker=' + this.marker
}).then(function(response) {
  return response.json();
}).then(function(getData) {
  // getData (可自己命名) 即为从后端收到的 JSON 数据, 可直接使用
})

具体也可以参考 login.vue

获取数据测试

请先在 localhost:{你的端口号}/#/login (最好在新建标签页里输入此地址) 下点击链接,输入

用户名 密码
mike 123

进行登录,然后点击 <登录> 按钮,然后回到你的原工程网页,刷新,便可以获取到后端数据

eyes-world-fe's People

Contributors

chazikaifa avatar dsev7n avatar icyzeroice avatar jeromeyangtao avatar yongjianx avatar zhuanget avatar

Watchers

 avatar  avatar

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.