mirror of
https://github.com/zclzone/vue-naive-admin.git
synced 2025-12-28 20:10:22 +08:00
Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
00f3d51c1d | ||
|
|
c9425d8803 | ||
|
|
204a7b3a9b | ||
|
|
417f85b8ed | ||
|
|
b47f3d35ca | ||
|
|
91dd2059f8 | ||
|
|
c71a717b8d | ||
|
|
89c3923874 | ||
|
|
f4be4bfb36 | ||
|
|
33da6652a6 | ||
|
|
4be6e4a3ca | ||
|
|
08b30bc864 | ||
|
|
84d8377816 | ||
|
|
d25941befe | ||
|
|
0490e4ded6 | ||
|
|
3ca70e11e1 | ||
|
|
e149dc90b4 | ||
|
|
2a61038fe3 | ||
|
|
7a9b1b2d34 | ||
|
|
9e3c434630 | ||
|
|
63cc4a8b7b | ||
|
|
d1ed8bb933 | ||
|
|
be1884bd05 | ||
|
|
60942e82f3 | ||
|
|
db56ee536b | ||
|
|
53de707509 | ||
|
|
60d0162ced | ||
|
|
4fff446dca | ||
|
|
a4dd39c5db | ||
|
|
f76a3c02c2 | ||
|
|
07d5ab4837 | ||
|
|
08a11b3058 |
@@ -1,5 +1,5 @@
|
|||||||
# 自定义域名CNAME
|
# 自定义域名CNAME
|
||||||
# VITE_CNAME = 'template.qszone.com'
|
# VITE_CNAME = 'template.isme.top'
|
||||||
|
|
||||||
# 资源公共路径,需要以 /开头和结尾
|
# 资源公共路径,需要以 /开头和结尾
|
||||||
VITE_PUBLIC_PATH = '/vue-naive-admin/'
|
VITE_PUBLIC_PATH = '/vue-naive-admin/'
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ VITE_USE_MOCK = true
|
|||||||
VITE_BASE_API = '/api'
|
VITE_BASE_API = '/api'
|
||||||
|
|
||||||
# 是否启用压缩
|
# 是否启用压缩
|
||||||
VITE_USE_COMPRESS = true
|
VITE_USE_COMPRESS = false
|
||||||
|
|
||||||
# 压缩类型
|
# 压缩类型
|
||||||
VITE_COMPRESS_TYPE = gzip
|
VITE_COMPRESS_TYPE = gzip
|
||||||
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
custom: ['https://afdian.net/a/isme-admin']
|
||||||
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -21,7 +21,7 @@
|
|||||||
},
|
},
|
||||||
"eslint.validate": ["javascript", "javascriptreact", "typescript", "vue"],
|
"eslint.validate": ["javascript", "javascriptreact", "typescript", "vue"],
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll.eslint": true
|
"source.fixAll.eslint": "explicit"
|
||||||
},
|
},
|
||||||
"files.associations": {
|
"files.associations": {
|
||||||
"*.env.*": "dotenv",
|
"*.env.*": "dotenv",
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
### Preview
|
### Preview
|
||||||
|
|
||||||
[https://template.qszone.com](https://template.qszone.com)
|
[https://template.isme.top](https://template.isme.top)
|
||||||
|
|
||||||
[https://base.isme.top](https://base.isme.top)
|
[https://base.isme.top](https://base.isme.top)
|
||||||
|
|
||||||
@@ -188,17 +188,18 @@ Vue Naive Admin
|
|||||||
|
|
||||||
#### preview
|
#### preview
|
||||||
|
|
||||||
- [https://admin.qszone.com](https://admin.qszone.com)
|
- [https://admin.isme.top](https://admin.isme.top)
|
||||||
- [https://zclzone.github.io/qs-admin](https://zclzone.github.io/qs-admin)
|
- [https://zclzone.github.io/qs-admin](https://zclzone.github.io/qs-admin)
|
||||||
|
|
||||||
### Open source projects that use this project:
|
### Open source projects that use this project:
|
||||||
|
|
||||||
- [gin-vue-blog](https://github.com/szluyu99/gin-vue-blog): A full-stack blog project in Golang, the frontend of the blog backend is based on vue-naive-admin and integrates with a real backend service, implementing features such as backend-controlled routing.
|
- [gin-vue-blog](https://github.com/szluyu99/gin-vue-blog): A full-stack blog project in Golang, the frontend of the blog backend is based on vue-naive-admin and integrates with a real backend service, implementing features such as backend-controlled routing.
|
||||||
|
- [vue-fastapi-admin](https://github.com/mizhexiaoxiao/vue-fastapi-admin): A Python backend management project that integrates RBAC permission management, dynamic routing, and JWT authentication, helping small and medium-sized applications to quickly establish a foundation.
|
||||||
|
|
||||||
### Communication group & About the author
|
### Communication group & About the author
|
||||||
|
|
||||||
<a href="https://blog.qszone.com/about/">
|
<a href="https://blog.isme.top/about/">
|
||||||
<img src="https://assets.qszone.com/images/about.png" style="max-width: 400px" />
|
<img src="https://static.isme.top/images/about.png?t=123" style="max-width: 400px" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
22
README.md
22
README.md
@@ -12,6 +12,12 @@
|
|||||||
<a href="https://github.com/zclzone/vue-naive-admin/blob/main/README.EN.md">English</a>
|
<a href="https://github.com/zclzone/vue-naive-admin/blob/main/README.EN.md">English</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
> 🎉🎉🎉 2.0 已开源,全新重构,全面简化,后端使用 nestjs + mysql + typeOrm,[👉点击前往2.0版本 | 分支 2.x](https://github.com/zclzone/vue-naive-admin/tree/2.x),
|
||||||
|
|
||||||
|
- 体验地址: [admin.isme.top](https://admin.isme.top)
|
||||||
|
- 后端服务: [isme-nest-serve](https://github.com/zclzone/isme-nest-serve)
|
||||||
|
- 文档: [vue-naive-admin-docs](https://docs.isme.top/web/#/624306705)
|
||||||
|
|
||||||
### 简介
|
### 简介
|
||||||
|
|
||||||
[Vue Naive Admin](https://github.com/zclzone/vue-naive-admin) 是一个 **开源免费且允许商用** 的后台管理模板,基于 `Vue3、Vite4、Pinia、Unocss 和 Naive UI` 等前端最新技术栈。相较于其他比较流行的后台管理模板,此项目更加简洁、轻量,风格清新,上手成本非常低,非常适合中小型项目或者个人项目。
|
[Vue Naive Admin](https://github.com/zclzone/vue-naive-admin) 是一个 **开源免费且允许商用** 的后台管理模板,基于 `Vue3、Vite4、Pinia、Unocss 和 Naive UI` 等前端最新技术栈。相较于其他比较流行的后台管理模板,此项目更加简洁、轻量,风格清新,上手成本非常低,非常适合中小型项目或者个人项目。
|
||||||
@@ -29,9 +35,9 @@
|
|||||||
- 🤹 集成 `iconify` 图标,支持自定义 svg 图标, 优雅使用icon
|
- 🤹 集成 `iconify` 图标,支持自定义 svg 图标, 优雅使用icon
|
||||||
- 🍇 集成 `unocss`,antfu 开源的原子 css 解决方案,非常轻量
|
- 🍇 集成 `unocss`,antfu 开源的原子 css 解决方案,非常轻量
|
||||||
|
|
||||||
### 预览
|
> ✨✨ 双十一香港特惠服务器推荐,~~**2C4G 100M** `71/年` `142/两年`~~,[👉点击前往](https://blog.isme.top/vps-recommend/)
|
||||||
|
|
||||||
[https://template.qszone.com](https://template.qszone.com)
|
### 预览
|
||||||
|
|
||||||
[https://template.isme.top](https://template.isme.top)
|
[https://template.isme.top](https://template.isme.top)
|
||||||
|
|
||||||
@@ -200,24 +206,24 @@ Vue Naive Admin
|
|||||||
|
|
||||||
#### 预览
|
#### 预览
|
||||||
|
|
||||||
- [https://admin.qszone.com](https://admin.qszone.com)
|
- [https://admin.isme.top](https://admin.isme.top)
|
||||||
- [https://zclzone.github.io/qs-admin](https://zclzone.github.io/qs-admin)
|
- [https://zclzone.github.io/qs-admin](https://zclzone.github.io/qs-admin)
|
||||||
|
|
||||||
### 使用该项目的开源项目
|
### 使用该项目的开源项目
|
||||||
|
|
||||||
- [gin-vue-blog](https://github.com/szluyu99/gin-vue-blog): Golang 全栈博客项目, 博客后台的前端基于 vue-naive-admin,对接真实后端服务,实现了后端控制路由等特性。
|
- [gin-vue-blog](https://github.com/szluyu99/gin-vue-blog): Golang 全栈博客项目, 博客后台的前端基于 vue-naive-admin,对接真实后端服务,实现了后端控制路由等特性。
|
||||||
|
- [vue-fastapi-admin](https://github.com/mizhexiaoxiao/vue-fastapi-admin): Python 后台管理项目, 融合了 RBAC 权限管理、动态路由,JWT 鉴权,助力中小型应用快速搭建。
|
||||||
|
|
||||||
### 入群交流 & 关于作者
|
### 入群交流 & 关于作者
|
||||||
|
|
||||||
<a href="https://blog.qszone.com/about/">
|
<a href="https://blog.isme.top/about/">
|
||||||
<img src="https://assets.qszone.com/images/about.png" style="max-width: 400px" />
|
<img src="https://static.isme.top/images/about.png?t=123" style="max-width: 400px" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
### ☕ 赞助我
|
### ☕ 赞助我
|
||||||
|
|
||||||
> 开源不易,请作者喝杯咖啡吧
|
> 开源不易,请作者喝杯咖啡吧
|
||||||
<p>
|
<p>
|
||||||
<img src="https://assets.qszone.com/images/zhifu_weixin.jpg" style="width: 220px" />
|
<img src="https://static.isme.top/images/zhifu_weixin.jpg" style="width: 220px" />
|
||||||
<img src="https://assets.qszone.com/images/zhifu_zhifubao.jpg" style="width: 220px" />
|
<img src="https://static.isme.top/images/zhifu_zhifubao.jpg" style="width: 220px" />
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -10,13 +10,15 @@ import Unocss from 'unocss/vite'
|
|||||||
import visualizer from 'rollup-plugin-visualizer'
|
import visualizer from 'rollup-plugin-visualizer'
|
||||||
// 压缩
|
// 压缩
|
||||||
import viteCompression from 'vite-plugin-compression'
|
import viteCompression from 'vite-plugin-compression'
|
||||||
|
// vite-vuedevtool
|
||||||
|
import VueDevTools from 'vite-plugin-vue-devtools'
|
||||||
|
|
||||||
import { configHtmlPlugin } from './html'
|
import { configHtmlPlugin } from './html'
|
||||||
import { configMockPlugin } from './mock'
|
import { configMockPlugin } from './mock'
|
||||||
import unplugin from './unplugin'
|
import unplugin from './unplugin'
|
||||||
|
|
||||||
export function createVitePlugins(viteEnv, isBuild) {
|
export function createVitePlugins(viteEnv, isBuild) {
|
||||||
const plugins = [vue(), ...unplugin, configHtmlPlugin(viteEnv, isBuild), Unocss()]
|
const plugins = [VueDevTools(), vue(), ...unplugin, configHtmlPlugin(viteEnv, isBuild), Unocss()]
|
||||||
|
|
||||||
if (viteEnv?.VITE_USE_MOCK) {
|
if (viteEnv?.VITE_USE_MOCK) {
|
||||||
plugins.push(configMockPlugin(isBuild))
|
plugins.push(configMockPlugin(isBuild))
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
"baseUrl": "./",
|
"baseUrl": "./",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"paths": {
|
"paths": {
|
||||||
"~/*": ["./*"],
|
"@/*": ["src/*"],
|
||||||
"@/*": ["src/*"]
|
"~/*": ["./*"]
|
||||||
},
|
},
|
||||||
"jsx": "preserve",
|
"jsx": "preserve",
|
||||||
"allowJs": true
|
"allowJs": true
|
||||||
|
|||||||
@@ -4,21 +4,21 @@ const users = {
|
|||||||
admin: {
|
admin: {
|
||||||
id: 1,
|
id: 1,
|
||||||
name: '大脸怪(admin)',
|
name: '大脸怪(admin)',
|
||||||
avatar: 'https://assets.qszone.com/images/avatar.jpg',
|
avatar: 'https://static.isme.top/images/avatar.jpg',
|
||||||
email: 'Ronnie@123.com',
|
email: 'Ronnie@123.com',
|
||||||
role: ['admin'],
|
role: ['admin'],
|
||||||
},
|
},
|
||||||
editor: {
|
editor: {
|
||||||
id: 2,
|
id: 2,
|
||||||
name: '大脸怪(editor)',
|
name: '大脸怪(editor)',
|
||||||
avatar: 'https://assets.qszone.com/images/avatar.jpg',
|
avatar: 'https://static.isme.top/images/avatar.jpg',
|
||||||
email: 'Ronnie@123.com',
|
email: 'Ronnie@123.com',
|
||||||
role: ['editor'],
|
role: ['editor'],
|
||||||
},
|
},
|
||||||
guest: {
|
guest: {
|
||||||
id: 3,
|
id: 3,
|
||||||
name: '访客(guest)',
|
name: '访客(guest)',
|
||||||
avatar: 'https://assets.qszone.com/images/avatar.jpg',
|
avatar: 'https://static.isme.top/images/avatar.jpg',
|
||||||
role: [],
|
role: [],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
"@unocss/preset-rem-to-px": "^0.55.7",
|
"@unocss/preset-rem-to-px": "^0.55.7",
|
||||||
"@vitejs/plugin-vue": "^4.4.0",
|
"@vitejs/plugin-vue": "^4.4.0",
|
||||||
"@vue/compiler-sfc": "^3.3.4",
|
"@vue/compiler-sfc": "^3.3.4",
|
||||||
"@zclzone/eslint-config": "^0.0.4",
|
"@zclzone/eslint-config": "^0.0.5",
|
||||||
"chalk": "^5.3.0",
|
"chalk": "^5.3.0",
|
||||||
"commitizen": "^4.3.0",
|
"commitizen": "^4.3.0",
|
||||||
"cz-conventional-changelog": "^3.3.0",
|
"cz-conventional-changelog": "^3.3.0",
|
||||||
@@ -76,6 +76,7 @@
|
|||||||
"vite-plugin-compression": "^0.5.1",
|
"vite-plugin-compression": "^0.5.1",
|
||||||
"vite-plugin-html": "^3.2.0",
|
"vite-plugin-html": "^3.2.0",
|
||||||
"vite-plugin-mock": "2.9.6",
|
"vite-plugin-mock": "2.9.6",
|
||||||
"vite-plugin-svg-icons": "^2.0.1"
|
"vite-plugin-svg-icons": "^2.0.1",
|
||||||
|
"vite-plugin-vue-devtools": "1.0.0-rc.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
869
pnpm-lock.yaml
generated
869
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -16,7 +16,7 @@
|
|||||||
target="__blank"
|
target="__blank"
|
||||||
hover="decoration-underline color-primary"
|
hover="decoration-underline color-primary"
|
||||||
>
|
>
|
||||||
赣ICP备2020015008号-1
|
赣ICP备2020015008号-2
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
11
src/layout/components/header/components/GiteeSite.vue
Normal file
11
src/layout/components/header/components/GiteeSite.vue
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<template>
|
||||||
|
<n-icon mr-20 size="18" style="cursor: pointer" @click="handleLinkClick">
|
||||||
|
<icon-simple-icons:gitee />
|
||||||
|
</n-icon>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
function handleLinkClick() {
|
||||||
|
window.open('https://gitee.com/isme-admin/vue-naive-admin')
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
<div ml-auto flex items-center>
|
<div ml-auto flex items-center>
|
||||||
<MessageNotification />
|
<MessageNotification />
|
||||||
<ThemeMode />
|
<ThemeMode />
|
||||||
|
<GiteeSite />
|
||||||
<GithubSite />
|
<GithubSite />
|
||||||
<FullScreen />
|
<FullScreen />
|
||||||
<UserAvatar />
|
<UserAvatar />
|
||||||
@@ -18,6 +19,7 @@ import MenuCollapse from './components/MenuCollapse.vue'
|
|||||||
import FullScreen from './components/FullScreen.vue'
|
import FullScreen from './components/FullScreen.vue'
|
||||||
import UserAvatar from './components/UserAvatar.vue'
|
import UserAvatar from './components/UserAvatar.vue'
|
||||||
import GithubSite from './components/GithubSite.vue'
|
import GithubSite from './components/GithubSite.vue'
|
||||||
|
import GiteeSite from './components/GiteeSite.vue'
|
||||||
import ThemeMode from './components/ThemeMode.vue'
|
import ThemeMode from './components/ThemeMode.vue'
|
||||||
import MessageNotification from './components/MessageNotification.vue'
|
import MessageNotification from './components/MessageNotification.vue'
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -12,13 +12,10 @@ import { setupNaiveDiscreteApi } from './utils'
|
|||||||
|
|
||||||
async function setupApp() {
|
async function setupApp() {
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
|
|
||||||
setupStore(app)
|
setupStore(app)
|
||||||
setupNaiveDiscreteApi()
|
|
||||||
|
|
||||||
await setupRouter(app)
|
await setupRouter(app)
|
||||||
|
|
||||||
app.mount('#app')
|
app.mount('#app')
|
||||||
|
setupNaiveDiscreteApi()
|
||||||
}
|
}
|
||||||
|
|
||||||
setupApp()
|
setupApp()
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ export async function resetRouter() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function addDynamicRoutes() {
|
export async function addDynamicRoutes() {
|
||||||
|
// return Promise.reject('123')
|
||||||
const token = getToken()
|
const token = getToken()
|
||||||
|
|
||||||
// 没有token情况
|
// 没有token情况
|
||||||
@@ -37,8 +38,8 @@ export async function addDynamicRoutes() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 有token的情况
|
// 有token的情况
|
||||||
try {
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
try {
|
||||||
const permissionStore = usePermissionStore()
|
const permissionStore = usePermissionStore()
|
||||||
!userStore.userId && (await userStore.getUserInfo())
|
!userStore.userId && (await userStore.getUserInfo())
|
||||||
const accessRoutes = permissionStore.generateRoutes(userStore.role)
|
const accessRoutes = permissionStore.generateRoutes(userStore.role)
|
||||||
@@ -47,8 +48,25 @@ export async function addDynamicRoutes() {
|
|||||||
})
|
})
|
||||||
router.hasRoute(EMPTY_ROUTE.name) && router.removeRoute(EMPTY_ROUTE.name)
|
router.hasRoute(EMPTY_ROUTE.name) && router.removeRoute(EMPTY_ROUTE.name)
|
||||||
router.addRoute(NOT_FOUND_ROUTE)
|
router.addRoute(NOT_FOUND_ROUTE)
|
||||||
|
|
||||||
|
window.$notification?.success({
|
||||||
|
title: '🎉🎉🎉 2.0 全栈版本开源了!',
|
||||||
|
content: () =>
|
||||||
|
h(
|
||||||
|
'span',
|
||||||
|
{},
|
||||||
|
'2.0为全栈版本,提供前端+后端,全新重构,全面简化,',
|
||||||
|
h(
|
||||||
|
'a',
|
||||||
|
{ href: 'https://admin.isme.top', target: '__blank' },
|
||||||
|
'👉体验 https://admin.isme.top'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
$message.error('初始化用户信息失败: ' + error)
|
||||||
|
userStore.logout()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,10 +50,10 @@ defineOptions({ name: 'Upload' })
|
|||||||
const { copy, copied } = useClipboard()
|
const { copy, copied } = useClipboard()
|
||||||
|
|
||||||
const imgList = reactive([
|
const imgList = reactive([
|
||||||
{ url: 'https://cdn.qszone.com/images/5c23d52f880511ebb6edd017c2d2eca2.jpg' },
|
{ url: 'https://cdn.isme.top/images/5c23d52f880511ebb6edd017c2d2eca2.jpg' },
|
||||||
{ url: 'https://cdn.qszone.com/images/5c23d52f880511ebb6edd017c2d2eca2.jpg' },
|
{ url: 'https://cdn.isme.top/images/5c23d52f880511ebb6edd017c2d2eca2.jpg' },
|
||||||
{ url: 'https://cdn.qszone.com/images/5c23d52f880511ebb6edd017c2d2eca2.jpg' },
|
{ url: 'https://cdn.isme.top/images/5c23d52f880511ebb6edd017c2d2eca2.jpg' },
|
||||||
{ url: 'https://cdn.qszone.com/images/5c23d52f880511ebb6edd017c2d2eca2.jpg' },
|
{ url: 'https://cdn.isme.top/images/5c23d52f880511ebb6edd017c2d2eca2.jpg' },
|
||||||
])
|
])
|
||||||
|
|
||||||
watch(copied, (val) => {
|
watch(copied, (val) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user