Pārlūkot izejas kodu

✨ feat(v2.2.0):

- 充值页面的充值方式改为默认商务笔充值。
- 归属查询进入页面显示默认的渠道账户和游戏。
wen 3 gadi atpakaļ
vecāks
revīzija
1e2a23ea7a

+ 10 - 2
.env.development

@@ -5,11 +5,19 @@ ENV = 'development'
 VUE_APP_BASE_API = ''
 
 # 线上测试
-VUE_APP_BASE_URL = 'http://devapi.youxi9.cn'
+#VUE_APP_BASE_URL = 'http://devapi.youxi9.cn'
 # 正式域名
 # VUE_APP_BASE_URL = 'https://api.youxi9.cn'
 # 登陆域名
-VUE_APP_LOGIN_URL = 'https://devuser.youxi9.cn'
+#VUE_APP_LOGIN_URL = 'https://devuser.youxi9.cn'
+
+
+
+# 线上正式
+VUE_APP_BASE_URL = 'https://api.youxi9.cn'
+# 登陆域名
+VUE_APP_LOGIN_URL = 'https://user.youxi9.cn'
+
 
 # 图片地址
 # VUE_APP_IMG_URL = 'https://cdn.youxi9.com/'

+ 77 - 0
src/api/ascription.js

@@ -0,0 +1,77 @@
+import request from '@/utils/request'
+import qs from 'qs'
+// ## 归属查询 ##
+
+// 游戏平台列表
+export function getPlatform() {
+  return request({
+    url: '/v1/account/platform',
+    method: 'get'
+  })
+}
+
+/**
+ * 渠道账号列表
+ *
+ * @param id 游戏ID
+ * @returns {*}
+ */
+export function getChannle(id) {
+  return request({
+    url: `/v1/account/channle?pid=${id}`,
+    method: 'get'
+  })
+}
+
+/**
+ * 账号游戏列表
+ *
+ * @param pid 游戏ID
+ * @param cid 渠道账号ID
+ * @returns {*}
+ */
+export function getGame(pid, cid) {
+  return request({
+    url: `/v1/account/game?pid=${pid}&cid=${cid}`,
+    method: 'get'
+  })
+}
+
+/**
+ * 账号归属查询
+ *
+ * @param data
+ * @returns {*}
+ */
+export function accountCheck(data) {
+  /**
+   * data:
+   *
+   * {
+   * 	pid: d65aa6d7614589bffe62456b88e98811 x
+   * 	game_name: 蜀门
+   * 	channel_no: 802002
+   * 	account: 13121776520
+   * 	yxid: 3175430
+   * 	id: 42670
+   * 	cid: 18150 x
+   * }
+   */
+
+  const param = new URLSearchParams()
+  param.append('pid', data.pid)
+  param.append('game_name', data.game_name)
+  param.append('channel_no', data.channel_no)
+  param.append('account', data.account)
+  param.append('yxid', data.yxid)
+  param.append('id', data.id)
+  param.append('cid', data.cid)
+
+  return request({
+    url: '/v1/account/check',
+    method: 'post',
+    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
+    // data: qs.stringify(data),
+    data: param
+  })
+}

+ 32 - 44
src/router/index.js

