diff --git a/mock/_createProductionServer.ts b/mock/_createProductionServer.ts
deleted file mode 100644
index c289b03..0000000
--- a/mock/_createProductionServer.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-// Author: fruit.com.cn
-
-import { createProdMockServer } from 'vite-plugin-mock/es/createProdMockServer'
-
-const modules = import.meta.glob('./**/*.mock.ts', {
- import: 'default',
- eager: true
-})
-
-const mockModules: any[] = []
-Object.keys(modules).forEach(async (key) => {
- if (key.includes('_')) {
- return
- }
- mockModules.push(...(modules[key] as any))
-})
-
-export function setupProdMockServer() {
- createProdMockServer(mockModules)
-}
diff --git a/mock/role/index.mock.ts b/mock/role/index.mock.ts
deleted file mode 100644
index a483d96..0000000
--- a/mock/role/index.mock.ts
+++ /dev/null
@@ -1,131 +0,0 @@
-// Author: fruit.com.cn
-
-import { MockMethod } from 'vite-plugin-mock'
-import { SUCCESS_CODE } from '@/constants'
-
-const timeout = 1000
-
-const adminList = [
- {
- path: '/dashboard',
- component: '#',
- redirect: '/dashboard/index',
- name: 'Dashboard',
- meta: {
- title: '工作台',
- icon: 'ant-design:dashboard-filled'
- },
- children: [
- {
- path: 'index',
- name: 'dashboard',
- component: 'views/common/DashboardView',
- meta: {
- title: '工作台',
- icon: 'ant-design:dashboard-filled',
- affix: true
- }
- }
- ]
- },
- {
- path: '/content',
- component: '#',
- redirect: '/content/dramas',
- name: 'Content',
- meta: {
- title: '内容管理',
- icon: 'ep:video-camera',
- alwaysShow: true
- },
- children: [
- {
- path: 'dramas',
- name: 'dramas',
- component: 'views/contentManagement/DramaManagementView',
- meta: {
- title: '短剧管理'
- }
- },
- {
- path: 'episodes',
- name: 'episodes',
- component: 'views/contentManagement/EpisodeManagementView',
- meta: {
- title: '剧集管理'
- }
- }
- ]
- },
- {
- path: '/system',
- component: '#',
- redirect: '/system/access',
- name: 'System',
- meta: {
- title: '后台管理',
- icon: 'ep:setting',
- alwaysShow: true
- },
- children: [
- {
- path: 'access',
- name: 'access',
- component: 'views/permission/RoleManagementView',
- meta: {
- title: '角色权限配置'
- }
- },
- {
- path: 'admin-users',
- name: 'admin-users',
- component: 'views/userManagement/AdminUsersView',
- meta: {
- title: '管理员用户列表'
- }
- },
- {
- path: 'menus',
- name: 'menus',
- component: 'views/permission/MenuManagementView',
- meta: {
- title: '菜单管理'
- }
- },
- {
- path: 'role-categories',
- name: 'role-categories',
- component: 'views/permission/RoleCategoriesView',
- meta: {
- title: '角色分类'
- }
- },
- {
- path: 'settings',
- name: 'settings',
- component: 'views/systemManagement/SettingsView',
- meta: {
- title: '系统设置'
- }
- }
- ]
- }
-]
-
-const testList = adminList.filter((route) => route.path !== '/system')
-
-export default [
- // 列表接口
- {
- url: '/mock/role/list',
- method: 'get',
- timeout,
- response: ({ query }) => {
- const { roleName } = query
- return {
- code: SUCCESS_CODE,
- data: roleName === 'admin' ? adminList : testList
- }
- }
- }
-] as MockMethod[]
diff --git a/mock/user/index.mock.ts b/mock/user/index.mock.ts
deleted file mode 100644
index 4595f34..0000000
--- a/mock/user/index.mock.ts
+++ /dev/null
@@ -1,92 +0,0 @@
-// Author: fruit.com.cn
-
-import { SUCCESS_CODE } from '@/constants'
-
-const timeout = 1000
-
-const List: {
- username: string
- password: string
- role: string
- roleId: string
- permissions: string | string[]
-}[] = [
- {
- username: 'admin',
- password: 'admin123',
- role: 'admin',
- roleId: '1',
- permissions: ['*.*.*']
- },
- {
- username: 'test',
- password: 'test',
- role: 'test',
- roleId: '2',
- permissions: ['example:dialog:create', 'example:dialog:delete']
- }
-]
-
-export default [
- // 列表接口
- {
- url: '/mock/user/list',
- method: 'get',
- response: ({ query }) => {
- const { username, pageIndex, pageSize } = query
-
- const mockList = List.filter((item) => {
- if (username && item.username.indexOf(username) < 0) return false
- return true
- })
- const pageList = mockList.filter(
- (_, index) => index < pageSize * pageIndex && index >= pageSize * (pageIndex - 1)
- )
-
- return {
- code: SUCCESS_CODE,
- data: {
- total: mockList.length,
- list: pageList
- }
- }
- }
- },
- // 登录接口
- {
- url: '/mock/user/login',
- method: 'post',
- timeout,
- response: ({ body }) => {
- const data = body
- let hasUser = false
- for (const user of List) {
- if (user.username === data.username && user.password === data.password) {
- hasUser = true
- return {
- code: SUCCESS_CODE,
- data: user
- }
- }
- }
- if (!hasUser) {
- return {
- code: 500,
- message: '账号或密码错误'
- }
- }
- }
- },
- // 退出接口
- {
- url: '/mock/user/loginOut',
- method: 'get',
- timeout,
- response: () => {
- return {
- code: SUCCESS_CODE,
- data: null
- }
- }
- }
-]
diff --git a/package.json b/package.json
index e441b28..0c3f7e6 100644
--- a/package.json
+++ b/package.json
@@ -24,8 +24,6 @@
"prepare": "husky install"
},
"dependencies": {
- "@element-plus/icons-vue": "^2.3.2",
- "@faker-js/faker": "^8.4.0",
"@iconify/iconify": "^3.1.1",
"@iconify/vue": "^4.1.1",
"@vueuse/core": "^10.7.2",
@@ -103,7 +101,6 @@
"vite": "5.0.12",
"vite-plugin-ejs": "^1.7.0",
"vite-plugin-eslint": "^1.8.1",
- "vite-plugin-mock": "2.9.6",
"vite-plugin-progress": "^0.0.7",
"vite-plugin-purge-icons": "^0.10.0",
"vite-plugin-style-import": "2.0.0",
diff --git a/public/brand-mark.png b/public/brand-mark.png
new file mode 100644
index 0000000..d6f5dc1
Binary files /dev/null and b/public/brand-mark.png differ
diff --git a/public/favicon.ico b/public/favicon.ico
deleted file mode 100644
index 5a7de08..0000000
Binary files a/public/favicon.ico and /dev/null differ
diff --git a/public/logo.png b/public/logo.png
deleted file mode 100644
index b76c71b..0000000
Binary files a/public/logo.png and /dev/null differ
diff --git a/src/api/login/index.ts b/src/api/login/index.ts
index 5cff93a..68ca033 100644
--- a/src/api/login/index.ts
+++ b/src/api/login/index.ts
@@ -26,10 +26,6 @@ export const getAdminRoleApi = (
return request.get({ url: '/admin/auth/menus', params })
}
-export const getTestRoleApi = (params: RoleParams): Promise
> => {
- return request.get({ url: '/mock/role/list2', params })
-}
-
/** 自助改密(首登强制改密也走这个接口) */
export const changePasswordApi = (data: { oldPassword: string; newPassword: string }) => {
return request.post({ url: '/admin/auth/password', data })
diff --git a/src/assets/imgs/avatar.jpg b/src/assets/imgs/avatar.jpg
deleted file mode 100644
index d46a70a..0000000
Binary files a/src/assets/imgs/avatar.jpg and /dev/null differ
diff --git a/src/assets/imgs/logo.png b/src/assets/imgs/logo.png
deleted file mode 100644
index b76c71b..0000000
Binary files a/src/assets/imgs/logo.png and /dev/null differ
diff --git a/src/components/Logo/src/Logo.vue b/src/components/Logo/src/Logo.vue
index a0d4212..6a7c88d 100644
--- a/src/components/Logo/src/Logo.vue
+++ b/src/components/Logo/src/Logo.vue
@@ -68,7 +68,12 @@ watch(
>
-
-
-
-
- 自定义菜单
{{ title }}
该菜单已注册,可在菜单管理中把组件路径指向已有页面。
-
-
diff --git a/tsconfig.json b/tsconfig.json
index 966aba7..ec64a3f 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -31,6 +31,6 @@
"@types/qrcode"
]
},
- "include": ["src", "types/**/*.d.ts", "mock/**/*.ts"]
+ "include": ["src", "types/**/*.d.ts"]
// "exclude": ["dist", "node_modules"]
}
diff --git a/uno.config.ts b/uno.config.ts
index d9fcd52..64de5b2 100644
--- a/uno.config.ts
+++ b/uno.config.ts
@@ -3,6 +3,7 @@
import { defineConfig, toEscapedSelector as e, presetUno, presetIcons } from 'unocss'
import transformerVariantGroup from '@unocss/transformer-variant-group'
import { loadEnv } from 'vite'
+import { AppIcons } from './src/constants/icons'
const root = process.cwd()
@@ -20,13 +21,11 @@ const createPresetIcons = () => {
} else {
return [
presetIcons({
- prefix: ''
- // 由于默认加载的是所有的图标,启动会非常慢,可以在这里去加载需要的图标,确保启动速度
- // collections: {
- // carbon: () => import('@iconify-json/carbon/icons.json').then(i => i.default),
- // mdi: () => import('@iconify-json/mdi/icons.json').then(i => i.default),
- // logos: () => import('@iconify-json/logos/icons.json').then(i => i.default),
- // }
+ prefix: '',
+ collections: {
+ 'material-symbols': () =>
+ import('@iconify/json/json/material-symbols.json').then((i) => i.default)
+ }
})
]
}
@@ -142,6 +141,7 @@ ${selector}:after {
}
]
],
+ safelist: Object.values(AppIcons),
presets: [presetUno({ dark: 'class', attributify: false }), ...createPresetIcons()],
transformers: [transformerVariantGroup()],
content: {
diff --git a/vite.config.mts b/vite.config.mts
index 05a50a5..fa5bcbc 100644
--- a/vite.config.mts
+++ b/vite.config.mts
@@ -5,7 +5,6 @@ import Vue from '@vitejs/plugin-vue'
import VueJsx from '@vitejs/plugin-vue-jsx'
import progress from 'vite-plugin-progress'
import { ViteEjsPlugin } from "vite-plugin-ejs"
-import { viteMockServe } from 'vite-plugin-mock'
import PurgeIcons from 'vite-plugin-purge-icons'
import VueI18nPlugin from "@intlify/unplugin-vue-i18n/vite"
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
@@ -67,19 +66,6 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
svgoOptions: true
}),
PurgeIcons(),
- env.VITE_USE_MOCK === 'true'
- ? viteMockServe({
- ignore: /^\_/,
- mockPath: 'mock',
- localEnabled: !isBuild,
- prodEnabled: isBuild,
- injectCode: `
- import { setupProdMockServer } from '../mock/_createProductionServer'
-
- setupProdMockServer()
- `
- })
- : undefined,
ViteEjsPlugin({
title: env.VITE_APP_TITLE
}),