mirror of
https://github.com/chansee97/nova-admin.git
synced 2025-04-05 19:41:59 +08:00
fix(project): modify proejct name
This commit is contained in:
parent
9ff3494045
commit
9525f80a0b
6
.env
6
.env
@ -1,11 +1,7 @@
|
||||
# 项目根目录
|
||||
VITE_BASE_URL=/
|
||||
# 项目名称
|
||||
VITE_APP_NAME=EnchAdmin
|
||||
|
||||
VITE_APP_TITLE=Ench管理系统
|
||||
|
||||
VITE_APP_DESC=EnchAdmin是一个中后台管理系统模版
|
||||
VITE_APP_NAME=Nova - Admin
|
||||
|
||||
# 路由模式
|
||||
VITE_ROUTE_MODE = web
|
||||
|
@ -1,6 +1,6 @@
|
||||
<div align="center">
|
||||
<img src="./public/favicon.svg" style="width:150px"/>
|
||||
<h1>Ench Admin</h1>
|
||||
<h1>Nova Admin</h1>
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
|
28
index.html
28
index.html
@ -1,14 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>%VITE_APP_TITLE%</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="appLoading"></div>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link
|
||||
rel="icon"
|
||||
href="/favicon.svg" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0" />
|
||||
<title>%VITE_APP_NAME%</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="appLoading"></div>
|
||||
<div id="app"></div>
|
||||
<script
|
||||
type="module"
|
||||
src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "ench-admin",
|
||||
"name": "nova-admin",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"description": "",
|
||||
|
@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { useAppInfo } from '@/hooks'
|
||||
|
||||
const { title } = useAppInfo()
|
||||
const { name } = useAppInfo()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -33,7 +33,7 @@ const { title } = useAppInfo()
|
||||
</div>
|
||||
</div>
|
||||
<n-h1 class="z-1">
|
||||
{{ title }}
|
||||
{{ name }}
|
||||
</n-h1>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -4,24 +4,14 @@ import { isArray, isString } from '@/utils'
|
||||
interface AppInfo {
|
||||
/** 项目名称 */
|
||||
name: string
|
||||
/** 项目标题 */
|
||||
title: string
|
||||
/** 项目描述 */
|
||||
desc: string
|
||||
}
|
||||
|
||||
/** 项目信息 */
|
||||
export function useAppInfo(): AppInfo {
|
||||
const {
|
||||
VITE_APP_NAME: name,
|
||||
VITE_APP_TITLE: title,
|
||||
VITE_APP_DESC: desc,
|
||||
} = import.meta.env
|
||||
const { VITE_APP_NAME: name } = import.meta.env
|
||||
|
||||
return {
|
||||
name,
|
||||
title,
|
||||
desc,
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,21 +19,19 @@ export function useAppInfo(): AppInfo {
|
||||
export function usePermission() {
|
||||
const authStore = useAuthStore()
|
||||
|
||||
function hasPermission(permission: Auth.RoleType | Auth.RoleType[] | undefined) {
|
||||
if (!permission)
|
||||
return true
|
||||
function hasPermission(
|
||||
permission: Auth.RoleType | Auth.RoleType[] | undefined,
|
||||
) {
|
||||
if (!permission) return true
|
||||
|
||||
if (!authStore.userInfo)
|
||||
return false
|
||||
if (!authStore.userInfo) return false
|
||||
const { role } = authStore.userInfo
|
||||
|
||||
let has = role === 'super'
|
||||
if (!has) {
|
||||
if (isArray(permission))
|
||||
has = (permission).includes(role)
|
||||
if (isArray(permission)) has = permission.includes(role)
|
||||
|
||||
if (isString(permission))
|
||||
has = (permission) === role
|
||||
if (isString(permission)) has = permission === role
|
||||
}
|
||||
return has
|
||||
}
|
||||
|
@ -1,16 +1,18 @@
|
||||
<script setup lang="ts">
|
||||
interface Props {
|
||||
showWatermark: boolean
|
||||
text: string
|
||||
}
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
showWatermark: false,
|
||||
text: 'Watermark',
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-watermark
|
||||
v-if="props.showWatermark"
|
||||
content="Ench-Admin"
|
||||
:content="props.text"
|
||||
cross
|
||||
fullscreen
|
||||
:font-size="16"
|
||||
|
@ -10,7 +10,7 @@ const MassageData = ref<Message.Tab[]>([
|
||||
list: [
|
||||
{
|
||||
id: 0,
|
||||
title: 'EnchAdmin 已经完成40%了!',
|
||||
title: 'Admin 已经完成40%了!',
|
||||
icon: 'icon-park-outline:tips-one',
|
||||
tagTitle: '未开始',
|
||||
tagType: 'info',
|
||||
@ -19,7 +19,7 @@ const MassageData = ref<Message.Tab[]>([
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: 'EnchAdmin 已经添加通知功能!',
|
||||
title: 'Admin 已经添加通知功能!',
|
||||
icon: 'icon-park-outline:comment-one',
|
||||
tagTitle: '未开始',
|
||||
tagType: 'success',
|
||||
@ -27,7 +27,7 @@ const MassageData = ref<Message.Tab[]>([
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: 'EnchAdmin 已经添加路由功能!',
|
||||
title: 'Admin 已经添加路由功能!',
|
||||
icon: 'icon-park-outline:message-emoji',
|
||||
tagTitle: '未开始',
|
||||
tagType: 'warning',
|
||||
@ -37,7 +37,7 @@ const MassageData = ref<Message.Tab[]>([
|
||||
{
|
||||
id: 3,
|
||||
title:
|
||||
'EnchAdmin 已经添加菜单导航功能!EnchAdmin 已经添加菜单导航功能!EnchAdmin 已经添加菜单导航功能!EnchAdmin 已经添加菜单导航功能!',
|
||||
'Admin 已经添加菜单导航功能!Admin 已经添加菜单导航功能!Admin 已经添加菜单导航功能!Admin 已经添加菜单导航功能!',
|
||||
icon: 'icon-park-outline:tips-one',
|
||||
tagTitle: '未开始',
|
||||
tagType: 'error',
|
||||
@ -47,7 +47,7 @@ const MassageData = ref<Message.Tab[]>([
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
title: 'EnchAdmin开始启动了!',
|
||||
title: 'Admin开始启动了!',
|
||||
icon: 'icon-park-outline:tips-one',
|
||||
tagTitle: '未开始',
|
||||
description: '项目稳定推进中...',
|
||||
|
@ -2,7 +2,7 @@ import type { Router } from 'vue-router'
|
||||
import { createPermissionGuard } from './permission'
|
||||
import { useRouteStore, useTabStore } from '@/store'
|
||||
|
||||
const title = import.meta.env.VITE_APP_TITLE
|
||||
const title = import.meta.env.VITE_APP_NAME
|
||||
|
||||
export function setupRouterGuard(router: Router) {
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
|
@ -26,7 +26,7 @@ const isDark = useDark({
|
||||
export const useAppStore = defineStore('app-store', {
|
||||
state: (): AppStatus => {
|
||||
return {
|
||||
footerText: 'Copyright ©2023 Ench Admin',
|
||||
footerText: 'Copyright ©2023 Nova Admin',
|
||||
collapsed: false,
|
||||
fullScreen: false,
|
||||
darkMode: isDark.value,
|
||||
@ -60,8 +60,9 @@ export const useAppStore = defineStore('app-store', {
|
||||
}
|
||||
else {
|
||||
// @ts-expect-error experimental API
|
||||
const isAppearanceTransition = document.startViewTransition
|
||||
&& !window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
||||
const isAppearanceTransition
|
||||
= document.startViewTransition
|
||||
&& !window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
||||
|
||||
if (!isAppearanceTransition) {
|
||||
isDark.value = !isDark.value
|
||||
@ -80,27 +81,24 @@ export const useAppStore = defineStore('app-store', {
|
||||
this.darkMode = isDark.value
|
||||
await nextTick()
|
||||
})
|
||||
transition.ready
|
||||
.then(() => {
|
||||
const clipPath = [
|
||||
`circle(0px at ${x}px ${y}px)`,
|
||||
`circle(${endRadius}px at ${x}px ${y}px)`,
|
||||
]
|
||||
document.documentElement.animate(
|
||||
{
|
||||
clipPath: isDark.value
|
||||
? [...clipPath].reverse()
|
||||
: clipPath,
|
||||
},
|
||||
{
|
||||
duration: 400,
|
||||
easing: 'ease-out',
|
||||
pseudoElement: isDark.value
|
||||
? '::view-transition-old(root)'
|
||||
: '::view-transition-new(root)',
|
||||
},
|
||||
)
|
||||
})
|
||||
transition.ready.then(() => {
|
||||
const clipPath = [
|
||||
`circle(0px at ${x}px ${y}px)`,
|
||||
`circle(${endRadius}px at ${x}px ${y}px)`,
|
||||
]
|
||||
document.documentElement.animate(
|
||||
{
|
||||
clipPath: isDark.value ? [...clipPath].reverse() : clipPath,
|
||||
},
|
||||
{
|
||||
duration: 400,
|
||||
easing: 'ease-out',
|
||||
pseudoElement: isDark.value
|
||||
? '::view-transition-old(root)'
|
||||
: '::view-transition-new(root)',
|
||||
},
|
||||
)
|
||||
})
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
2
src/typings/env.d.ts
vendored
2
src/typings/env.d.ts
vendored
@ -22,8 +22,6 @@ interface ImportMetaEnv {
|
||||
readonly VITE_BASE_URL: string
|
||||
/** 项目标题 */
|
||||
readonly VITE_APP_NAME: string
|
||||
readonly VITE_APP_TITLE: string
|
||||
readonly VITE_APP_DESC: string
|
||||
/** 开启请求代理 */
|
||||
readonly VITE_HTTP_PROXY?: 'Y' | 'N'
|
||||
/** 是否开启打包依赖分析 */
|
||||
|
@ -5,7 +5,7 @@ import lib from '~/package.json'
|
||||
<template>
|
||||
<n-space vertical>
|
||||
<n-card title="关于">
|
||||
Ench-admin是一款基于Vue3+vite+TypeScript+Navie
|
||||
Nova-admin是一款基于Vue3+vite+TypeScript+Navie
|
||||
UI的后台管理模板,力求使用简约的代码实现完备功能,降低学习门槛和维护成本,让大家能早点下班做自己的事情
|
||||
</n-card>
|
||||
<n-card title="信息">
|
||||
|
@ -27,7 +27,7 @@ const formComponets = {
|
||||
>
|
||||
<n-gi>
|
||||
<div class="h-full flex-col">
|
||||
<n-h2>Ench-admin</n-h2>
|
||||
<n-h2>Nova </n-h2>
|
||||
<img
|
||||
src="@/assets/svg/login-illus.svg"
|
||||
class="h-80%"
|
||||
|
Loading…
x
Reference in New Issue
Block a user