2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 10:17:17 +08:00

fix: 修复npm报错

This commit is contained in:
耗子
2024-10-10 00:17:04 +08:00
parent c5d0b31251
commit a911002953
19 changed files with 32 additions and 42 deletions

View File

@@ -1,5 +1,4 @@
import type { ProxyOptions } from 'vite'
import { getProxyConfig } from '../../settings/proxy-config'
export function createViteProxy(isUseProxy = true, proxyType: ProxyType) {

View File

@@ -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({

View File

@@ -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

View File

@@ -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,

View File

@@ -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>

View File

@@ -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()

View File

@@ -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()

View File

@@ -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)

View File

@@ -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) => {

View File

@@ -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'

View File

@@ -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'

View File

@@ -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'

View File

@@ -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 {

View File

@@ -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的主题颜色 */

View File

@@ -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
}
}
})

View File

@@ -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

View File

@@ -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()

View File

@@ -1,5 +1,4 @@
import axios from 'axios'
import { reqReject, reqResolve, resReject, resResolve } from './interceptors'
export function createAxios(options = {}) {

View File

@@ -1,5 +1,4 @@
import type { AxiosError, AxiosResponse } from 'axios'
import type { RequestConfig } from '~/types/axios'
import { AxiosRejectError, resolveResError } from './helpers'