fix: 🐛 密码重置取消控制台报错 Uncaught (in promise) cancel 问题修复
#IACULP #IACULP
This commit is contained in:
@@ -46,13 +46,14 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="handleQuery"
|
<el-button type="primary" @click="handleQuery">
|
||||||
><i-ep-search />搜索</el-button
|
<i-ep-search />
|
||||||
>
|
搜索
|
||||||
|
</el-button>
|
||||||
<el-button @click="handleResetQuery">
|
<el-button @click="handleResetQuery">
|
||||||
<i-ep-refresh />
|
<i-ep-refresh />
|
||||||
重置</el-button
|
重置
|
||||||
>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -65,24 +66,30 @@
|
|||||||
v-hasPerm="['sys:user:add']"
|
v-hasPerm="['sys:user:add']"
|
||||||
type="success"
|
type="success"
|
||||||
@click="handleOpenDialog()"
|
@click="handleOpenDialog()"
|
||||||
><i-ep-plus />新增</el-button
|
|
||||||
>
|
>
|
||||||
|
<i-ep-plus />
|
||||||
|
新增
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['sys:user:delete']"
|
v-hasPerm="['sys:user:delete']"
|
||||||
type="danger"
|
type="danger"
|
||||||
:disabled="removeIds.length === 0"
|
:disabled="removeIds.length === 0"
|
||||||
@click="handleDelete()"
|
@click="handleDelete()"
|
||||||
><i-ep-delete />删除</el-button
|
|
||||||
>
|
>
|
||||||
|
<i-ep-delete />
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button class="ml-3" @click="handleOpenImportDialog"
|
<el-button class="ml-3" @click="handleOpenImportDialog">
|
||||||
><template #icon><i-ep-upload /></template>导入</el-button
|
<template #icon><i-ep-upload /></template>
|
||||||
>
|
导入
|
||||||
|
</el-button>
|
||||||
|
|
||||||
<el-button class="ml-3" @click="handleExport"
|
<el-button class="ml-3" @click="handleExport">
|
||||||
><template #icon><i-ep-download /></template>导出</el-button
|
<template #icon><i-ep-download /></template>
|
||||||
>
|
导出
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -135,9 +142,9 @@
|
|||||||
|
|
||||||
<el-table-column label="状态" align="center" prop="status">
|
<el-table-column label="状态" align="center" prop="status">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tag :type="scope.row.status == 1 ? 'success' : 'info'">{{
|
<el-tag :type="scope.row.status == 1 ? 'success' : 'info'">
|
||||||
scope.row.status == 1 ? "启用" : "禁用"
|
{{ scope.row.status == 1 ? "启用" : "禁用" }}
|
||||||
}}</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@@ -154,24 +161,30 @@
|
|||||||
size="small"
|
size="small"
|
||||||
link
|
link
|
||||||
@click="hancleResetPassword(scope.row)"
|
@click="hancleResetPassword(scope.row)"
|
||||||
><i-ep-refresh-left />重置密码</el-button
|
|
||||||
>
|
>
|
||||||
|
<i-ep-refresh-left />
|
||||||
|
重置密码
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['sys:user:edit']"
|
v-hasPerm="['sys:user:edit']"
|
||||||
type="primary"
|
type="primary"
|
||||||
link
|
link
|
||||||
size="small"
|
size="small"
|
||||||
@click="handleOpenDialog(scope.row.id)"
|
@click="handleOpenDialog(scope.row.id)"
|
||||||
><i-ep-edit />编辑</el-button
|
|
||||||
>
|
>
|
||||||
|
<i-ep-edit />
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['sys:user:delete']"
|
v-hasPerm="['sys:user:delete']"
|
||||||
type="danger"
|
type="danger"
|
||||||
link
|
link
|
||||||
size="small"
|
size="small"
|
||||||
@click="handleDelete(scope.row.id)"
|
@click="handleDelete(scope.row.id)"
|
||||||
><i-ep-delete />删除</el-button
|
|
||||||
>
|
>
|
||||||
|
<i-ep-delete />
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -392,7 +405,8 @@ function hancleResetPassword(row: { [key: string]: any }) {
|
|||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
}
|
}
|
||||||
).then(({ value }) => {
|
).then(
|
||||||
|
({ value }) => {
|
||||||
if (!value || value.length < 6) {
|
if (!value || value.length < 6) {
|
||||||
// 检查密码是否为空或少于6位
|
// 检查密码是否为空或少于6位
|
||||||
ElMessage.warning("密码至少需要6位字符,请重新输入");
|
ElMessage.warning("密码至少需要6位字符,请重新输入");
|
||||||
@@ -401,7 +415,11 @@ function hancleResetPassword(row: { [key: string]: any }) {
|
|||||||
UserAPI.updatePassword(row.id, value).then(() => {
|
UserAPI.updatePassword(row.id, value).then(() => {
|
||||||
ElMessage.success("密码重置成功,新密码是:" + value);
|
ElMessage.success("密码重置成功,新密码是:" + value);
|
||||||
});
|
});
|
||||||
});
|
},
|
||||||
|
() => {
|
||||||
|
ElMessage.info("已取消重置密码");
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user