Browse Source

初始化迁移

zweizhao 7 years ago
commit
edbdc7332b

+ 3 - 0
.browserslistrc

@@ -0,0 +1,3 @@
+> 1%
+last 2 versions
+not ie <= 8

+ 21 - 0
.gitignore

@@ -0,0 +1,21 @@
+.DS_Store
+node_modules
+#/dist
+
+# local env files
+.env.local
+.env.*.local
+
+# Log files
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# Editor directories and files
+.idea
+.vscode
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw*

+ 29 - 0
README.md

@@ -0,0 +1,29 @@
+# boss
+
+## Project setup
+```
+yarn install
+```
+
+### Compiles and hot-reloads for development
+```
+yarn run serve
+```
+
+### Compiles and minifies for production
+```
+yarn run build
+```
+
+### Run your tests
+```
+yarn run test
+```
+
+### Lints and fixes files
+```
+yarn run lint
+```
+
+### Customize configuration
+See [Configuration Reference](https://cli.vuejs.org/config/).

+ 5 - 0
babel.config.js

@@ -0,0 +1,5 @@
+module.exports = {
+  presets: [
+    '@vue/app'
+  ]
+}

File diff suppressed because it is too large
+ 1 - 0
dist/css/app.c690dc62.css


File diff suppressed because it is too large
+ 1 - 0
dist/css/chunk-vendors.ea3fa8e3.css


BIN
dist/favicon.ico


BIN
dist/fonts/element-icons.2fad952a.woff


BIN
dist/fonts/element-icons.6f0a7632.ttf


File diff suppressed because it is too large
+ 1 - 0
dist/index.html


File diff suppressed because it is too large
+ 2 - 0
dist/js/app.643b2557.js


File diff suppressed because it is too large
+ 1 - 0
dist/js/app.643b2557.js.map


File diff suppressed because it is too large
+ 40 - 0
dist/js/chunk-vendors.5b8e7b1d.js


File diff suppressed because it is too large
+ 1 - 0
dist/js/chunk-vendors.5b8e7b1d.js.map


+ 23 - 0
package.json

@@ -0,0 +1,23 @@
+{
+  "name": "boss",
+  "version": "0.1.0",
+  "private": true,
+  "scripts": {
+    "serve": "vue-cli-service serve",
+    "build": "vue-cli-service build"
+  },
+  "dependencies": {
+    "echarts": "^4.2.0-rc.2",
+    "element-ui": "^2.4.9",
+    "vue": "^2.5.17",
+    "vue-router": "^3.0.1",
+    "vuex": "^3.0.1"
+  },
+  "devDependencies": {
+    "@vue/cli-plugin-babel": "^3.1.0",
+    "@vue/cli-service": "^3.1.0",
+    "less": "^3.0.4",
+    "less-loader": "^4.1.0",
+    "vue-template-compiler": "^2.5.17"
+  }
+}

+ 5 - 0
postcss.config.js

@@ -0,0 +1,5 @@
+module.exports = {
+  plugins: {
+    autoprefixer: {}
+  }
+}

BIN
public/favicon.ico


+ 16 - 0
public/index.html

@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width,initial-scale=1.0">
+    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
+    <title>程序员客栈-BOSS</title>
+  </head>
+  <body>
+    <noscript>
+      <strong>抱歉,你的浏览器未打开 JavaScript 脚本功能。</strong>
+    </noscript>
+    <div id="app"></div>
+  </body>
+</html>

+ 18 - 0
src/App.vue

@@ -0,0 +1,18 @@
+<template>
+  <router-view/>
+</template>
+
+<style lang="less">
+html {
+  font-size: 14px;
+}
+body {
+  margin: 0;
+}
+html, body {
+  height: 100%;
+}
+.el-table .success-row {
+  background: #f0f9eb;
+}
+</style>

+ 131 - 0
src/components/main/cloud-balance.vue

@@ -0,0 +1,131 @@
+<template>
+  <div id="cloud-balance">
+    <el-table v-if="tableData.length"
+      height="400"
+      border
+      style="width: 100%"
+      :data="tableData"
+      :row-class-name="tableRowClassName">
+      <el-table-column v-for="(prop, index) of tableProps" :key="index"
+        :prop="prop"
+        :label="tableHeaders[index]">
+        <template slot-scope="scope">
+          <el-button type="text" v-if="prop === 'uid'" @click="clickUID(scope.row[prop])">{{scope.row[prop]}}</el-button>
+          <span v-else-if="prop === 'statusShow' && scope.row['status'] !== '1'">
+            {{scope.row[prop]}}
+            <el-button type="text" @click="clickRetry(scope.row['id'])">重试</el-button>
+          </span>
+          <span v-else>{{scope.row[prop]}}</span>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      @current-change="getTableData"
+      :current-page.sync="currentPage"
+      :page-size="20"
+      layout="total, prev, pager, next"
+      :total="totalCount">
+    </el-pagination>
+  </div>
+</template>
+
+<script>
+const tableHeaders = [
+  '账单ID',
+  '项目ID',
+  '企业方',
+  '开发者',
+  '核定价格',
+  '托管费用',
+  '试用期天数',
+  '结算周期',
+  '结算金额',
+  '退回金额',
+  '发薪日期',
+  '结算时间',
+  '状态',
+  '负责人',
+  '操作',
+  '备注',
+  '项目状态',
+]
+const tableProps = [
+  'id',
+  'pre_appoint_uid',
+  'uid',
+  'developer_uid',
+  'uid',
+  'uid',
+  'uid',
+  'real_name',
+  'amount',
+  'true_amount',
+  'after_amount',
+  'account',
+  'created_atShow',
+  'taken_atShow',
+  'order_no',
+  'channel',
+  'statusShow'
+]
+
+export default {
+  data() {
+    return {
+      // 数据总条目
+      totalCount: 0,
+      currentPage: 1,
+      // 列表头显示内容
+      tableHeaders,
+      // 列表头字段
+      tableProps,
+      // 列表数据
+      tableData: []
+    }
+  },
+  mounted() {
+    this.getTableData()
+  },
+  methods: {
+    // 点击重试
+    async clickRetry(id) {
+      const res = await this.$form('/api/admin/payment/redoDraw', { id })
+      console.log(res)
+    },
+    // 点击用户的 uid
+    clickUID(uid) {
+      console.log('click uid: ' + uid)
+    },
+    // 根据状态显示图表样式
+    tableRowClassName({row, rowIndex}) {
+      // console.log({row, rowIndex})
+      let className = ''
+      if(row.status === '1') className = 'success-row'
+      return className
+    },
+    // 格式化列表数据
+    formatTableData(data) {
+      return data.map(i => ({
+        ...i,
+        statusShow: i.status === '1' ? '到账' : '失败',
+        created_atShow: new Date(Number(i.created_at) * 1000).toLocaleString(),
+        taken_atShow: new Date(Number(i.taken_at) * 1000).toLocaleString(),
+      }))
+    },
+    // 获取列表数据
+    async getTableData(page = 1) {
+      const res = await this.$form('/api/admin/job/jobs', { page }) // /api/admin/job/jobs {status: 0, p:1} /api/admin/job/job_status_map
+      // console.log(res)
+      const data = res.data
+      this.tableData = this.formatTableData(res.data.list)
+      // console.log(this.tableData)
+      this.totalCount = Number(data.total)
+      this.totalPage = data.totalPage
+    }
+  }
+}
+</script>
+
+<style lang='less' scoped>
+
+</style>

+ 119 - 0
src/components/main/cloud-job.vue

@@ -0,0 +1,119 @@
+<template>
+  <div id="withdraw">
+    <el-table v-if="tableData.length"
+      height="400"
+      border
+      style="width: 100%"
+      :data="tableData"
+      :row-class-name="tableRowClassName">
+      <el-table-column v-for="(prop, index) of tableProps" :key="index"
+        :prop="prop"
+        :label="tableHeaders[index]">
+        <template slot-scope="scope">
+          <el-button type="text" v-if="prop === 'uid'" @click="clickUID(scope.row[prop])">{{scope.row[prop]}}</el-button>
+          <span v-else-if="prop === 'statusShow' && scope.row['status'] !== '1'">
+            {{scope.row[prop]}}
+            <el-button type="text" @click="clickRetry(scope.row['id'])">重试</el-button>
+          </span>
+          <span v-else>{{scope.row[prop]}}</span>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      @current-change="getTableData"
+      :current-page.sync="currentPage"
+      :page-size="20"
+      layout="total, prev, pager, next"
+      :total="totalCount">
+    </el-pagination>
+  </div>
+</template>
+
+<script>
+const tableHeaders = [
+  '用户ID',
+  '真实姓名',
+  '提现金额',
+  '到账金额',
+  '账户余额',
+  '到账账户',
+  '提现时间',
+  '到账时间',
+  '订单号',
+  '支付方式',
+  '状态'
+]
+const tableProps = [
+  'uid',
+  'real_name',
+  'amount',
+  'true_amount',
+  'after_amount',
+  'account',
+  'created_atShow',
+  'taken_atShow',
+  'order_no',
+  'channel',
+  'statusShow'
+]
+
+export default {
+  data() {
+    return {
+      // 数据总条目
+      totalCount: 0,
+      currentPage: 1,
+      // 列表头显示内容
+      tableHeaders,
+      // 列表头字段
+      tableProps,
+      // 列表数据
+      tableData: []
+    }
+  },
+  mounted() {
+    this.getTableData()
+  },
+  methods: {
+    // 点击重试
+    async clickRetry(id) {
+      const res = await this.$form('/api/admin/payment/redoDraw', { id })
+      console.log(res)
+    },
+    // 点击用户的 uid
+    clickUID(uid) {
+      console.log('click uid: ' + uid)
+    },
+    // 根据状态显示图表样式
+    tableRowClassName({row, rowIndex}) {
+      // console.log({row, rowIndex})
+      let className = ''
+      if(row.status === '1') className = 'success-row'
+      return className
+    },
+    // 格式化列表数据
+    formatTableData(data) {
+      return data.map(i => ({
+        ...i,
+        statusShow: i.status === '1' ? '到账' : '失败',
+        created_atShow: new Date(Number(i.created_at) * 1000).toLocaleString(),
+        taken_atShow: new Date(Number(i.taken_at) * 1000).toLocaleString(),
+      }))
+    },
+    // 获取列表数据
+    async getTableData(page = 1) {
+      const res = await this.$form('/api/admin/job/jobs', { page })
+      console.log(res)
+      const data = res.data
+      this.tableData = this.formatTableData(res.data.list)
+      // console.log(this.tableData)
+      this.totalCount = Number(data.total)
+      this.totalPage = data.totalPage
+    }
+  }
+}
+</script>
+
+<style lang='less' scoped>
+
+</style>

+ 67 - 0
src/components/main/menu.vue

@@ -0,0 +1,67 @@
+<template>
+  <el-menu default-active="1-4-1" class="main-menu" @open="handleOpen" @close="handleClose" :collapse="collapse">
+    <el-submenu v-for="(menu, index) of menus" :key="index" :index="String(index)">
+      <template slot="title">
+        <i class="el-icon-setting"></i>
+        <span slot="title">{{menu.title}}</span>
+      </template>
+      <el-menu-item v-for='(sub, subIndex) of menu.subs' :key="subIndex" :index="String(index) + subIndex" @click.native="$router.push(`/main/${sub.path}`)">
+        {{sub.title}}
+      </el-menu-item>
+    </el-submenu>
+  </el-menu>
+</template>
+
+<script>
+export default {
+  props: ['collapse', ],
+  data() {
+    return {
+      menus: []
+    }
+  },
+  mounted() {
+    this.getMenu()
+  },
+  methods: {
+    getMenu() {
+      this.menus = [
+        {
+          title: '财务',
+          subs: [
+            {
+              title: '云端结算',
+              path: 'cloud-balance',
+            },
+            {
+              title: '提现账单',
+              path: 'withdraw',
+            },
+          ]
+        },
+        {
+          title: '项目',
+          subs: [
+            {
+              title: '云端工作',
+              path: 'cloud-job',
+            },
+          ]
+        },
+      ]
+    },
+    handleOpen() {
+      console.log('open')
+    },
+    handleClose() {
+      console.log('close')
+    },
+  },
+}
+</script>
+
+<style lang='less' scoped>
+.main-menu {
+  // width: 140px;
+}
+</style>

+ 119 - 0
src/components/main/withdraw.vue

@@ -0,0 +1,119 @@
+<template>
+  <div id="withdraw">
+    <el-table v-if="tableData.length"
+      height="400"
+      border
+      style="width: 100%"
+      :data="tableData"
+      :row-class-name="tableRowClassName">
+      <el-table-column v-for="(prop, index) of tableProps" :key="index"
+        :prop="prop"
+        :label="tableHeaders[index]">
+        <template slot-scope="scope">
+          <el-button type="text" v-if="prop === 'uid'" @click="clickUID(scope.row[prop])">{{scope.row[prop]}}</el-button>
+          <span v-else-if="prop === 'statusShow' && scope.row['status'] !== '1'">
+            {{scope.row[prop]}}
+            <el-button type="text" @click="clickRetry(scope.row['id'])">重试</el-button>
+          </span>
+          <span v-else>{{scope.row[prop]}}</span>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      @current-change="getTableData"
+      :current-page.sync="currentPage"
+      :page-size="20"
+      layout="total, prev, pager, next"
+      :total="totalCount">
+    </el-pagination>
+  </div>
+</template>
+
+<script>
+const tableHeaders = [
+  '用户ID',
+  '真实姓名',
+  '提现金额',
+  '到账金额',
+  '账户余额',
+  '到账账户',
+  '提现时间',
+  '到账时间',
+  '订单号',
+  '支付方式',
+  '状态'
+]
+const tableProps = [
+  'uid',
+  'real_name',
+  'amount',
+  'true_amount',
+  'after_amount',
+  'account',
+  'created_atShow',
+  'taken_atShow',
+  'order_no',
+  'channel',
+  'statusShow'
+]
+
+export default {
+  data() {
+    return {
+      // 数据总条目
+      totalCount: 0,
+      currentPage: 1,
+      // 列表头显示内容
+      tableHeaders,
+      // 列表头字段
+      tableProps,
+      // 列表数据
+      tableData: []
+    }
+  },
+  mounted() {
+    this.getTableData()
+  },
+  methods: {
+    // 点击重试
+    async clickRetry(id) {
+      const res = await this.$form('/api/admin/payment/redoDraw', { id })
+      console.log(res)
+    },
+    // 点击用户的 uid
+    clickUID(uid) {
+      console.log('click uid: ' + uid)
+    },
+    // 根据状态显示图表样式
+    tableRowClassName({row, rowIndex}) {
+      // console.log({row, rowIndex})
+      let className = ''
+      if(row.status === '1') className = 'success-row'
+      return className
+    },
+    // 格式化列表数据
+    formatTableData(data) {
+      return data.map(i => ({
+        ...i,
+        statusShow: i.status === '1' ? '到账' : '失败',
+        created_atShow: new Date(Number(i.created_at) * 1000).toLocaleString(),
+        taken_atShow: new Date(Number(i.taken_at) * 1000).toLocaleString(),
+      }))
+    },
+    // 获取列表数据
+    async getTableData(page = 1) {
+      const res = await this.$form('/api/admin/payment/listDraw', { page })
+      // console.log(res)
+      const data = res.data
+      this.tableData = this.formatTableData(res.data.list)
+      // console.log(this.tableData)
+      this.totalCount = Number(data.total)
+      this.totalPage = data.totalPage
+    }
+  }
+}
+</script>
+
+<style lang='less' scoped>
+
+</style>

+ 21 - 0
src/main.js

@@ -0,0 +1,21 @@
+import Vue from 'vue'
+import App from './App.vue'
+import router from './router'
+import store from './store'
+import ElementUI from 'element-ui'
+import 'element-ui/lib/theme-chalk/index.css'
+import { get, post, form, request } from '@/static/utils/http'
+
+Vue.use(ElementUI);
+
+Vue.config.productionTip = false
+Vue.prototype.$get = get
+Vue.prototype.$post = post
+Vue.prototype.$form = form
+Vue.prototype.$request = request
+
+new Vue({
+  router,
+  store,
+  render: h => h(App)
+}).$mount('#app')

+ 51 - 0
src/router.js

@@ -0,0 +1,51 @@
+import Vue from 'vue'
+import Router from 'vue-router'
+import Welcome from './views/welcome/'
+import Main from './views/main/'
+import Login from './views/login/'
+import WithDraw from '@/components/main/withdraw'
+import CloudJob from '@/components/main/cloud-job'
+import CloudBalance from '@/components/main/cloud-balance'
+
+Vue.use(Router)
+
+const mainChildren = [
+  {
+    alias: '/',
+    path: 'withdraw',
+    name: 'main-withdraw',
+    component: WithDraw
+  },
+  {
+    path: 'cloud-job',
+    name: 'main-cloud-job',
+    component: CloudJob
+  },
+  {
+    path: 'cloud-balance',
+    name: 'main-cloud-balance',
+    component: CloudBalance
+  },
+]
+
+export default new Router({
+  routes: [
+    {
+      path: '/',
+      name: 'welcome',
+      component: Welcome
+    },
+    {
+      path: '/main',
+      name: 'main',
+      component: Main,
+      children: mainChildren,
+    },
+    {
+      path: '/login',
+      name: 'login',
+      component: Login
+    },
+    // component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
+  ]
+})

+ 100 - 0
src/static/utils/http.js

@@ -0,0 +1,100 @@
+/**
+ * author 赵越
+ * 2018-11-04
+ */
+
+import axios from 'axios'
+
+/**
+ *
+ * @param {string} path 请求地址的 path
+ * @param {string} data 请求实体
+ * @param {object} payload 其他选项
+ * @param {object} promise 返回一个 promise
+ */
+export const get = async (path, data, payload) => {
+  let result = null
+  await request('get', path, data, payload)
+    .then(res => result = res)
+  return result
+}
+
+/**
+ *
+ * @param {string} path 请求地址的 path
+ * @param {string} data 请求实体
+ * @param {object} payload 其他选项
+ * @param {object} promise 返回一个 promise
+ */
+export const post = async (path, data = {}, payload) => {
+  let result = null
+  await request('post', path, data, payload)
+    .then(res => result = res)
+  return result
+}
+
+/**
+ *
+ * @param {string} path 请求地址的 path
+ * @param {string} data 请求实体
+ * @param {object} payload 其他选项
+ * @param {object} promise 返回一个 promise
+ */
+export const form = async (path, data = {}, payload) => {
+  let result = null
+  let formData = ''
+  for (const key in data) {
+    if (data.hasOwnProperty(key)) {
+      const element = data[key]
+      formData += `${key}=${element}&`
+    }
+  }
+  formData = formData.slice(0, formData.length - 1)
+
+  await request('post', path, formData, { config: { headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' } } })
+    .then(res => result = res)
+
+  // await axios.post(path, formData, { headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'} })
+  // .then(res => result = res.data)
+  return result
+}
+
+/**
+ *
+ * @param {method} method 请求方法
+ * @param {string} path 请求地址的 path
+ * @param {string} data 请求实体
+ * @param {object} payload 其他选项
+ * @param {object} promise 返回一个 promise
+ */
+export const request = async (method, path, data, payload = {}) => {
+  let host = ''
+  let url = host + path
+  const body = {
+    url,
+    data,
+    method,
+    params: data,
+  }
+  if (payload.config) Object.assign(body, payload.config, { params: '' })
+
+  console.log(`url: ${url}`)
+  consoleFormat({body})
+
+  const res = await axios.request(body)
+  let rData = res.data
+  if (typeof rData !== 'object') rData = JSON.parse(rData)
+  consoleFormat({rData})
+  if(rData.status === -99) {
+    location.href = '/#/login'
+    return
+  }
+  return rData
+}
+
+const consoleFormat = obj => {
+  const key = Object.keys(obj)[0]
+  console.log(key + ':')
+  console.dir(obj[key])
+  // console.log()
+}

+ 16 - 0
src/store.js

@@ -0,0 +1,16 @@
+import Vue from 'vue'
+import Vuex from 'vuex'
+
+Vue.use(Vuex)
+
+export default new Vuex.Store({
+  state: {
+
+  },
+  mutations: {
+
+  },
+  actions: {
+
+  }
+})

+ 70 - 0
src/views/login/index.vue

@@ -0,0 +1,70 @@
+<template>
+  <div id="login">
+    <h1>程序员客栈 - BOSS</h1>
+    <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="ruleForm">
+      <el-form-item label="账号" prop="webmaster">
+        <el-input v-model="ruleForm.webmaster" placeholder="请输入账号"></el-input>
+      </el-form-item>
+      <el-form-item label="密码" prop="password">
+        <el-input v-model="ruleForm.password" type="password" placeholder="请输入密码"></el-input>
+      </el-form-item>
+      <el-form-item label="口令" prop="cypher">
+        <el-input v-model="ruleForm.cypher" type="password" placeholder="请输入口令" @keyup.native.enter="submit"></el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button style="width: 100%;" type="primary" @click="submit">登录</el-button>
+      </el-form-item>
+    </el-form>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      ruleForm: {
+        // 账号
+        webmaster: '',
+        // 密码
+        password: '',
+        // 口令,格式:inn月日,无 0
+        cypher: '',
+      },
+      rules: {
+        webmaster: [
+            { required: true, message: '请输入账号', trigger: 'blur' },
+          ],
+          password: [
+            { required: true, message: '请输入密码', trigger: 'change' },
+            { min: 6, message: '长度在 6 个字符以上', trigger: 'blur' },
+          ],
+          cypher: [
+            { required: true, message: '请输入账号', trigger: 'blur' },
+          ],
+      }
+    }
+  },
+  methods: {
+    async submit() {
+      // this.$router.replace('/main')
+      // return
+      const { webmaster, password, cypher } = this.ruleForm
+      const res = await this.$form('/api/admin/index/login', { webmaster, password, cypher })
+      console.log(res)
+      if(res && res.status) this.$router.replace('/main')
+    }
+  }
+}
+</script>
+
+<style>
+#login {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  margin-top: 200px;
+}
+.ruleForm {
+  width: 550px;
+}
+</style>

