Ver código fonte

Merge branch 'develop_yh36' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into develop_yh36

chenrui 1 ano atrás
pai
commit
85a15536c5
3 arquivos alterados com 31 adições e 6 exclusões
  1. 1 1
      public/version.json
  2. 20 5
      src/api/data.js
  3. 10 0
      src/utils/request.js

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1708671936024
+  "version": 1708909123892
 }

+ 20 - 5
src/api/data.js

@@ -4,7 +4,10 @@ export function login (parameter) {
   return axios({
     url: '/auth/login',
     method: 'post',
-    data: parameter
+    data: parameter,
+    headers:{
+      'module': encodeURIComponent('登录')
+    }
   })
 }
 
@@ -24,7 +27,10 @@ export const getLookUpData = (params) => {
   return axios({
     url: url,
     data: params,
-    method: 'post'
+    method: 'post',
+    headers:{
+      'module': encodeURIComponent('数据字典('+params.lookupCode+')项查询')
+    }
   })
 }
 
@@ -131,7 +137,10 @@ export const bizStateCount = (params) => {
   return axios({
     url: `/home/queryBizStateCount`,
     data: params,
-    method: 'post'
+    method: 'post',
+    headers:{
+      'module': encodeURIComponent('待处理数据')
+    }
   })
 }
 // 首页  数据看板信息
@@ -139,7 +148,10 @@ export const bizData = (params) => {
   return axios({
     url: `/home/queryBizData`,
     data: params,
-    method: 'post'
+    method: 'post',
+    headers:{
+      'module': encodeURIComponent('数据看板信息')
+    }
   })
 }
 // 首页  商户信息
@@ -147,6 +159,9 @@ export const dealerData = (params) => {
   return axios({
     url: `/dealer/findCurrentDealer`,
     data: params,
-    method: 'get'
+    method: 'get',
+    headers:{
+      'module': encodeURIComponent('商户信息')
+    }
   })
 }

+ 10 - 0
src/utils/request.js

@@ -1,6 +1,7 @@
 import Vue from 'vue'
 import axios from 'axios'
 import store from '@/store'
+import router from '@/router'
 import notification from 'ant-design-vue/es/notification'
 import modal from 'ant-design-vue/es/modal'
 import { VueAxios } from './axios'
@@ -87,6 +88,15 @@ service.interceptors.request.use(config => {
     config.headers['access-token'] = token // 让每个请求携带自定义 token 请根据实际情况自行修改
     config.headers['access-org'] = changeOrg // 当前要切换的账号 sn
   }
+  
+  // 当前页面路径
+  const currentPage = router.history.current
+  if(currentPage&&currentPage.meta&&config.headers['module']){
+    config.headers['module'] = encodeURIComponent(currentPage.meta.title||'') + ',' +config.headers['module']
+  }
+  console.log(config.url)
+  console.log(decodeURIComponent(config.headers['module']))
+  
   config.retry = 3
   config.retryDelay = 1000
   store.commit('SET_loadingStatus', true)