1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2026-01-22 23:50:22 +08:00

34 Commits

Author SHA1 Message Date
zclzone
22693b02ee chore: update deps 2026-01-20 18:28:41 +08:00
zclzone
cba38db3c9 docs: update README 2025-12-30 10:06:03 +08:00
zclzone
2e03a4b1a6 chore: update deps 2025-12-23 11:43:59 +08:00
zclzone
a5a20a30c9 perf: 添加optimizeDeps优化项 2025-12-01 17:40:41 +08:00
zclzone
9a7170f10c chore: update deps and lint fix 2025-12-01 17:38:59 +08:00
zclzone
fb4d18cc0a Merge branch '2.x' of https://gitcode.com/zclzone/vue-naive-admin into 2.x 2025-11-05 14:43:20 +08:00
zclzone
d078bba63e docs: update README 2025-11-05 14:39:45 +08:00
zclzone
5663f58b6e !1 merge 2.x into 2.x
refactor: 重构认证过期处理逻辑,消除代码重复

Created-by: u013737132
Commit-by: Ray.Hao
Merged-by: zclzone
Description: refactor: 重构认证过期处理逻辑,消除代码重复

See merge request: zclzone/vue-naive-admin!1
2025-11-05 14:28:22 +08:00
Ray.Hao
32700aee17 refactor: 重构认证过期处理逻辑,消除代码重复 2025-11-03 10:28:55 +08:00
zclzone
e593ba3ca5 docs: update README 2025-10-20 16:37:43 +08:00
zclzone
d9de814074 docs: add gitcode badge 2025-10-20 16:21:17 +08:00
zclzone
5457c4e70b fix: 修复切换主题闪屏问题 2025-10-14 14:06:02 +08:00
zclzone
6757e47fb1 fix: 首页饼图样式 2025-10-10 17:45:50 +08:00
zclzone
3fbcfdf0e1 fix: 删除失效图片地址 2025-10-10 17:12:28 +08:00
zclzone
d6764158f3 fix: 更新apifox云端mock地址 2025-10-10 17:09:39 +08:00
zclzone
4785842629 chore: update deps and lint fix 2025-08-26 11:30:11 +08:00
zclzone
5b4b0bd9ad fix: lint fix 2025-08-04 09:39:13 +08:00
goofy
3c04bbce8e fix: 修复上级菜单隐藏,下级菜单不生成路由问题 (#130)
fix: 修复上级菜单隐藏,下级菜单不生成路由问题
2025-08-04 09:36:56 +08:00
zclzone
0b69d55765 fix: 修复重新登录后basePermissions被清空问题,close #128 2025-06-27 16:00:34 +08:00
zclzone
91739a0cd5 chore: update deps and lint fix 2025-06-19 16:11:31 +08:00
zclzone
c925ca3e00 chore: update recommendations 2025-05-26 16:37:34 +08:00
zclzone
11b0f45381 feat: 增加操作列宽度至420 2025-05-23 17:56:28 +08:00
zclzone
0fe0b9d41b feat: 优化crud表格弹性高度 2025-05-19 11:21:45 +08:00
zclzone
7243f4f38e style: lint fix 2025-05-19 11:20:51 +08:00
zclzone
5178b70aca chore: update deps 2025-05-19 10:37:18 +08:00
zclzone
1934776063 chore: update deps 2025-04-24 15:36:37 +08:00
Khalil Yao
c675a4d420 feat: optimize password input. (#122) 2025-04-12 10:42:32 +08:00
zclzone
e29343586f docs: update README 2025-04-08 21:15:02 +08:00
zclzone
6fea2a1b69 Merge branch '2.x' of https://github.com/zclzone/vue-naive-admin into 2.x 2025-03-30 21:02:00 +08:00
zclzone
2513e475be fix: tooltip箭头未居中问题 2025-03-30 21:01:20 +08:00
dxmqj200682
dde25dd7ab fix: 菜单path跳转判空,close #120 2025-03-30 15:43:11 +08:00
leip247
1eb59b7cad fix: 正确指向官网 (#119) 2025-03-27 09:08:03 +08:00
zclzone
27a50a99b4 fix: 移除演示按钮的点击事件 2025-03-24 11:09:11 +08:00
zclzone
cf0ba0a2bf fix: withPermission完善 2025-03-21 14:39:26 +08:00
38 changed files with 2766 additions and 3319 deletions

View File

@@ -6,7 +6,7 @@ VITE_PUBLIC_PATH = '/'
# Axios 基础路径
# VITE_AXIOS_BASE_URL = '/api' # 用于代理
VITE_AXIOS_BASE_URL = 'https://mock.apipark.cn/m1/3776410-0-default' # apifox云端mock
VITE_AXIOS_BASE_URL = 'https://m1.apifoxmock.com/m1/3776410-3408296-default' # apifox云端mock
# 代理配置-target
VITE_PROXY_TARGET = 'http://localhost:8085'

View File

@@ -4,7 +4,5 @@ VITE_USE_HASH = 'false'
# 资源公共路径,需要以 /开头和结尾
VITE_PUBLIC_PATH = '/'
VITE_AXIOS_BASE_URL = '/api' # 用于代理
# 代理配置-target
VITE_PROXY_TARGET = 'http://localhost:8085'
# VITE_AXIOS_BASE_URL = '/api' # 用于代理
VITE_AXIOS_BASE_URL = 'https://m1.apifoxmock.com/m1/3776410-3408296-default' # apifox云端mock

View File

@@ -7,6 +7,6 @@
"esbenp.prettier-vscode",
"sdras.vue-vscode-snippets",
"mikestead.dotenv",
"simonhe.common-intellisense"
"tu6ge.naive-ui-intelligence"
]
}

View File

@@ -5,8 +5,17 @@
</p>
<p align="center">
<a href="./LICENSE"><img alt="MIT License" src="https://badgen.net/github/license/zclzone/vue-naive-admin"/></a>
<a href="https://gitcode.com/zclzone/vue-naive-admin"><img alt="GitCode" src="https://gitcode.com/zclzone/vue-naive-admin/star/badge.svg
"/></a>
</p>
---
<a href="https://hellogithub.com/repository/54f19ba1f9ae4238b3cbd111f3c428b0" target="_blank"><img src="https://abroad.hellogithub.com/v1/widgets/recommend.svg?rid=54f19ba1f9ae4238b3cbd111f3c428b0&claim_uid=jXGayRdJZScqMNr" alt="FeaturedHelloGitHub" style="width: 250px; height: 54px;" width="250" height="54" /></a>
> [!Tip]
> 我们提供WebPC+H5+小程序)的技术支持服务及定制开发,不限前后端,详细需求可联系作者,微信: isme-admin邮箱: zclzone@outlook.com
## 简介
Vue Naive Admin 是一款极简风格的后台管理模板,包含前后端解决方案,前端使用 Vite + Vue3 + Pinia + Unocss后端使用 Nestjs + TypeOrm + MySql简单易用赏心悦目历经十几次重构和细节打磨诚意满满
@@ -51,6 +60,7 @@ Vue Naive Admin 提供一套后端代码,技术栈使用 Nestjs + TypeOrm + My
- 源码-github: [isme-nest-serve | github](https://github.com/zclzone/isme-nest-serve)
- 源码-gitee: [isme-nest-serve | gitee](https://gitee.com/isme-admin/isme-nest-serve)
- 源码-gitcode: [isme-nest-serve | gitcode](https://gitcode.com/zclzone/isme-nest-serve)
## 文档

View File

@@ -1,13 +1,13 @@
{
"compilerOptions": {
"target": "ESNext",
"jsx": "preserve",
"baseUrl": "./",
"moduleResolution": "node",
"paths": {
"@/*": ["src/*"],
"~/*": ["./*"]
},
"jsx": "preserve",
"allowJs": true
},
"exclude": ["node_modules", "dist"]

View File

@@ -13,46 +13,46 @@
},
"dependencies": {
"@arco-design/color": "^0.4.0",
"@vueuse/core": "^12.7.0",
"axios": "^1.8.1",
"dayjs": "^1.11.13",
"echarts": "^5.6.0",
"lodash-es": "^4.17.21",
"naive-ui": "^2.41.0",
"pinia": "^3.0.1",
"pinia-plugin-persistedstate": "^4.2.0",
"vue": "^3.5.13",
"vue-echarts": "^7.0.3",
"vue-router": "^4.5.0",
"@vueuse/core": "^14.1.0",
"axios": "^1.13.2",
"dayjs": "^1.11.19",
"echarts": "^6.0.0",
"lodash-es": "^4.17.22",
"naive-ui": "^2.43.2",
"pinia": "^3.0.4",
"pinia-plugin-persistedstate": "^4.7.1",
"vue": "^3.5.27",
"vue-echarts": "^8.0.1",
"vue-router": "^4.6.4",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@antfu/eslint-config": "^4.3.0",
"@iconify/json": "^2.2.311",
"@unocss/eslint-config": "^66.0.0",
"@unocss/eslint-plugin": "^66.0.0",
"@unocss/preset-rem-to-px": "^66.0.0",
"@vitejs/plugin-vue": "^5.2.1",
"@vitejs/plugin-vue-jsx": "^4.1.1",
"eslint": "^9.21.0",
"eslint-plugin-format": "^1.0.1",
"@antfu/eslint-config": "^7.0.1",
"@iconify/json": "^2.2.430",
"@unocss/eslint-config": "^66.6.0",
"@unocss/eslint-plugin": "^66.6.0",
"@unocss/preset-rem-to-px": "^66.6.0",
"@vitejs/plugin-vue": "^6.0.3",
"@vitejs/plugin-vue-jsx": "^5.1.3",
"eslint": "^9.39.2",
"eslint-plugin-format": "^1.3.1",
"esno": "^4.8.0",
"fs-extra": "^11.3.0",
"glob": "^11.0.1",
"lint-staged": "^15.4.3",
"rollup-plugin-visualizer": "^5.14.0",
"simple-git-hooks": "^2.11.1",
"taze": "^18.6.0",
"unocss": "^66.0.0",
"unplugin-auto-import": "^19.1.1",
"unplugin-vue-components": "^28.4.1",
"vite": "^6.2.0",
"vite-plugin-router-warn": "^1.0.0",
"vite-plugin-vue-devtools": "^7.7.2",
"fs-extra": "^11.3.3",
"glob": "^13.0.0",
"lint-staged": "^16.2.7",
"rollup-plugin-visualizer": "^6.0.5",
"simple-git-hooks": "^2.13.1",
"taze": "^19.9.2",
"unocss": "^66.6.0",
"unplugin-auto-import": "^21.0.0",
"unplugin-vue-components": "^31.0.0",
"vite": "^7.3.1",
"vite-plugin-router-warn": "^2.0.0",
"vite-plugin-vue-devtools": "^8.0.5",
"vue3-intro-step": "^1.0.5"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
"pre-commit": "npx lint-staged"
},
"lint-staged": {
"*": "eslint --fix"

5639
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -29,9 +29,9 @@
</template>
<script setup>
import { darkTheme, dateZhCN, zhCN } from 'naive-ui'
import { LayoutSetting } from '@/components'
import { useAppStore, useTabStore } from '@/store'
import { darkTheme, dateZhCN, zhCN } from 'naive-ui'
import { layoutSettingVisible } from './settings'
const layouts = new Map()

View File

@@ -1,9 +1,10 @@
<template>
<n-tooltip trigger="hover">
<div class="f-c-c">
<n-tooltip trigger="hover" placement="bottom">
<template #trigger>
<n-color-picker
id="theme-setting"
class="mr-16 h-32 w-32"
class="h-32 w-32"
:value="appStore.primaryColor"
:swatches="primaryColors"
:on-update:value="(v) => appStore.setPrimaryColor(v)"
@@ -12,11 +13,12 @@
</template>
设置主题色
</n-tooltip>
</div>
</template>
<script setup>
import { useAppStore } from '@/store'
import { getPresetColors } from '@arco-design/color'
import { useAppStore } from '@/store'
const appStore = useAppStore()

View File

@@ -8,8 +8,8 @@
</template>
<script setup>
import { useAppStore } from '@/store'
import { useDark, useToggle } from '@vueuse/core'
import { useAppStore } from '@/store'
const appStore = useAppStore()
const isDark = useDark()
@@ -39,6 +39,7 @@ async function toggleDark({ clientX, clientY }) {
duration: 500,
easing: 'ease-in',
pseudoElement: `::view-transition-${isDark.value ? 'old' : 'new'}(root)`,
fill: 'both',
},
)
}

View File

@@ -7,6 +7,7 @@
--------------------------------->
<template>
<div class="h-full flex flex-col overflow-hidden">
<AppCard v-if="$slots.default" bordered bg="#fafafc dark:black" class="mb-30 min-h-60 rounded-4">
<form class="flex justify-between p-16" @submit.prevent="handleSearch()">
<n-scrollbar x-scrollable>
@@ -46,9 +47,12 @@
:data="tableData"
:row-key="(row) => row[rowKey]"
:pagination="isPagination ? pagination : false"
flex-height
class="flex-1"
@update:checked-row-keys="onChecked"
@update:page="onPageChange"
/>
</div>
</template>
<script setup>

View File

@@ -6,9 +6,10 @@
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
**********************************/
import { withDirectives } from 'vue'
import { router } from '@/router'
export const permission = {
const permission = {
mounted(el, binding) {
const currentRoute = unref(router.currentRoute)
const btns = currentRoute.meta?.btns?.map(item => item.code) || []
@@ -21,3 +22,17 @@ export const permission = {
export function setupDirectives(app) {
app.directive('permission', permission)
}
/**
* 用于h函数使用自定义权限指令
*
* @param {*} vnode 虚拟节点
* @param {*} code 权限码
* @returns 返回一个包含权限指令的vnode
*
* 使用示例withPermission(h('button', {class: 'text-red-500'}, '删除'), 'user:delete')
*
*/
export function withPermission(vnode, code) {
return withDirectives(vnode, [[permission, code]])
}

View File

@@ -9,7 +9,7 @@
<template>
<div
id="menu-collapse"
class="f-c-c cursor-pointer rounded-4 p-6 text-22 transition-all-300 auto-bg-hover"
class="f-c-c cursor-pointer rounded-4 auto-bg-hover p-6 text-22 transition-all-300"
@click="appStore.switchCollapsed"
>
<i :class="appStore.collapsed ? 'i-line-md-menu-unfold-left' : 'i-line-md-menu-fold-left'" />

View File

@@ -54,6 +54,8 @@ function handleMenuSelect(key, item) {
})
}
else {
if (!item.path)
return
router.push(item.path)
}
}

View File

@@ -43,12 +43,6 @@ export function createPermissionGuard(router) {
return { ...to, replace: true }
}
router.addRoute({
name: 'catchAll',
path: '/:catchAll(.*)',
redirect: '/404',
})
const routes = router.getRoutes()
if (routes.find(route => route.name === to.name))
return true

View File

@@ -1,3 +1,4 @@
import { cloneDeep } from 'lodash-es'
import api from '@/api'
import { basePermissions } from '@/settings'
@@ -26,5 +27,5 @@ export async function getPermissions() {
catch (error) {
console.error(error)
}
return basePermissions.concat(asyncPermissions)
return cloneDeep(basePermissions).concat(asyncPermissions)
}

View File

@@ -6,10 +6,10 @@
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
**********************************/
import { defaultLayout, defaultPrimaryColor, naiveThemeOverrides } from '@/settings'
import { generate, getRgbStr } from '@arco-design/color'
import { useDark } from '@vueuse/core'
import { defineStore } from 'pinia'
import { defaultLayout, defaultPrimaryColor, naiveThemeOverrides } from '@/settings'
export const useAppStore = defineStore('app', {
state: () => ({

View File

@@ -6,8 +6,8 @@
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
**********************************/
import { usePermissionStore, useRouterStore, useTabStore, useUserStore } from '@/store'
import { defineStore } from 'pinia'
import { usePermissionStore, useRouterStore, useTabStore, useUserStore } from '@/store'
export const useAuthStore = defineStore('auth', {
state: () => ({

View File

@@ -6,9 +6,9 @@
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
**********************************/
import { isExternal } from '@/utils'
import { hyphenate } from '@vueuse/core'
import { defineStore } from 'pinia'
import { isExternal } from '@/utils'
export const usePermissionStore = defineStore('permission', {
state: () => ({
@@ -29,8 +29,6 @@ export const usePermissionStore = defineStore('permission', {
const route = this.generateRoute(item, item.show ? null : parent?.key)
if (item.enable && route.path && !route.path.startsWith('http'))
this.accessRoutes.push(route)
if (!item.show)
return null
const menuItem = {
label: route.meta.title,
key: route.name,
@@ -48,6 +46,8 @@ export const usePermissionStore = defineStore('permission', {
if (!menuItem.children.length)
delete menuItem.children
}
if (!item.show)
return null
return menuItem
},
generateRoute(item, parentKey) {

View File

@@ -16,8 +16,6 @@ export const useRouterStore = defineStore('router', () => {
accessRoutes.forEach((item) => {
router.hasRoute(item.name) && router.removeRoute(item.name)
})
router.removeRoute('catchAll')
}
return {

View File

@@ -34,8 +34,8 @@ html,
-webkit-text-size-adjust: 100%; /* 2 */
-moz-tab-size: 4; /* 3 */
tab-size: 4; /* 3 */
font-family: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji'; /* 4 */
font-family:
ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; /* 4 */
font-feature-settings: normal; /* 5 */
font-variation-settings: normal; /* 6 */
-webkit-tap-highlight-color: transparent; /* 7 */
@@ -114,7 +114,8 @@ code,
kbd,
samp,
pre {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; /* 1 */
font-family:
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; /* 1 */
font-feature-settings: normal; /* 2 */
font-variation-settings: normal; /* 3 */
font-size: 1em; /* 4 */

View File

@@ -10,45 +10,34 @@
import { useAuthStore } from '@/store'
let isConfirming = false
function handleAuthExpired(content, needTip) {
if (isConfirming || !needTip)
return
isConfirming = true
$dialog.confirm({
title: '提示',
type: 'info',
content,
confirm() {
useAuthStore().logout()
window.$message?.success('已退出登录')
isConfirming = false
},
cancel() {
isConfirming = false
},
})
return false
}
export function resolveResError(code, message, needTip = true) {
switch (code) {
case 401:
if (isConfirming || !needTip)
return
isConfirming = true
$dialog.confirm({
title: '提示',
type: 'info',
content: '登录已过期,是否重新登录?',
confirm() {
useAuthStore().logout()
window.$message?.success('已退出登录')
isConfirming = false
},
cancel() {
isConfirming = false
},
})
return false
return handleAuthExpired('登录已过期,是否重新登录?', needTip)
case 11007:
case 11008:
if (isConfirming || !needTip)
return
isConfirming = true
$dialog.confirm({
title: '提示',
type: 'info',
content: `${message},是否重新登录?`,
confirm() {
useAuthStore().logout()
window.$message?.success('已退出登录')
isConfirming = false
},
cancel() {
isConfirming = false
},
})
return false
return handleAuthExpired(`${message},是否重新登录?`, needTip)
case 403:
message = '请求被拒绝'
break

View File

@@ -11,5 +11,4 @@ export * from './common'
export * from './http'
export * from './is'
export * from './naiveTools'
export * from './permissionH'
export * from './storage'

View File

@@ -7,9 +7,9 @@
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
**********************************/
import * as NaiveUI from 'naive-ui'
import { useAppStore } from '@/store'
import { isNullOrUndef } from '@/utils'
import * as NaiveUI from 'naive-ui'
export function setupMessage(NMessage) {
class Message {

View File

@@ -1,14 +0,0 @@
import { permission } from '@/directives'
/**
* @description: 按钮权限渲染
*/
import { h, withDirectives } from 'vue'
export function PH(el, props, slots, butCode) {
return withDirectives(
h(el, props, slots),
[
[permission, butCode],
],
)
}

View File

@@ -26,7 +26,7 @@
<li
v-for="item in icons"
:key="item"
class="w-160 f-c-c flex-col cursor-pointer rounded-12 px-12 py-24 card-border auto-bg"
class="w-160 f-c-c flex-col cursor-pointer card-border rounded-12 auto-bg px-12 py-24"
@click="copy(`&lt;i class=&quot;${item}&quot; /&gt;`)"
>
<i :class="`${item}?mask`" class="text-28 text-gray-600 hover:bg-primary" />

View File

@@ -22,7 +22,7 @@
</p>
<div mt-20 w-350 f-c-c flex-col>
<div flex flex-wrap justify-around rounded-10 p-10 card-border>
<div flex flex-wrap justify-around card-border rounded-10 p-10>
<div m-20 h-50 w-50 f-c-c rounded-5 p-10 border="1 solid">
<span h-6 w-6 rounded-3 bg-black dark:bg-white />
</div>

View File

@@ -62,11 +62,7 @@ defineOptions({ name: 'ImgUpload' })
const { copy, copied } = useClipboard()
const imgList = reactive([
{ url: 'https://img.isme.top/isme/67208863145ef.jpg' },
{ url: 'https://img.isme.top/isme/67208ab2a9de0.jpg' },
{ url: 'https://img.isme.top/isme/67208ab4c6596.jpg' },
])
const imgList = reactive([])
watch(copied, (val) => {
if (val)

View File

@@ -30,10 +30,9 @@
<n-card class="ml-12 w-70%" title="✨ 欢迎使用 Vue Naive Admin 2.0">
<template #header-extra>
<a
class="text-14 text-primary text-highlight hover:underline hover:opacity-80"
class="text-highlight text-14 text-primary hover:underline hover:opacity-80"
href="https://isme.top"
target="_blank"
@click.prevent="message?.info('官网正在火速开发中...')"
>
isme.top
</a>
@@ -69,7 +68,7 @@
<div class="mt-12 flex">
<n-card class="w-50%" title="💯 特性" segmented>
<template #header-extra>
<span class="opacity-90 text-highlight">👏 历经十几次重构和细节打磨</span>
<span class="text-highlight opacity-90">👏 历经十几次重构和细节打磨</span>
</template>
<ul class="opacity-90">
@@ -160,13 +159,13 @@
</template>
<script setup>
import { useUserStore } from '@/store'
import { BarChart, LineChart, PieChart } from 'echarts/charts'
import { GridComponent, LegendComponent, TooltipComponent } from 'echarts/components'
import * as echarts from 'echarts/core'
import { UniversalTransition } from 'echarts/features'
import { CanvasRenderer } from 'echarts/renderers'
import VChart from 'vue-echarts'
import { useUserStore } from '@/store'
const userStore = useUserStore()
@@ -251,7 +250,7 @@ const skillOption = {
},
series: [
{
top: '12%',
bottom: '12%',
type: 'pie',
radius: ['35%', '90%'],
avoidLabelOverlap: true,
@@ -284,6 +283,4 @@ const skillOption = {
},
],
}
const message = $message
</script>

View File

@@ -9,7 +9,7 @@
<template>
<div class="wh-full flex-col bg-[url(@/assets/images/login_bg.webp)] bg-cover">
<div
class="m-auto max-w-700 min-w-345 f-c-c rounded-8 bg-opacity-20 bg-cover p-12 card-shadow auto-bg"
class="m-auto max-w-700 min-w-345 f-c-c rounded-8 auto-bg bg-opacity-20 bg-cover p-12 card-shadow"
>
<div class="hidden w-380 px-20 py-35 md:block">
<img src="@/assets/images/login_banner.webp" class="w-full" alt="login_banner">
@@ -101,9 +101,9 @@
</template>
<script setup>
import { useStorage } from '@vueuse/core'
import { useAuthStore } from '@/store'
import { lStorage, throttle } from '@/utils'
import { useStorage } from '@vueuse/core'
import api from './api'
const authStore = useAuthStore()

View File

@@ -6,8 +6,8 @@
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
**********************************/
import { request } from '@/utils'
import axios from 'axios'
import { request } from '@/utils'
export default {
getMenuTree: () => request.get('/permission/menu/tree'),

View File

@@ -159,10 +159,10 @@
</template>
<script setup>
import { MeModal } from '@/components'
import { useForm, useModal } from '@/composables'
import icons from 'isme:icons'
import pagePathes from 'isme:page-pathes'
import { MeModal } from '@/components'
import { useForm, useModal } from '@/composables'
import api from '../api'
import QuestionLabel from './QuestionLabel.vue'

View File

@@ -92,8 +92,8 @@
</template>
<script setup>
import { MeCrud } from '@/components'
import { NButton, NSwitch } from 'naive-ui'
import { MeCrud } from '@/components'
import api from './api'
import MenuTree from './components/MenuTree.vue'
import ResAddOrEdit from './components/ResAddOrEdit.vue'

View File

@@ -75,7 +75,7 @@
:checked-keys="modalForm.permissionIds"
:on-update:checked-keys="(keys) => (modalForm.permissionIds = keys)"
default-expand-all checkable check-on-click
checkable check-on-click default-expand-all
class="cus-scroll max-h-200 w-full"
/>
</n-form-item>
@@ -95,9 +95,9 @@
</template>
<script setup>
import { NButton, NSwitch } from 'naive-ui'
import { MeCrud, MeModal, MeQueryItem } from '@/components'
import { useCrud } from '@/composables'
import { NButton, NSwitch } from 'naive-ui'
import api from './api'
defineOptions({ name: 'RoleMgt' })

View File

@@ -67,10 +67,10 @@
</template>
<script setup>
import { MeCrud, MeQueryItem } from '@/components'
import { formatDateTime } from '@/utils'
import { NAvatar, NButton, NSwitch, NTag } from 'naive-ui'
import { h } from 'vue'
import { MeCrud, MeQueryItem } from '@/components'
import { formatDateTime } from '@/utils'
import api from './api'
defineOptions({ name: 'RoleUser' })

View File

@@ -77,7 +77,7 @@
trigger: ['input', 'blur'],
}"
>
<n-input v-model:value="modalForm.password" />
<n-input v-model:value="modalForm.password" type="password" show-password-on="mousedown" />
</n-form-item>
<n-form-item v-if="['add', 'setRole'].includes(modalAction)" label="角色" path="roleIds">
@@ -110,10 +110,11 @@
</template>
<script setup>
import { NAvatar, NButton, NSwitch, NTag } from 'naive-ui'
import { MeCrud, MeModal, MeQueryItem } from '@/components'
import { useCrud } from '@/composables'
import { formatDateTime, PH } from '@/utils'
import { NAvatar, NButton, NSwitch, NTag } from 'naive-ui'
import { withPermission } from '@/directives'
import { formatDateTime } from '@/utils'
import api from './api'
defineOptions({ name: 'UserMgt' })
@@ -219,25 +220,22 @@ const columns = [
{
title: '操作',
key: 'actions',
width: 380,
width: 420,
align: 'right',
fixed: 'right',
hideInExcel: true,
render(row) {
return [
PH(
NButton,
{
withPermission(
h(NButton, {
size: 'small',
type: 'primary',
secondary: true,
onClick: () => handleOpenRolesSet(row),
},
{
}, {
default: () => '超管专属',
icon: () => h('i', { class: 'i-carbon:user-role text-14' }),
},
'superAdmin',
}),
'SuperAdmin',
),
h(
NButton,

View File

@@ -73,10 +73,10 @@
require-mark-placement="left"
>
<n-form-item label="原密码" path="oldPassword" :rule="required">
<n-input v-model:value="pwdForm.oldPassword" type="password" placeholder="请输入原密码" />
<n-input v-model:value="pwdForm.oldPassword" type="password" placeholder="请输入原密码" show-password-on="mousedown" />
</n-form-item>
<n-form-item label="新密码" path="newPassword" :rule="required">
<n-input v-model:value="pwdForm.newPassword" type="password" placeholder="请输入新密码" />
<n-input v-model:value="pwdForm.newPassword" type="password" placeholder="请输入新密码" show-password-on="mousedown" />
</n-form-item>
</n-form>
</MeModal>

View File

@@ -69,6 +69,9 @@ export default defineConfig(({ mode }) => {
},
},
},
optimizeDeps: {
include: ['vue3-intro-step'],
},
build: {
chunkSizeWarningLimit: 1024, // chunk 大小警告的限制单位kb
},