+ 32 - 0
src/views/main/index.vue

@@ -0,0 +1,32 @@
+<template>
+  <div id="main">
+    <main-menu :collapse="menuCollapse" />
+    <router-view class="main-content"></router-view>
+  </div>
+</template>
+
+<script>
+import MainMenu from '@/components/main/menu'
+
+export default {
+  components: {
+    MainMenu,
+  },
+  data() {
+    return {
+      // 菜单是否折叠
+      menuCollapse: false,
+    }
+  }
+}
+</script>
+
+<style lang='less' scoped>
+#main {
+  display: flex;
+  height: 100%;
+  .main-content {
+    flex: 1;
+  }
+}
+</style>

+ 24 - 0
src/views/welcome/index.vue

@@ -0,0 +1,24 @@
+<template>
+  <div id="nav">
+    检查登录状态中……
+  </div>
+</template>
+
+<script>
+export default {
+  mounted() {
+    this.checkLogin()
+  },
+  methods: {
+    async checkLogin() {
+      const res = await this.$form('/api/admin/index/check_login')
+      // console.log(res)
+      if(res.status) this.$router.replace('/main')
+      else this.$router.replace('/login')
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 40 - 0
vue.config.js

@@ -0,0 +1,40 @@
+/**
+ * author
+ * 2018-11-5
+ * webpack 相关配置
+ */
+
+const path = require('path')
+const resolve = dir => path.join(__dirname, dir)
+const ds_overlay = { warnings: true, errors: true }
+const ds_proxy = {
+  '/': {
+    ws: false,
+    target: 'https://dev.test.gitinn.com/',
+    changeOrigin: true,
+    // pathRewrite: {
+    //   '/api/dispatch': '/dispatch'
+    // }
+  },
+}
+
+module.exports = {
+  baseUrl: process.env.NODE_ENV === 'production' ? './' : '/',
+  chainWebpack: config => {
+    config.entry.vender = ['echarts', 'vue', 'vuex', 'vue-router', 'element-ui']
+    config.resolve.alias
+      .set('assets',resolve('src/assets'))
+      .set('components',resolve('src/components'))
+      .set('views',resolve('src/views'))
+      .set('static',resolve('src/static'))
+
+    config.devServer
+      .set('port', 20201)
+      .set('historyApiFallback', false)
+      .set('noInfo', true)
+      .set('open', true)
+      .set('quiet', true)
+      .set('overlay', ds_overlay)
+      .set('proxy', ds_proxy)
+  },
+}