From aa626b7be93429b488505766565e44cf2f0e20f3 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Thu, 8 Jul 2021 09:44:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86=E7=A6=81?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/api.js | 2 ++ src/views/user/AddUser.vue | 11 ++++++++--- src/views/user/User.vue | 16 +++++++--------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/utils/api.js b/src/utils/api.js index fca5ac5..4ae60d5 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -54,6 +54,8 @@ export default { checkCode: `${host3}/users/userAccount/checkCode`, findPasswordByEmail: `${host3}/users/userAccount/findPasswordByEmail`, findPasswordByPhone: `${host3}/users/userAccount/findPasswordByPhone`, + updateAccountEnable: `${host3}/users/userAccount/updateAccountEnable`, + updateAccountAllEnable: `${host3}/users/userAccount/updateAccountAllEnable`, queryOrder: `${host}/liuwanr/order/queryOrder`, //查询订单 queryOrderDetails: `${host}/liuwanr/order/queryOrderDetails`, //查询订单详情 diff --git a/src/views/user/AddUser.vue b/src/views/user/AddUser.vue index 15567de..c6cb161 100644 --- a/src/views/user/AddUser.vue +++ b/src/views/user/AddUser.vue @@ -348,7 +348,7 @@

{{item1.account}}

  • - +
  • @@ -830,8 +830,13 @@ export default { console.log(11,list) }).catch(res => {}) }, - switchOff(val,item){ - console.log(val,item) + switchOff(val,row){ + this.$get(this.api.updateAccountEnable,{ + id: row.id, + isEnable: val + }).then(res => { + this.$message.success(val ? '启用成功' : '禁用成功') + }).catch(res => {}) } } }; diff --git a/src/views/user/User.vue b/src/views/user/User.vue index e6c979c..b5ab9a5 100644 --- a/src/views/user/User.vue +++ b/src/views/user/User.vue @@ -110,7 +110,7 @@ 删除 重置密码 - + @@ -336,14 +336,12 @@ export default { }).catch(() => {}) }, switchOff(val,row,index) { - let data = { - id: row.id, - isDisable: val - } - this.$post(this.api.updateClient,data).then((res) => { - this.$message.success(val ? '启用成功' : '禁用成功') - }).catch((res) => { - }) + this.$get(this.api.updateAccountAllEnable,{ + id: row.userId, + isEnable: val + }).then(res => { + this.$message.success(val ? '启用成功' : '禁用成功') + }).catch(res => {}) }, handleSelectionChange(val) { this.multipleSelection = val