From 6208ba6872cc54ccbd2b2ff3b67a1a2f054af41d Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 19 九月 2023 14:52:15 +0800
Subject: [PATCH] 1.生产入库实现

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

diff --git a/src/utils/global.js b/src/utils/global.js
index dedc120..3b4889c 100644
--- a/src/utils/global.js
+++ b/src/utils/global.js
@@ -1,4 +1,7 @@
 import { NewEncodingRules } from '@/api/xtsz'
+import axios from 'axios'
+import Vue from 'vue'
+import { AppTicketSelect } from '@/api/jcsz'
 
 // 鍏ㄥ眬涓昏棰滆壊
 export function getGlobalColor() {
@@ -91,3 +94,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