style: прогнать prettier по frontend
This commit is contained in:
@@ -18,7 +18,9 @@
|
||||
<el-input v-model="form.newPassword" show-password />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" :loading="saving" @click="submit">{{ $t("common.confirm") }}</el-button>
|
||||
<el-button type="primary" :loading="saving" @click="submit">{{
|
||||
$t("common.confirm")
|
||||
}}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
@@ -47,12 +49,28 @@ const form = reactive({
|
||||
const passwordPattern = /^[a-zA-Z0-9!@#$%^&*()_+-=]{6,64}$/;
|
||||
const rules: FormRules = {
|
||||
oldPassword: [
|
||||
{ required: true, message: t("common.required"), trigger: ["change", "blur"] },
|
||||
{ pattern: passwordPattern, message: t("common.invalid"), trigger: ["change", "blur"] },
|
||||
{
|
||||
required: true,
|
||||
message: t("common.required"),
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
{
|
||||
pattern: passwordPattern,
|
||||
message: t("common.invalid"),
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
newPassword: [
|
||||
{ required: true, message: t("common.required"), trigger: ["change", "blur"] },
|
||||
{ pattern: passwordPattern, message: t("common.invalid"), trigger: ["change", "blur"] },
|
||||
{
|
||||
required: true,
|
||||
message: t("common.required"),
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
{
|
||||
pattern: passwordPattern,
|
||||
message: t("common.invalid"),
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -66,10 +84,14 @@ const submit = async () => {
|
||||
}
|
||||
saving.value = true;
|
||||
try {
|
||||
await adminChangePasswordApi({ oldPassword: form.oldPassword, newPassword: form.newPassword });
|
||||
await adminChangePasswordApi({
|
||||
oldPassword: form.oldPassword,
|
||||
newPassword: form.newPassword,
|
||||
});
|
||||
adminStore.forcePasswordChange = false;
|
||||
ElMessage.success(t("admin.changedSuccess"));
|
||||
const redirect = typeof route.query.redirect === "string" ? route.query.redirect : "/";
|
||||
const redirect =
|
||||
typeof route.query.redirect === "string" ? route.query.redirect : "/";
|
||||
router.push(redirect);
|
||||
} finally {
|
||||
saving.value = false;
|
||||
@@ -82,4 +104,3 @@ const submit = async () => {
|
||||
max-width: 760px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user