panhui 3 лет назад
Родитель
Сommit
90681e34ce
2 измененных файлов с 18 добавлено и 0 удалено
  1. 4 0
      src/plugins/http.js
  2. 14 0
      src/views/user/Wallet.vue

+ 4 - 0
src/plugins/http.js

@@ -13,6 +13,10 @@ axiosInstance.interceptors.request.use(
         if (token) {
             config.headers['Authorization'] = 'Bearer ' + token;
         }
+        let companyId = sessionStorage.getItem('companyId');
+        if (companyId) {
+            config.headers['companyId'] = companyId;
+        }
         return config;
     },
     function (error) {

+ 14 - 0
src/views/user/Wallet.vue

@@ -325,6 +325,20 @@ export default {
                             this.$toast(e.error || '充值失败');
                         });
                     break;
+                case 'ALI':
+                    this.$toast.loading('充值中');
+                    this.$http
+                        .post('/recharge/ali', { amount: this.amount, companyId: this.companyId })
+                        .then(res => {
+                            this.openScheme(res);
+                            setTimeout(() => {
+                                this.$toast.clear();
+                            }, 1000);
+                        })
+                        .catch(e => {
+                            this.$toast(e.error || '充值失败');
+                        });
+                    break;
                 case 'SYXPAY':
                     this.$router.push({
                         name: 'bankPay',