Merge branch 'feature/25-login' into feature/31-carousal
This commit is contained in:
commit
5f9e951aa8
10 files changed
+42
-60
No files matched your search
@@ -1,14 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
<script setup lang="ts"></script>
|
||||
|
||||
<template>
|
||||
<div class="w-full h-[56px] flex items-center text-2xl cursor-pointer gap-2 font-bold">
|
||||
<img src="@/assets/icons/logo.svg" class="w-[32px]" />
|
||||
Yili Admin
|
||||
布兰德后台
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped></style>
|
||||
@@ -1,25 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import UserArea from '@/layouts/components/UserArea.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
const router = useRouter()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="w-full h-full flex items-center justify-between px-6">
|
||||
<TSpace>
|
||||
<!-- <TButton variant="text" shape="square">-->
|
||||
<!-- <template #icon> <ViewListIcon /></template>-->
|
||||
<!-- </TButton>-->
|
||||
<TButton variant="text" @click="() => router.push({ name: 'platform-manage'
|
||||
})">切换平台</TButton>
|
||||
</TSpace>
|
||||
|
||||
<UserArea></UserArea>
|
||||
</div>
|
||||
<div class="w-full h-full flex items-center justify-end px-6">
|
||||
<UserArea></UserArea>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped></style>
|
||||
@@ -1,9 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import { ChevronDownIcon } from 'tdesign-icons-vue-next'
|
||||
import type { DropdownOption } from 'tdesign-vue-next'
|
||||
import { useAppStore } from '@/stores/app'
|
||||
import type { User } from '@/models/user'
|
||||
const appStore = useAppStore()
|
||||
const currentUser: User = appStore.currentUser
|
||||
const options: DropdownOption[] = [
|
||||
{
|
||||
content: '退出登录',
|
||||
@@ -20,7 +21,7 @@ const options: DropdownOption[] = [
|
||||
<TButton variant="text">
|
||||
<div class="flex gap-2 items-center">
|
||||
<TAvatar size="24px" image="https://tdesign.gtimg.com/site/avatar.jpg"></TAvatar>
|
||||
依力
|
||||
{{ currentUser.username }}
|
||||
<ChevronDownIcon />
|
||||
</div>
|
||||
</TButton>
|
||||
@@ -28,6 +29,4 @@ const options: DropdownOption[] = [
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped></style>
|
||||
+9
-2
@@ -1,11 +1,18 @@
|
||||
import type { User } from "./user";
|
||||
|
||||
export interface ErrorResponse {
|
||||
code: number;
|
||||
message: string;
|
||||
}
|
||||
export interface BaseModel {
|
||||
id: number
|
||||
createdTime: Date
|
||||
updateTime: Date
|
||||
createdTime: string
|
||||
updateTime: string
|
||||
}
|
||||
|
||||
export interface AuditBaseModel extends BaseModel {
|
||||
createBy: User
|
||||
updateBy: User
|
||||
}
|
||||
|
||||
export interface Paging {
|
||||
|
||||
+6
-9
@@ -1,15 +1,12 @@
|
||||
import type { BaseFilterRequest, BaseModel } from '@/model/base'
|
||||
import type { Role } from '@/model/role'
|
||||
import type { BaseFilterRequest, AuditBaseModel } from '@/model/base'
|
||||
|
||||
export interface User extends BaseModel{
|
||||
name: string
|
||||
email: string
|
||||
avatar: string
|
||||
roles: Role[]
|
||||
permissions: string[]
|
||||
export interface User extends AuditBaseModel{
|
||||
username: string
|
||||
locked: boolean
|
||||
enabled: boolean
|
||||
}
|
||||
|
||||
|
||||
export interface UserSearchFilter extends BaseFilterRequest {
|
||||
name?: string
|
||||
username?: string
|
||||
}
|
||||
@@ -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'
|
||||
@@ -8,12 +7,10 @@ import { MessagePlugin } from 'tdesign-vue-next'
|
||||
import { useAppStore } from '@/stores/app'
|
||||
|
||||
const loginForm = reactive<CreateTokenRequest>({
|
||||
username: 'admin',
|
||||
password: 'admin123'
|
||||
password: '',
|
||||
username: ''
|
||||
})
|
||||
|
||||
const canRegister = ref(false)
|
||||
|
||||
const loading = ref(false)
|
||||
const appStore = useAppStore()
|
||||
|
||||
@@ -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.username" 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>
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ const router = createRouter({
|
||||
component: Layout,
|
||||
path: '/',
|
||||
redirect: {
|
||||
name: 'dashboard'
|
||||
name: 'classify'
|
||||
},
|
||||
children: asyncRoutes
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user