Feat: login ok

This commit is contained in:
unitwk 2023-08-21 22:57:54 +08:00
parent 2ec3dd4c02
commit 8c2c1f65b2
4 changed files with 17 additions and 14 deletions

View File

@ -5,10 +5,10 @@ module.exports = {
},
extends: ["plugin:vue/vue3-recommended"],
rules: {
"vue/no-unused-vars": "error",
"vue/max-attributes-per-line": "off",
"vue/multi-word-component-names": "off",
"vue/html-self-closing": "off",
"vue/singleline-html-element-content-newline": "off"
"vue/singleline-html-element-content-newline": "off",
"no-unused-vars": "warn"
}
};

View File

@ -15,7 +15,7 @@ export const useDefineApi = <P, T>(baseConfig: RequestConfig = {}) => {
execute: async (config: P & RequestConfig) => {
await execute(0, config);
return state;
},
}
};
};
};

View File

@ -28,18 +28,17 @@ const handleLogin = async () => {
try {
const res = await login({
data: {
username: "1",
password: "2"
...formData
}
});
console.log("resresres:", res);
console.log("LOGIN:", res);
loginStep.value++;
await sleep(1200);
loginSuccess();
} catch (error) {
console.log("LOGIN ERROR:", error);
loginStep.value--;
}
loginStep.value++;
await sleep(1200);
loginSuccess();
};
const loginSuccess = () => {
@ -141,14 +140,18 @@ const loginSuccess = () => {
{{ t("使用服务器的 MCSManager 账号进入面板") }}
</a-typography-paragraph>
<div>
<a-input v-model="formData.username" :placeholder="t('账号')" size="large">
<a-input
v-model:value="formData.username"
:placeholder="t('账号')"
size="large"
>
<template #suffix>
<UserOutlined style="color: rgba(0, 0, 0, 0.45)" />
</template>
</a-input>
<a-input
v-model="formData.password"
v-model:value="formData.password"
class="mt-20"
:placeholder="t('密码')"
size="large"

View File

@ -3,12 +3,12 @@ import CardPanel from "@/components/CardPanel.vue";
import type { LayoutCard } from "@/types/index";
import { ref, computed, reactive } from "vue";
import { t } from "@/lang/i18n";
import { DownOutlined, SearchOutlined, UserOutlined } from "@ant-design/icons-vue";
import { DownOutlined, SearchOutlined } from "@ant-design/icons-vue";
import BetweenMenus from "@/components/BetweenMenus.vue";
import { useScreen } from "@/hooks/useScreen";
import { arrayFilter } from "@/tools/array";
const props = defineProps<{
defineProps<{
card: LayoutCard;
}>();