|
|
@@ -1,6 +1,5 @@
|
|
|
<script setup lang="ts">
|
|
|
import Background from '@/pages/common/components/Background.vue'
|
|
|
-import Copyright from '@/components/Copyright.vue'
|
|
|
import { LockOnIcon, UserIcon } from 'tdesign-icons-vue-next'
|
|
|
import { reactive, ref } from 'vue'
|
|
|
import type { CreateTokenRequest } from '@/model/token'
|
|
|
@@ -9,16 +8,14 @@ import { useAppStore } from '@/stores/app'
|
|
|
|
|
|
const loginForm = reactive<CreateTokenRequest>({
|
|
|
password: '',
|
|
|
- email: ''
|
|
|
+ username: ''
|
|
|
})
|
|
|
|
|
|
-const canRegister = ref(false)
|
|
|
-
|
|
|
const loading = ref(false)
|
|
|
const appStore = useAppStore()
|
|
|
|
|
|
const handleLogin = async () => {
|
|
|
- if (!loginForm.email || !loginForm.password) {
|
|
|
+ if (!loginForm.username || !loginForm.password) {
|
|
|
MessagePlugin.error('用户名或密码不能为空')
|
|
|
return
|
|
|
}
|
|
|
@@ -28,19 +25,15 @@ const handleLogin = async () => {
|
|
|
loading.value = false
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
<div class="w-[100vw] h-[100vh] px-20 flex items-center">
|
|
|
<Background></Background>
|
|
|
<div class="w-[400px]">
|
|
|
- <div class="text-4xl font-bold mb-12">欢迎到<br />Yili Admin</div>
|
|
|
- <div class="mb-12 flex items-center gap-2" v-if="canRegister">
|
|
|
- 买有账号?<TLink>注册新账号</TLink>
|
|
|
- </div>
|
|
|
+ <div class="text-4xl font-bold mb-12">欢迎到<br />布兰德后台管理系统</div>
|
|
|
<div class="flex flex-col gap-6 mb-11">
|
|
|
- <TInput size="large" placeholder="用户名/邮箱" v-model="loginForm.email" clearable >
|
|
|
+ <TInput size="large" placeholder="账户" v-model="loginForm.username" clearable>
|
|
|
<template #prefix-icon>
|
|
|
<UserIcon></UserIcon>
|
|
|
</template>
|
|
|
@@ -57,15 +50,10 @@ const handleLogin = async () => {
|
|
|
<LockOnIcon></LockOnIcon>
|
|
|
</template>
|
|
|
</TInput>
|
|
|
- <div class="flex justify-between items-center">
|
|
|
- <TCheckbox>记住账号</TCheckbox>
|
|
|
- <TLink>忘记密码?</TLink>
|
|
|
- </div>
|
|
|
</div>
|
|
|
<TButton size="large" :block="true" @click="handleLogin" :loading="loading">
|
|
|
{{ loading ? '登录中' : '登录' }}
|
|
|
</TButton>
|
|
|
- <Copyright />
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|