提交 381ec5c0 编写于 作者: RedPig97's avatar RedPig97

update:更新

上级 8f62c13f
...@@ -145,6 +145,9 @@ const rules: Ref<any> = ref({}); ...@@ -145,6 +145,9 @@ const rules: Ref<any> = ref({});
const loginForm: Ref<any> = ref(null); const loginForm: Ref<any> = ref(null);
const route = useRoute();
const router = useRouter();
const setRules = () => { const setRules = () => {
rules.value = { rules.value = {
loginname: [{ required: true, message: '用户名不能为空', trigger: 'change' }], loginname: [{ required: true, message: '用户名不能为空', trigger: 'change' }],
...@@ -204,9 +207,7 @@ const handleSubmit = (): void => { ...@@ -204,9 +207,7 @@ const handleSubmit = (): void => {
// 设置cookie,保存账号密码7天 // 设置cookie,保存账号密码7天
setCookie('loginname', loginname, 7, true); setCookie('loginname', loginname, 7, true);
// TODO 从路由中获取 // TODO 从路由中获取
const route = useRoute();
const url: any = route.query?.redirecrt ? route.query.redirecrt : '*'; const url: any = route.query?.redirecrt ? route.query.redirecrt : '*';
const router = useRouter();
router.push({ path: url }); router.push({ path: url });
} }
}) })
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册