mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 10:17:17 +08:00
fix: 修复npm报错
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import type { ProxyOptions } from 'vite'
|
||||
|
||||
import { getProxyConfig } from '../../settings/proxy-config'
|
||||
|
||||
export function createViteProxy(isUseProxy = true, proxyType: ProxyType) {
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
import AutoImport from 'unplugin-auto-import/vite'
|
||||
import IconsResolver from 'unplugin-icons/resolver'
|
||||
import Icons from 'unplugin-icons/vite'
|
||||
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
|
||||
import Components from 'unplugin-vue-components/vite'
|
||||
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
|
||||
|
||||
/**
|
||||
* * unplugin-icons应用,自动引入iconify图标
|
||||
* usage: https://github.com/antfu/unplugin-icons
|
||||
* 图标库: https://icones.js.org/
|
||||
*/
|
||||
import Icons from 'unplugin-icons/vite'
|
||||
import IconsResolver from 'unplugin-icons/resolver'
|
||||
|
||||
export default [
|
||||
AutoImport({
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<script lang="ts" setup>
|
||||
import { useThemeStore } from '@/store'
|
||||
import { useCssVar } from '@vueuse/core'
|
||||
import { kebabCase } from 'lodash-es'
|
||||
import type { GlobalThemeOverrides } from 'naive-ui'
|
||||
|
||||
import { useThemeStore } from '@/store'
|
||||
|
||||
type ThemeVars = Exclude<GlobalThemeOverrides['common'], undefined>
|
||||
type ThemeVarsKeys = keyof ThemeVars
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import Editor from '@guolao/vue-monaco-editor'
|
||||
|
||||
import file from '@/api/panel/file'
|
||||
import { languageByPath } from '@/utils/file'
|
||||
import Editor from '@guolao/vue-monaco-editor'
|
||||
|
||||
const props = defineProps({
|
||||
path: String,
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<script lang="ts" setup>
|
||||
import { useThemeStore } from '@/store'
|
||||
import AppMain from './AppMain.vue'
|
||||
import AppHeader from './header/IndexView.vue'
|
||||
import SideBar from './sidebar/IndexView.vue'
|
||||
import AppTab from './tab/IndexView.vue'
|
||||
|
||||
import { useThemeStore } from '@/store'
|
||||
|
||||
const themeStore = useThemeStore()
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
import { renderIcon } from '@/utils'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import type { Meta } from '~/types/router'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<script lang="ts" setup>
|
||||
import { useAppStore, usePermissionStore, useThemeStore } from '@/store'
|
||||
import { isUrl, renderIcon } from '@/utils'
|
||||
import type { MenuInst, MenuOption } from 'naive-ui'
|
||||
import type { VNodeChild } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
import { useAppStore, usePermissionStore, useThemeStore } from '@/store'
|
||||
import { isUrl, renderIcon } from '@/utils'
|
||||
import type { Meta, RouteType } from '~/types/router'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
import '@/styles/index.scss'
|
||||
import '@/styles/reset.css'
|
||||
import '@/styles/index.scss'
|
||||
import 'uno.css'
|
||||
|
||||
import { install as VueMonacoEditorPlugin } from '@guolao/vue-monaco-editor'
|
||||
import { createApp } from 'vue'
|
||||
|
||||
import info from '@/api/panel/info'
|
||||
import { setupI18n } from '@/i18n/i18n'
|
||||
import App from './App.vue'
|
||||
import { setupRouter } from './router'
|
||||
import { setupStore, useThemeStore } from './store'
|
||||
import { setupRouter } from './router'
|
||||
import { setupI18n } from '@/i18n/i18n'
|
||||
import { setupNaiveDiscreteApi } from './utils'
|
||||
import { install as VueMonacoEditorPlugin } from '@guolao/vue-monaco-editor'
|
||||
import info from '@/api/panel/info'
|
||||
|
||||
async function setupApp() {
|
||||
const app = createApp(App)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { Router } from 'vue-router'
|
||||
|
||||
import app from '@/api/panel/app'
|
||||
import type { Router } from 'vue-router'
|
||||
|
||||
export function createAppInstallGuard(router: Router) {
|
||||
router.beforeEach(async (to) => {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { Router } from 'vue-router'
|
||||
|
||||
import { createAppInstallGuard } from './app-install-guard'
|
||||
import { createPageLoadingGuard } from './page-loading-guard'
|
||||
import { createPageTitleGuard } from './page-title-guard'
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { usePermissionStore } from '@/store'
|
||||
import type { App } from 'vue'
|
||||
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'
|
||||
|
||||
import { usePermissionStore } from '@/store'
|
||||
import type { RoutesType, RouteType } from '~/types/router'
|
||||
import { setupRouterGuard } from './guard'
|
||||
import { basicRoutes, EMPTY_ROUTE, NOT_FOUND_ROUTE } from './routes'
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
import { asyncRoutes, basicRoutes } from '@/router/routes'
|
||||
import { defineStore } from 'pinia'
|
||||
import type { RoutesType } from '~/types/router'
|
||||
import { filterAsyncRoutes } from './helpers'
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
import { router } from '@/router'
|
||||
import { setSession } from '@/utils'
|
||||
import { defineStore } from 'pinia'
|
||||
import { activeTab, tabs, WITHOUT_TAB_PATHS } from './helpers'
|
||||
|
||||
export interface TabItem {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { GlobalThemeOverrides } from 'naive-ui'
|
||||
|
||||
import { addColorAlpha, getColorPalette } from '@/utils'
|
||||
import type { GlobalThemeOverrides } from 'naive-ui'
|
||||
import themeSetting from '~/settings/theme.json'
|
||||
|
||||
type ColorType = 'primary' | 'info' | 'success' | 'warning' | 'error'
|
||||
@@ -31,8 +30,8 @@ export function initThemeSettings(): Theme.Setting {
|
||||
warning: '#faad14',
|
||||
error: '#f5222d'
|
||||
}
|
||||
const locale = themeSetting.locale || 'zh_CN'
|
||||
return { isMobile, darkMode, sider, header, tab, primaryColor, otherColor, locale }
|
||||
const language = themeSetting.language || 'zh_CN'
|
||||
return { isMobile, darkMode, sider, header, tab, primaryColor, otherColor, language }
|
||||
}
|
||||
|
||||
/** 获取naive的主题颜色 */
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
} from 'naive-ui'
|
||||
import type { BuiltInGlobalTheme } from 'naive-ui/es/themes/interface'
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
import { getNaiveThemeOverrides, initThemeSettings } from './helpers'
|
||||
|
||||
type ThemeState = Theme.Setting
|
||||
@@ -64,8 +63,8 @@ export const useThemeStore = defineStore('theme-store', {
|
||||
this.primaryColor = color
|
||||
},
|
||||
/** 设置语言 */
|
||||
setLocale(language: string) {
|
||||
this.locale = language
|
||||
setLocale(locale: string) {
|
||||
this.locale = locale
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
import user from '@/api/panel/user'
|
||||
import { resetRouter } from '@/router'
|
||||
import { usePermissionStore, useTabStore } from '@/store'
|
||||
import { toLogin } from '@/utils'
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
interface UserInfo {
|
||||
id?: string
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import * as NaiveUI from 'naive-ui'
|
||||
|
||||
import { useThemeStore } from '@/store'
|
||||
import * as NaiveUI from 'naive-ui'
|
||||
|
||||
export async function setupNaiveDiscreteApi() {
|
||||
const themeStore = useThemeStore()
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import axios from 'axios'
|
||||
|
||||
import { reqReject, reqResolve, resReject, resResolve } from './interceptors'
|
||||
|
||||
export function createAxios(options = {}) {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { AxiosError, AxiosResponse } from 'axios'
|
||||
|
||||
import type { RequestConfig } from '~/types/axios'
|
||||
import { AxiosRejectError, resolveResError } from './helpers'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user