Parcourir la source

修改 账号管理 编辑按钮逻辑

MS-CIAZDCOIXVRW\Administrator il y a 3 ans
Parent
commit
8a8ed4571d
2 fichiers modifiés avec 13 ajouts et 10 suppressions
  1. 1 1
      src/constant/index.js
  2. 12 9
      src/views/account-management/index.vue

+ 1 - 1
src/constant/index.js

@@ -1,5 +1,5 @@
 // token
-export const TOKEN = 'token'
+export const TOKEN = 'agentToken'
 
 // 用户信息
 export const USERINFO = 'userInfo'

+ 12 - 9
src/views/account-management/index.vue

@@ -344,14 +344,14 @@ const handleEdit = (row) => {
 
 // 编辑弹窗确定按钮回调
 const handleEditConfirm = async () => {
-  if (editInfo.value.newPassword === '') {
-    ElMessage.error('请输入密码')
-    return
-  }
-  if (editInfo.value.newPassword2 === '') {
-    ElMessage.error('请输入确认新密码')
-    return
-  }
+  // if (editInfo.value.newPassword === '') {
+  //   ElMessage.error('请输入密码')
+  //   return
+  // }
+  // if (editInfo.value.newPassword2 === '') {
+  //   ElMessage.error('请输入确认新密码')
+  //   return
+  // }
   if (editInfo.value.newPassword !== editInfo.value.newPassword2) {
     ElMessage.error('两次输入的密码不一致')
     return
@@ -360,7 +360,10 @@ const handleEditConfirm = async () => {
     id: editInfo.value.id,
     userName: editInfo.value.userName,
     name: editInfo.value.name,
-    password: RSAencrypt(editInfo.value.newPassword)
+    password:
+      editInfo.value.newPassword !== ''
+        ? RSAencrypt(editInfo.value.newPassword)
+        : ''
   })
   // console.log(res)
   if (res == null) {