consider the situation when reset section is not open. consider the situation when password is not sent to backend
This commit is contained in:
@@ -234,7 +234,7 @@ export default defineComponent({
|
||||
};
|
||||
|
||||
const validatePwdLength = () => {
|
||||
isPwdLengthValid.value = inputPwd.value.length >= PWD_VALID_LENGTH;
|
||||
isPwdLengthValid.value = !isResetPwdSectionShow.value || inputPwd.value.length >= PWD_VALID_LENGTH;
|
||||
}
|
||||
|
||||
const onInputDoubleClick = () => {
|
||||
@@ -274,6 +274,8 @@ export default defineComponent({
|
||||
return;
|
||||
}
|
||||
// 要注意的是舊的username跟新的username可以是不同的
|
||||
// 區分有無傳入密碼的情況
|
||||
if(isResetPwdSectionShow.value) {
|
||||
await acctMgmtStore.editAccount(
|
||||
currentViewingUser.value.username, {
|
||||
newUsername: inputUserAccount.value,
|
||||
@@ -281,6 +283,14 @@ export default defineComponent({
|
||||
name: inputName.value === undefined ? '' : inputName.value,
|
||||
is_active: true,
|
||||
});
|
||||
} else {
|
||||
await acctMgmtStore.editAccount(
|
||||
currentViewingUser.value.username, {
|
||||
newUsername: inputUserAccount.value,
|
||||
name: inputName.value === undefined ? '' : inputName.value,
|
||||
is_active: true,
|
||||
});
|
||||
}
|
||||
await toast.success(i18next.t("AcctMgmt.MsgAccountEdited"));
|
||||
isEditable.value = false;
|
||||
break;
|
||||
@@ -327,9 +337,10 @@ export default defineComponent({
|
||||
[inputPwd, inputUserAccount, inputName],
|
||||
([newPwd, newAccount, newName]) => {
|
||||
// 只要[確認密碼]或[密碼]欄位有更動,且所有欄位都不是空的,confirm 按鈕就可點選
|
||||
if (newPwd.length > 0 && newAccount.length > 0 && newName.length > 0) {
|
||||
if(newAccount.length > 0 && newName.length > 0) {
|
||||
isConfirmDisabled.value = false;
|
||||
} else {
|
||||
}
|
||||
if(isResetPwdSectionShow.value && newPwd.length < PWD_VALID_LENGTH) {
|
||||
isConfirmDisabled.value = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user