From 31aa3ba8a4b028d04c43b5960e23820abffd1ad1 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 27 五月 2024 14:23:09 +0800
Subject: [PATCH] 2024-05-27

---
 src/api/index.js |   31 +++++++++++++++++++++++++------
 1 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/src/api/index.js b/src/api/index.js
index 27f1e1f..f1c531d 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -57,6 +57,9 @@
 
     return Promise.reject(response.data)
   } else {
+    if (response.config.requestId) {
+      response.data.$requestId = response.config.requestId
+    }
     return Promise.resolve(response.data)
   }
 }, (error) => {
@@ -398,7 +401,7 @@
 
         this.getSystemConfig(param).then(res => {
           if (!res.status) {
-            reject()
+            reject(res.message)
             return
           }
 
@@ -438,7 +441,7 @@
 
           CacheUtils.updateIndexDBversion({version: res.app_version || '1.00', createDate: curTime})
 
-          resolve()
+          resolve(list)
         })
       }, () => {
         reject()
@@ -834,7 +837,7 @@
    * @description 鑾峰彇涓氬姟閫氱敤鎺ュ彛
    * 璁块棶 'https://sso.mk9h.cn/webapi/dostars'鎴栦簯绔椂锛屼紶鍏serid銆丩oginUID
    */
-  genericInterface (param, script = '', position) {
+  genericInterface (param, script = '', position, requestId = '') {
     param.userid = param.userid || sessionStorage.getItem('UserID') || ''
     param.lang = param.lang || sessionStorage.getItem('lang') || ''
     param.SessionUid = localStorage.getItem('SessionUid') || ''
@@ -862,8 +865,8 @@
     if (script) {
       try {
         // eslint-disable-next-line
-        let func = new Function('axios', 'Api', 'param', 'position', 'systemType', script)
-        let promise = func(axios, this, param, position, window.GLOB.systemType)
+        let func = new Function('axios', 'Api', 'param', 'position', 'systemType', 'notification', script)
+        let promise = func(axios, this, param, position, window.GLOB.systemType, notification)
 
         if (promise instanceof Promise) {
           return promise
@@ -947,7 +950,8 @@
       return axios({
         url: `${url}${param.func ? '/' + param.func : ''}`,
         method: 'post',
-        data: JSON.stringify(param)
+        data: JSON.stringify(param),
+        requestId
       })
     }
   }
@@ -1057,6 +1061,21 @@
     })
   }
 
+  /**
+   * @description 寰俊鏀粯閫�娆�
+   */
+  setRefund (orderId) {
+    let _param = new FormData()
+    _param.append('out_biz_no', orderId)
+
+    return axios({
+      url: '/wxpay/wxRefund',
+      headers: { 'Content-Type': 'multipart/form-data' },
+      method: 'post',
+      data: _param
+    })
+  }
+
   postekPrint (data) {
     return axios({
       url: 'http://127.0.0.1:888/postek/print',

--
Gitblit v1.8.0