import AppList from "../../components/list/index.js"; import html from "html"; import useConfig from "../../models/user.js"; import request from "../../request/index.js"; import { format } from "../../utils/index.js"; import { ElMessage } from "element-plus"; export default { components: { AppList }, template: html``, setup() { // 变量定义 const config = useConfig(); // 函数定义 const onCommand = async (item, rows) => { console.log(item.path, item, rows); if (item.path === "%s/reset-password") { const url = format(item.path, rows[0].id); await request(`base/user/${url}`, null, { method: item.meta.method }); ElMessage({ type: "info", message: format("用户%s的密码已经成功重置为123456", rows[0].userName), }); } }; return { config, onCommand }; }, };