Giter Club home page Giter Club logo

kdrp_admin's Introduction

#分销后台前端 基于antd-admin

开发及构建

目录结构

├── /mock/           # 数据mock的接口文件
├── /dist/           # 项目输出目录
├── /src/            # 项目源码目录
│ ├── /static/       # 静态文件 image……
│ ├── /components/   # 项目组件
│ ├── /routes/       # 路由组件
│ ├── /models/       # 数据模型
│ ├── /services/     # 数据接口
│ ├── /utils/        # 工具函数
│ ├── route.js       # 路由配置
│ ├── index.js       # 入口文件
│ └── index.html     
├── package.json     # 项目信息
└── proxy.config.js  # 数据mock配置

快速开始

分支:

开发:dev   
测试:test 
预生产:proprod 
生产:master 

进入目录安装依赖:

npm i 或者 yarn install

开发:

需要在本地安装nginx,具体配置参见:https://coding.net/s/b912a81f-3d8b-4693-80c2-73c6ae05ab77

npm run dev    # 使用mock拦截请求,数据存储在localStroge里;否则请求开发环境接口。

打开 http://localhost 或者 127.0.0.1

构建:

npm run build

将会生成dist目录

注意事项

  • 生产环境中,已有数据接口,请将src/utils/index.js第四行 require('./mock.js')注释
  • 开发环境中,如再mock目录新增文件,请在src/utils/mock.js第二行的mockData数组中添加
  • 开发环境中,如需要调试开发环境接口,在mock中将api/xxx/xx/的前面加上off/
  • 如需重写antd样式配置,请修改src/theme.js
  • 项目配置文件在src/utils/config.js
  • 如需重写异步请求函数,请修改src/utils/request.js (关于为什么使用robe-ajax而不是fetch:在一个无服务器的环境中模拟数据请求,Mock不能拦截Fetch,只能拦截XHR,所以我选了一个类似jquery Ajax的库robe-ajax)

kdrp_admin's People

Contributors

chenghao1992 avatar

Stargazers

 avatar buzai avatar

Watchers

James Cloos 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.