@@ -34,13 +34,41 @@ import Layout from '@/layout'
  */
 export const constantRoutes = [
   {
-    path: '/redirect',
+    path: '/dashboard',
     component: Layout,
-    hidden: true,
+    redirect: '/dashboard',
     children: [
       {
-        path: '/redirect/:path(.*)',
-        component: () => import('@/views/redirect/index')
+        path: 'dashboard',
+        component: () => import('@/views/dashboard/index'),
+        name: '首页',
+        meta: { title: '首页', icon: 'dashboard', affix: true }
+      }
+    ]
+  },
+  {
+    path: '/',
+    component: Layout,
+    redirect: '/recharge',
+    children: [
+      {
+        path: 'recharge',
+        component: () => import('@/views/recharge/index'),
+        name: 'recharge',
+        meta: { title: '充值', icon: 'shopping', noCache: true }
+      }
+    ]
+  },
+  {
+    path: '/ascription',
+    component: Layout,
+    redirect: '/ascription',
+    children: [
+      {
+        path: 'ascription',
+        component: () => import('@/views/ascription/index'),
+        name: 'ascription',
+        meta: { title: '归属查询', icon: 'search', noCache: true }
       }
     ]
   },
@@ -63,46 +91,7 @@ export const constantRoutes = [
     path: '/401',
     component: () => import('@/views/error-page/401'),
     hidden: true
-  },
-  {
-    path: '/dashboard',
-    component: Layout,
-    redirect: '/dashboard',
-    children: [
-      {
-        path: 'dashboard',
-        component: () => import('@/views/dashboard/index'),
-        name: '首页',
-        meta: { title: '首页', icon: 'dashboard', affix: true }
-      }
-    ]
-  },
-  {
-    path: '/',
-    component: Layout,
-    redirect: '/recharge',
-    children: [
-      {
-        path: 'recharge',
-        component: () => import('@/views/recharge/index'),
-        name: 'recharge',
-        meta: { title: '充值', icon: 'shopping', noCache: true }
-      }
-    ]
   }
-  // {
-  //   path: '/test',
-  //   component: Layout,
-  //   redirect: '/test',
-  //   children: [
-  //     {
-  //       path: 'test',
-  //       component: () => import('@/views/recharge/test'),
-  //       name: 'test',
-  //       meta: { title: 'test', icon: 'shopping', noCache: true }
-  //     }
-  //   ]
-  // }
 ]
 
 /**
@@ -110,7 +99,6 @@ export const constantRoutes = [
  * the routes that need to be dynamically loaded based on user roles
  */
 export const asyncRoutes = [
-
   // 404 page must be placed at the end !!!
   { path: '*', redirect: '/404', hidden: true }
 ]

+ 52 - 0
src/store/modules/ascription.js

@@ -0,0 +1,52 @@
+import { getPlatform, getChannle, getGame, accountCheck } from '@/api/ascription'
+
+const actions = {
+  // 游戏平台
+  getPlatform({ commit }, data) {
+    return new Promise((resolve, reject) => {
+      getPlatform(data).then(response => {
+        resolve(response)
+      }).catch(error => {
+        reject(error)
+      })
+    })
+  },
+
+  // 渠道账号列表
+  getChannle({ commit }, id) {
+    return new Promise((resolve, reject) => {
+      getChannle(id).then(response => {
+        resolve(response)
+      }).catch(error => {
+        reject(error)
+      })
+    })
+  },
+
+  // 账号游戏列表
+  getGame({ commit }, pid, cid) {
+    return new Promise((resolve, reject) => {
+      getGame(pid, cid).then(response => {
+        resolve(response)
+      }).catch(error => {
+        reject(error)
+      })
+    })
+  },
+
+  // 账号归属查询
+  accountCheck({ commit }, data) {
+    return new Promise((resolve, reject) => {
+      accountCheck(data).then(response => {
+        resolve(response)
+      }).catch(error => {
+        reject(error)
+      })
+    })
+  }
+}
+
+export default {
+  namespaced: true,
+  actions
+}

+ 4 - 3
src/utils/request.js

@@ -3,13 +3,14 @@ import { MessageBox, Message } from 'element-ui'
 import store from '@/store'
 import { getToken } from '@/utils/auth'
 
-console.log('# process.env.ENV: ', process.env.NODE_ENV, process.env.NODE_ENV === 'development' ? undefined : process.env.VUE_APP_BASE_URL)
+console.log('# v2.2.0 process.env.ENV: ', process.env.NODE_ENV, process.env.NODE_ENV === 'development' ? undefined : process.env.VUE_APP_BASE_URL)
 // create an axios instance
 const service = axios.create({
   // baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
   baseURL: process.env.NODE_ENV === 'development' ? process.env.VUE_APP_BASE_API : process.env.VUE_APP_BASE_URL,
   // withCredentials: true, // send cookies when cross-domain requests
-  timeout: 5000 // request timeout
+  timeout: 5000, // request timeout
+  headers: { 'Content-Type': 'application/json' }
 })
 
 // request interceptor
