Просмотр исходного кода

Merge branch 'master' of http://git.echepei.com/tire-platform/tire-platform-ui

qukaidi 4 недель назад
Родитель
Сommit
1b94681385
2 измененных файлов с 33 добавлено и 4 удалено
  1. 20 0
      src/views/landTransportation/bulkReportAnalysis/index.vue
  2. 13 4
      vue.config.js

+ 20 - 0
src/views/landTransportation/bulkReportAnalysis/index.vue

@@ -186,6 +186,13 @@ import {gaude} from "@/api/gaude";
 import {getSalesman} from "@/api/landTransportation/bulkCargo";
 import { dateFormat } from "@/util/date";
 import { isProcurement } from "@/api/basicData/configuration";
+import axios from 'axios'
+
+const gizwitsHttp = axios.create({
+  timeout: 30000,
+  withCredentials: false,
+  headers: { 'Content-Type': 'application/json' }
+})
 export default {
   name: "index",
   data() {
@@ -1012,6 +1019,7 @@ export default {
     }
   },
   async created() {
+      this.test()
     if (this.roleName.indexOf('客户') !== -1 || this.roleName.indexOf('散货经理') !== -1) {
       this.optionList = this.optionListOne
     } else if (this.roleName.indexOf('平台') !== -1||this.roleName.indexOf('admin') !== -1) {
@@ -1075,6 +1083,18 @@ export default {
     });
   },
   methods: {
+      test() {
+        const url =
+          '/enterprise-gizwits/v1/products/69740dade7f14816a1bc77b3e0cc4595/access_token'
+        gizwitsHttp
+          .post(url, {
+            enterprise_id: '53e44ae3bfdd4e92990128c8a6e0dd0e',
+            enterprise_secret: '0b9697a953e74aed88938b6373b92865',
+            product_secret: '187e384cce504202ac4e79d1fda85d34'
+          })
+          .then(res => console.info('res-----', res))
+          .catch(err => console.warn('gizwits token', err))
+      },
     calculateHu() {
       let i = 0;
       this.goodsOptionCrud.column.forEach(item => {

+ 13 - 4
vue.config.js

@@ -46,15 +46,16 @@ module.exports = {
   //开发模式反向代理配置,生产模式请使用Nginx部署并配置反向代理
   devServer: {
     port: 1026,
+    // host: '192.168.8.108',
     proxy: {
       '/api': {
         //本地服务接口地址
         // target: 'http://192.168.8.106:1080',
-        target: 'http://192.168.8.118:1080',
-        // target: 'http://192.168.8.120:1080',
-        // target: 'http://127.0.0.1:1080',
+        // target: 'http://192.168.8.118:1080',
+        // target: 'http://192.168.8.108:1080',
+        // target: 'http://localhost:1080',
         // 打包地址
-        // target: 'http://121.37.83.47:10004',//服务器ip
+        target: 'https://lt.echepei.com/api',//服务器ip
         // target: 'http://192.168.161.11:10004',//服务器ip
         //  target: 'http://127.0.0.1:10004',
         // target: 'http://trade.tubaosoft.com:10004',//服务器域名
@@ -62,6 +63,14 @@ module.exports = {
         pathRewrite: {
           '^/api': '/'
         }
+      },
+      '/enterprise-gizwits': {
+        target: 'http://enterpriseapi.gizwits.com',
+        changeOrigin: true,
+        secure: false,
+        pathRewrite: {
+          '^/enterprise-gizwits': ''
+        }
       }
     }
   }