From 3a9c0a33f8358cd81542994701436fbc99def3da Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 06 六月 2023 19:02:54 +0800
Subject: [PATCH] 1.生产入库调用畅捷通接口入库

---
 src/utils/global.js |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/src/utils/global.js b/src/utils/global.js
index 66c9e1c..4df4457 100644
--- a/src/utils/global.js
+++ b/src/utils/global.js
@@ -1,4 +1,7 @@
 import { NewEncodingRules } from '@/api/systemSettings'
+import { AppTicketSelect } from '@/api/basicInfo'
+import axios from 'axios'
+import Vue from 'vue'
 
 // 鍏ㄥ眬涓昏棰滆壊
 export function getGlobalColor() {
@@ -50,6 +53,7 @@
   // return `${y}-${m}-${d}  ${hh}:${mm}:${ss}   ${week}`
   return `${y}-${m}-${d}  ${hh}:${mm}:${ss}`
 }
+
 // 鏃堕棿澶勭悊鍑芥暟   杩斿洖 鏃跺垎
 export function handleDatetime3(value) {
   const dt = new Date(value)
@@ -98,3 +102,24 @@
     }
   }
 }
+
+// 鑾峰彇token 鐢ㄤ簬璇锋眰鐣呮嵎閫氭帴鍙�
+export async function getTPlusToken() {
+  const r1 = await AppTicketSelect()
+  const r2 = r1.data[0]
+  Vue.prototype.$AppKey = r2.appKey
+  Vue.prototype.$AppSecret = r2.appSecret
+  const data = {
+    appTicket: r2.AppTicket,
+    certificate: r2.certificate
+  }
+  const r3 = await axios.post(Vue.prototype.$chanjetBaseUrl + '/v1/common/auth/selfBuiltApp/generateToken',
+    data, {
+      headers: {
+        'appKey': Vue.prototype.$AppKey,
+        'appSecret': Vue.prototype.$AppSecret,
+        'Content-Type': 'application/json'
+      }
+    })
+  return r3.data.value.accessToken
+}

--
Gitblit v1.9.3