|
@@ -61,19 +61,19 @@
|
|
|
const userStore = useUserStore();
|
|
const userStore = useUserStore();
|
|
|
|
|
|
|
|
const formValue = reactive({
|
|
const formValue = reactive({
|
|
|
- username: '',
|
|
|
|
|
|
|
+ username: userStore.info.username,
|
|
|
password: '',
|
|
password: '',
|
|
|
});
|
|
});
|
|
|
const emit = defineEmits(['close']);
|
|
const emit = defineEmits(['close']);
|
|
|
const formRef = ref<FormInstance>();
|
|
const formRef = ref<FormInstance>();
|
|
|
const handleLogin = () => {
|
|
const handleLogin = () => {
|
|
|
if (!formRef.value) return;
|
|
if (!formRef.value) return;
|
|
|
- formRef.value.validate((valid: boolean, ...rest) => {
|
|
|
|
|
|
|
+ formRef.value.validate((valid: boolean) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
console.log('valid', formValue);
|
|
console.log('valid', formValue);
|
|
|
userStore
|
|
userStore
|
|
|
.login(formValue)
|
|
.login(formValue)
|
|
|
- .then((res) => {
|
|
|
|
|
|
|
+ .then(() => {
|
|
|
window.location.reload();
|
|
window.location.reload();
|
|
|
})
|
|
})
|
|
|
.catch((err) => {
|
|
.catch((err) => {
|