@@ -46,7 +47,7 @@ service.interceptors.response.use(
    */
   response => {
     const res = response.data
-    console.log(new Date().getTime() + '# request@url&response:' + response.config.url + ':', res)
+    // console.log(new Date().getTime() + '# request@url&response:' + response.config.url + ':', res)
 
     if (res.code === 11010) {
       Message({

+ 421 - 0
src/views/ascription/index.vue

@@ -0,0 +1,421 @@
+<template>
+  <div class="app-container">
+    <div class="one">
+      <el-form ref="ruleForm" :model="ruleForm" :rules="rules" class="demo-ruleForm">
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item :label="'查询账户:' + handle_num" prop="account_list">
+              <el-input
+                v-model="ruleForm.account_list"
+                type="textarea"
+                :rows="20"
+                placeholder="请输入查询账户,一行一个"
+              />
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="12">
+            <el-form-item label="游戏平台" prop="pid">
+              <el-select v-model="ruleForm.pid" placeholder="请选择 游戏平台" disabled>
+                <el-option
+                  v-for="(item, index) in platform_list"
+                  :key="index"
+                  :label="item.platform"
+                  :value="item.pid"
+                >
+                  {{ item.platform }}
+                </el-option>
+              </el-select>
+            </el-form-item>
+
+            <el-form-item label="渠道账户" prop="cid">
+              <el-select v-model="ruleForm.cid" placeholder="请选择 渠道账户" filterable @change="changeCid">
+                <el-option
+                  v-for="(item, index) in channle_list"
+                  :key="item.cid"
+                  :label="item.title"
+                  :value="item.cid"
+                />
+              </el-select>
+            </el-form-item>
+
+            <el-form-item label="游戏" prop="yxid">
+<!--              yxid_index-->
+              <el-select v-model="ruleForm.yxid" placeholder="请选择 游戏" filterable @change="changeYxid">
+                <el-option
+                  v-for="(item, index) in game_list"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                />
+              </el-select>
+            </el-form-item>
+
+            <el-form-item>
+              <el-button type="primary" @click="submitForm('ruleForm')">查询</el-button>
+              <el-button @click="resetForm('ruleForm')">重置</el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </div>
+
+    <div class="three">
+      <el-card class="box-card">
+        <div slot="header" class="clearfix">
+          <span>正常:</span>{{ success_num }}
+        </div>
+        <div class="text item">
+          <el-input v-model="success_list" type="textarea" :rows="20" disabled />
+        </div>
+      </el-card>
+    </div>
+    <div class="four">
+      <el-card class="box-card">
+        <div slot="header" class="clearfix">
+          <span>暂无归属:</span>{{ no_num }}
+        </div>
+        <div class="text item">
+          <el-input v-model="no_list" type="textarea" :rows="20" disabled />
+        </div>
+      </el-card>
+    </div>
+    <div class="five">
+      <el-card class="box-card">
+        <div slot="header" class="clearfix">
+          <span>不归属:</span>{{ noth_num }}
+        </div>
+        <div class="text item">
+          <el-input v-model="noth_list" type="textarea" :rows="20" disabled />
+        </div>
+      </el-card>
+    </div>
+  </div>
+</template>
+
+<script>
+import { getPlatform, getChannle, getGame, accountCheck } from '@/api/ascription'
+
+export default {
+  data() {
+    return {
+      formLoading: false,
+
+      // 游戏平台
+      platform_list: [
+        {
+          'pid': 'd65aa6d7614589bffe62456b88e98811',
+          'platform': 'MM'
+        }
+      ],
+      // 渠道账户
+      channle_list: [],
+      // 游戏列表
+      game_list: [],
+
+      yxid_index: '', // 选中的游戏
+      ruleForm: {
+        // 录入数据
+        pid: 'd65aa6d7614589bffe62456b88e98811',
+        cid: 21751,
+        yxid: 54252,
+
+        // 追加
+        id: '',
+        channel_no: '',
+        game_name: '',
+
+        // 查询
+        account_list: ''
+      },
+      rules: {
+        pid: [
+          { required: true, message: '请选择 游戏平台', trigger: 'blur' }
+        ],
+        cid: [
+          { required: true, message: '请选择 渠道账户', trigger: 'blur' }
+        ],
+        yxid: [
+          { required: true, message: '请选择 游戏', trigger: 'blur' }
+        ],
+        account_list: [
+          { required: true, message: '请输入查询的账户', trigger: 'blur' }
+        ]
+      },
+
+      handle_list: '', // 处理账号列表
+      handle_num: 0,
+      success_list: '', // 正常账号
+      success_num: 0,
+      no_list: '', // 不归属
+      no_num: 0,
+      noth_list: '', // 暂无归属
+      noth_num: 0,
+
+      task: {
+        count: 0, // 总数
+        conduct: 0 // 进行中
+      },
+
+      error_list: '' // 处理失败的记录
+    }
+  },
+  watch: {
+    'ruleForm.account_list': {
+      handler(val, oldVal) {
+        // this.accountSplit(this.ruleForm.account_list)
+        this.handle_num = this.ruleForm.account_list.split('\n').length
+      }
+    },
+    'success_list': {
+      handler(val, oldVal) {
+        this.success_num = this.success_list.split('\n').length
+      }
+    },
+    'no_list': {
+      handler(val, oldVal) {
+        this.no_num = this.no_list.split('\n').length
+      }
+    },
+    'noth_list': {
+      handler(val, oldVal) {
+        this.noth_num = this.noth_list.split('\n').length
+      }
+    }
+  },
+  created() {
+    // this.getPlatform();
+    this.getChannle()
+  },
+  methods: {
+    submitForm(formName) {
+      var data = {
+        pid: this.ruleForm.pid,
+        cid: this.ruleForm.cid,
+        yxid: this.ruleForm.yxid,
+        id: this.ruleForm.id,
+        channel_no: this.ruleForm.channel_no,
+        game_name: this.ruleForm.game_name,
+        account: ''
+      }
+
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          console.log('## submitForm:', this.ruleForm)
+          var list = this.accountSplit(this.ruleForm.account_list)
+          this.formLoading = this.$loading({
+            lock: true,
+            text: 'Loading',
+            spinner: 'el-icon-loading',
+            background: 'rgba(0, 0, 0, 0.7)'
+          })
+
+          this.batchQuery(list, data)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    // 查询账号拆分
+    accountSplit(account_list) {
+      var account_list = account_list.split('\n')
+
+      // 账号去重
+      const newList = [] // 格式化后的账号列表
+      let newAccount = '' // 格式化后的账号字符串
+      const repeatList = [] // 重复账号记录
+
+      for (var i = 0; i < account_list.length; i++) {
+        if (account_list[i] === '') {
+          continue
+        }
+        // 账户去重,并提示
+        if (newList.indexOf(account_list[i]) === -1) {
+          newList.push(account_list[i])
+          newAccount += '\n' + account_list[i]
+        } else {
+          // TODO:记录重复账号
+          repeatList.push(account_list[i])
+        }
+      }
+
+      if (repeatList.length > 0) {
+        // console.error("## 重复账号:", repeatList.join().split('\n'));
+        console.error('## 重复账号:', repeatList)
+      }
+
+      // 账号列表格式修复
+      this.ruleForm.account_list = newAccount
+
+      return newList
+    },
+    // 批量查询
+    async batchQuery(list, data) {
+      var that = this
+      let i = list.length
+      that.task.count = i
+      that.task.conduct = 0
+
+      that.success_list = '' // 正常账号
+      that.no_list = '' // 不归属
+      that.noth_list = '' // 暂无归属
+
+      while (i--) {
+        if (i < 0) {
+          return false
+        }
+
+        const account = list[i]
+        data['account'] = account
+        await that.accountChecks(data, account, i)
+        that.sleep(1000)
+      }
+      console.log('## 处理结束')
+      console.log('## 接口失败的账户:', this.errorList ? this.errorList : '无')
+
+      if (that.task.count != that.task.conduct) {
+        // 如果任务结束,程序还没执行完,则延迟2秒后关闭页面加载框
+        setTimeout(function(that) {
+          that.formLoading.close()
+        }, 2000, that)
+      }
+    },
+    // 查询 -- 异步
+    async accountChecks(data, account, i) {
+      var that = this
+      // console.log("## "+i+" -- 查询 -- 异步 -- 开始")
+      await that.$store.dispatch('ascription/accountCheck', data).then((res) => {
+        this.task.conduct = i
+        // console.log("## 队列:", i, this.task.count);
+
+        const { code, data, message } = res
+        console.log('## ' + (this.task.count - i) + ' -- 查询 -- 异步 -- 结束:', res)
+
+        /**
+         * 归属/正常 = 200 :
+         * {
+         * 	"status": true,
+         * 	"code": 200,
+         * 	"time": 1656664946,
+         * 	"message": "成功",
+         * 	"data": []
+         * }
+         *
+         * 不归属 = 21002/* :
+         * {
+         *     "status": false,
+         *     "code": 21002,
+         *     "time": 1656661075,
+         *     "message": "当前账号不归属此渠道",
+         *     "data": []
+         * }
+         *
+         * 暂无归属 = 21003 :
+         * {
+         * 	"status": false,
+         * 	"code": 21003,
+         * 	"time": 1656664981,
+         * 	"message": "当前账号暂无归属渠道,可拓展为渠道下家",
+         * 	"data": []
+         * }
+         */
+        switch (code) {
+          case 200:
+            that.success_list += that.success_list ? '\n' + account : account
+            break
+          case 21002:
+            that.no_list += that.no_list ? '\n' + account : account
+            break
+          case 21003:
+            that.noth_list += that.noth_list ? '\n' + account : account
+            break
+          default:
+            that.no_list += that.no_list ? '\n' + account : account
+        }
+
+        const msg = '进度:' + (this.task.count - i) + '/' + this.task.count
+        this.$notify({
+          title: '查询成功!' + msg,
+          message: account + ':' + message,
+          type: 'success',
+          position: 'top-left'
+        })
+
+        this.task.conduct = this.task.count - i
+        if (i == 0) {
+          this.formLoading.close()
+        }
+      }).catch((error) => {
+        that.errorList = that.errorList ? that.errorList + ',' + account : that.errorList
+        console.log('## 查询失败!', error)
+      })
+      //   .finally(function (){
+      //   that.errorList = !that.errorList?account:(that.errorList+','+account);
+      // })
+    },
+    // 休眠
+    sleep(ms = 2000) { // sleep延迟方法2ms
+      var unixtime_ms = new Date().getTime()
+      while (new Date().getTime() < unixtime_ms + ms) {}
+    },
+    resetForm(formName) {
+      this.$refs[formName].resetFields()
+      this.ruleForm = {
+        pid: 'd65aa6d7614589bffe62456b88e98811',
+        cid: '',
+        yxid: '',
+        id: '',
+        channel_no: '',
+        game_name: '',
+        account_list: ''
+      }
+      this.yxid_index = ''
+      this.handle_list = ''
+    },
+
+    // 游戏平台列表
+    getPlatform() {
+      getPlatform().then((res) => {
+        const { data } = res
+        this.platform_list = data.data
+      }).catch((error) => {})
+    },
+    // 渠道账号列表
+    getChannle() {
+      getChannle(this.ruleForm.pid).then((res) => {
+        const { data } = res
+        this.channle_list = data.data
+
+        this.changeCid('21751');
+      }).catch((error) => {})
+    },
+    // 选择渠道
+    changeCid(cid) {
+      this.getGame(this.ruleForm.pid, cid);
+    },
+    // 渠道账号列表
+    getGame(pid = '', cid = '') {
+      getGame(pid || this.ruleForm.pid, cid || this.ruleForm.cid).then((res) => {
+        const { data } = res
+        this.game_list = data.data
+      }).catch((error) => {})
+    },
+    // 选择游戏
+    changeYxid(index) {
+      this.ruleForm.id = this.game_list[index]['id']
+      this.ruleForm.yxid = this.game_list[index]['yxid']
+      this.ruleForm.channel_no = this.game_list[index]['channel_no']
+      this.ruleForm.game_name = this.game_list[index]['name']
+      // console.log("## changeYxid: ", this.game_list[index]);
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+  .app-container{
+    display: flex;
+    justify-content: space-around;
+  }
+</style>

+ 6 - 6
src/views/login/index.vue

@@ -115,11 +115,11 @@ export default {
   watch: {
     $route: {
       handler: function(route) {
-        const query = route.query
-        if (query) {
-          this.redirect = query.redirect
-          this.otherQuery = this.getOtherQuery(query)
-        }
+        // const query = route.query
+        // if (query) {
+        //   this.redirect = query.redirect
+        //   this.otherQuery = this.getOtherQuery(query)
+        // }
       },
       immediate: true
     }
@@ -166,7 +166,7 @@ export default {
                 type: 'warning',
                 duration: 5 * 1000
               })
-              this.$router.push({ path: this.redirect || '/', query: this.otherQuery })
+              this.$router.push({ path: '/recharge'})
             } else {
               Message({
                 message: message,

+ 12 - 7
src/views/recharge/index.vue

@@ -56,9 +56,12 @@
               />
             </el-select>
           </el-form-item>
-          <el-form-item label="账户余额">
-            <span>{{ user_money }}元</span>
+          <el-form-item label="商务币余额:">
+            <span>{{ shangwubi }}元</span>
           </el-form-item>
+<!--          <el-form-item label="久币余额:">-->
+<!--            <span>{{ user_money }}元</span>-->
+<!--          </el-form-item>-->
           <el-form-item label="当前渠道余额">
             <span>{{ balanceMoney }}元</span>
           </el-form-item>
@@ -101,8 +104,8 @@
           </el-form-item> -->
           <el-form-item label="支付方式">
             <el-radio-group v-model="dataForm.payway" prop="payway" class="filter-item">
-              <el-radio :label="1">久币支付</el-radio>
-              <!-- <el-radio :label="2">商务币支付</el-radio> -->
+               <el-radio :label="2">商务币支付</el-radio>
+<!--              <el-radio :label="1">久币支付</el-radio>-->
             </el-radio-group>
           </el-form-item>
           <el-form-item label="总支付金额">
@@ -178,7 +181,7 @@ export default {
         username: '', // 充值账户
         money: 1, // 充值金额(单位:元)
         recharge: 2, //
-        payway: 1, // 充值方式
+        payway: 2, // 充值方式:1=久币、2=商务币
         type: 3 //
       },
       ruleForm: {
@@ -200,7 +203,8 @@ export default {
         }
       ],
       balanceMoney: 0, // 渠道余额
-      user_money: 0, // 账户余额
+      // user_money: 0, // 久币余额
+      shangwubi: 0, // 商务币余额
       maxMoney: 0, // 最大充值金额
       rechargeChannelPlatform: [], // 渠道账号
       rechargeGame: [], // 游戏列表
@@ -265,7 +269,8 @@ export default {
     updateUserMoney() {
       this.$store.dispatch('user/getInfo').then((res) => {
         const { data } = res
-        this.user_money = Math.floor(data.user_money)
+        // this.user_money = Math.floor(data.user_money)
+        this.shangwubi = Math.floor(data.shangwubi)
 
         return Message({
           type: 'success',

+ 0 - 58
src/views/recharge/test.vue

@@ -1,58 +0,0 @@
-<template>
-  <div class="login-container">
-    测试异步
-    <button @click="test">aaa</button>
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'Recharge',
-  data() {
-    return {
-
-    }
-  },
-  watch: {
-
-  },
-  created() {},
-  methods: {
-    async test() {
-      console.log('111')
-      this.test1().then(res => {
-        console.log(res)
-      })
-
-      console.log('555')
-    },
-    async test1() {
-      console.log('222')
-      const that = this
-      return new Promise((resolve, reject) => {
-        console.log('333')
-        setTimeout((resolve, that) => {
-          console.log('4444')
-          const res = that.test2()
-          resolve(res)
-        }, 2000, resolve, that)
-      })
-    },
-    async test2() {
-      return 'xxxxx'
-    }
-  }
-}
-</script>
-
-<style lang="scss">
-  .login-container{
-    margin: 20px;
-    background-color: #FFFFFF;
-
-    .el-bg-border{
-      border: 2px dashed #909399;
-      padding: 10px;
-    }
-  }
-</style>

+ 31 - 24
vue.config.js

@@ -30,7 +30,8 @@ module.exports = {
   publicPath: './',
   outputDir: 'dist',
   assetsDir: 'static',
-  lintOnSave: process.env.NODE_ENV === 'development', // 否使用eslint
+  // lintOnSave: process.env.NODE_ENV === 'development', // 否使用eslint
+  lintOnSave: false, // 否使用eslint
   productionSourceMap: false, // 如果您不需要生产时的源映射,那么将此设置为false可以加速生产构建
   devServer: {
     port: port,
@@ -41,8 +42,14 @@ module.exports = {
     },
     // before: require('./mock/mock-server.js'),
 
-    // 开启后可以访问线上域名进行测试
     proxy: {
+      // 登陆单独代理
+      '/v1/user/login': {
+        target: process.env.VUE_APP_LOGIN_URL,
+        changeOrigin: true,
+        logLevel: 'debug',
+        secure: true,
+      },
       [process.env.VUE_APP_BASE_API]: { // 这里是公共部分,在调用接口时后面接不相同的部分,/api就相当于http://192.168.0.199:8926/api这一段
         target: process.env.VUE_APP_BASE_URL, // 这里写的是访问接口的域名和端口号
         changeOrigin: true, // 必须加上这个才能跨域请求
@@ -103,34 +110,34 @@ module.exports = {
             .plugin('ScriptExtHtmlWebpackPlugin')
             .after('html')
             .use('script-ext-html-webpack-plugin', [{
-            // `runtime` must same as runtimeChunk name. default is `runtime`
+              // `runtime` must same as runtimeChunk name. default is `runtime`
               inline: /runtime\..*\.js$/
             }])
             .end()
           config
             .optimization.splitChunks({
-              chunks: 'all',
-              cacheGroups: {
-                libs: {
-                  name: 'chunk-libs',
-                  test: /[\\/]node_modules[\\/]/,
-                  priority: 10,
-                  chunks: 'initial' // only package third parties that are initially dependent
-                },
-                elementUI: {
-                  name: 'chunk-elementUI', // split elementUI into a single package
-                  priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
-                  test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
-                },
-                commons: {
-                  name: 'chunk-commons',
-                  test: resolve('src/components'), // can customize your rules
-                  minChunks: 3, //  minimum common number
-                  priority: 5,
-                  reuseExistingChunk: true
-                }
+            chunks: 'all',
+            cacheGroups: {
+              libs: {
+                name: 'chunk-libs',
+                test: /[\\/]node_modules[\\/]/,
+                priority: 10,
+                chunks: 'initial' // only package third parties that are initially dependent
+              },
+              elementUI: {
+                name: 'chunk-elementUI', // split elementUI into a single package
+                priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
+                test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
+              },
+              commons: {
+                name: 'chunk-commons',
+                test: resolve('src/components'), // can customize your rules
+                minChunks: 3, //  minimum common number
+                priority: 5,
+                reuseExistingChunk: true
               }
-            })
+            }
+          })
           // https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk
           config.optimization.runtimeChunk('single')
         }