Przeglądaj źródła

不允许给自己转账,恢复

theojeng 3 lat temu
rodzic
commit
8e040b27ab

+ 3 - 3
common/models/forms/TransferForm.php

@@ -298,9 +298,9 @@ class TransferForm extends Model {
         if (!$this->validate()) {
             return null;
         }
-        if ($this->_fromUserInfo['ID']==$this->_toUserInfo['ID']){
-            throw new \Exception('Not allowed to transfer to yourself');
-        }
+//        if ($this->_fromUserInfo['ID']==$this->_toUserInfo['ID']){
+//            throw new \Exception('Not allowed to transfer to yourself');
+//        }
         $fromData = Balance::getLogData($this->_fromUserInfo['ID']);
         $toData = Balance::getLogData($this->_toUserInfo['ID']);
         $this->userOperateLogger->saveBeforeContent=array_merge($fromData,$toData);

+ 7 - 17
frontendEle/src/views/finance/transfer-add.vue

@@ -54,7 +54,6 @@ import Vue from 'vue'
 import store from '@/utils/vuexStore'
 import network from '@/utils/network'
 import tool from '@/utils/tool'
-import userInfo from '@/utils/userInfo'
 
 export default {
   name: 'finance_withdraw-add',
@@ -93,22 +92,13 @@ export default {
   },
   methods: {
     handleChange () {
-      if (this.form.toUserName.trim() != userInfo.userName()){
-        this.loading = true
-        network.getData('user/full-info', {userName: this.form.toUserName}).then(response => {
-          console.log(userInfo.userName())
-          this.form.toRealName = response.REAL_NAME
-          this.loading = false
-        }).catch(response => {
-          this.loading = false
-        })
-      } else {
-        this.form.toUserName = ''
-        this.$message({
-          message: 'Not allowed to transfer to yourself',
-          type: 'error'
-        })
-      }
+      this.loading = true
+      network.getData('user/full-info', {userName: this.form.toUserName}).then(response => {
+        this.form.toRealName = response.REAL_NAME
+        this.loading = false
+      }).catch(response => {
+        this.loading = false
+      })
     },
     chkReal () {
       this.realAmount = tool.formatPrice(this.form.amount * (100 - this.fee) * 0.01)