mirror of
https://github.com/un-pany/v3-admin-vite.git
synced 2025-04-21 11:29:20 +08:00
refactor: store/modules 目录替换为 pinia/stores
This commit is contained in:
parent
7a29374c2e
commit
464218e72c
@ -2,7 +2,7 @@
|
||||
import type { ElScrollbar } from "element-plus"
|
||||
import type { RouteRecordName, RouteRecordRaw } from "vue-router"
|
||||
import { useDevice } from "@/composables/useDevice"
|
||||
import { usePermissionStore } from "@/store/modules/permission"
|
||||
import { usePermissionStore } from "@/pinia/stores/permission"
|
||||
import { isExternal } from "@/utils/validate"
|
||||
import { ElMessage } from "element-plus"
|
||||
import { cloneDeep, debounce } from "lodash-es"
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { DeviceEnum } from "@/constants/app-key"
|
||||
import { useAppStore } from "@/store/modules/app"
|
||||
import { useAppStore } from "@/pinia/stores/app"
|
||||
import { computed } from "vue"
|
||||
|
||||
const appStore = useAppStore()
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { useSettingsStore } from "@/store/modules/settings"
|
||||
import { useSettingsStore } from "@/pinia/stores/settings"
|
||||
import { watchEffect } from "vue"
|
||||
|
||||
const GREY_MODE = "grey-mode"
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { LayoutModeEnum } from "@/constants/app-key"
|
||||
import { useSettingsStore } from "@/store/modules/settings"
|
||||
import { useSettingsStore } from "@/pinia/stores/settings"
|
||||
import { computed } from "vue"
|
||||
|
||||
const settingsStore = useSettingsStore()
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { Directive } from "vue"
|
||||
import { useUserStore } from "@/store/modules/user"
|
||||
import { useUserStore } from "@/pinia/stores/user"
|
||||
import { isArray } from "@/utils/validate"
|
||||
|
||||
/** 权限指令,和权限判断函数 checkPermission 功能类似 */
|
||||
|
@ -1,8 +1,8 @@
|
||||
<script lang="ts" setup>
|
||||
import { useDevice } from "@/composables/useDevice"
|
||||
import { useLayoutMode } from "@/composables/useLayoutMode"
|
||||
import { useAppStore } from "@/store/modules/app"
|
||||
import { useSettingsStore } from "@/store/modules/settings"
|
||||
import { useAppStore } from "@/pinia/stores/app"
|
||||
import { useSettingsStore } from "@/pinia/stores/settings"
|
||||
import { storeToRefs } from "pinia"
|
||||
import { computed } from "vue"
|
||||
import { AppMain, NavigationBar, Sidebar, TagsView } from "./components"
|
||||
|
@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { useAppStore } from "@/store/modules/app"
|
||||
import { useSettingsStore } from "@/store/modules/settings"
|
||||
import { useAppStore } from "@/pinia/stores/app"
|
||||
import { useSettingsStore } from "@/pinia/stores/settings"
|
||||
import { storeToRefs } from "pinia"
|
||||
import { computed } from "vue"
|
||||
import { AppMain, Logo, NavigationBar, Sidebar, TagsView } from "./components"
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { useSettingsStore } from "@/store/modules/settings"
|
||||
import { useSettingsStore } from "@/pinia/stores/settings"
|
||||
import { storeToRefs } from "pinia"
|
||||
import { AppMain, Logo, NavigationBar, TagsView } from "./components"
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { useSettingsStore } from "@/store/modules/settings"
|
||||
import { useTagsViewStore } from "@/store/modules/tags-view"
|
||||
import { useSettingsStore } from "@/pinia/stores/settings"
|
||||
import { useTagsViewStore } from "@/pinia/stores/tags-view"
|
||||
import Footer from "./Footer/index.vue"
|
||||
|
||||
const tagsViewStore = useTagsViewStore()
|
||||
|
@ -5,9 +5,9 @@ import SearchMenu from "@/components/SearchMenu/index.vue"
|
||||
import ThemeSwitch from "@/components/ThemeSwitch/index.vue"
|
||||
import { useDevice } from "@/composables/useDevice"
|
||||
import { useLayoutMode } from "@/composables/useLayoutMode"
|
||||
import { useAppStore } from "@/store/modules/app"
|
||||
import { useSettingsStore } from "@/store/modules/settings"
|
||||
import { useUserStore } from "@/store/modules/user"
|
||||
import { useAppStore } from "@/pinia/stores/app"
|
||||
import { useSettingsStore } from "@/pinia/stores/settings"
|
||||
import { useUserStore } from "@/pinia/stores/user"
|
||||
import { UserFilled } from "@element-plus/icons-vue"
|
||||
import { storeToRefs } from "pinia"
|
||||
import { useRouter } from "vue-router"
|
||||
|
@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { useLayoutMode } from "@/composables/useLayoutMode"
|
||||
import { useSettingsStore } from "@/store/modules/settings"
|
||||
import { useSettingsStore } from "@/pinia/stores/settings"
|
||||
import { removeConfigLayout } from "@/utils/cache/local-storage"
|
||||
import { Refresh } from "@element-plus/icons-vue"
|
||||
import { storeToRefs } from "pinia"
|
||||
|
@ -1,9 +1,9 @@
|
||||
<script lang="ts" setup>
|
||||
import { useDevice } from "@/composables/useDevice"
|
||||
import { useLayoutMode } from "@/composables/useLayoutMode"
|
||||
import { useAppStore } from "@/store/modules/app"
|
||||
import { usePermissionStore } from "@/store/modules/permission"
|
||||
import { useSettingsStore } from "@/store/modules/settings"
|
||||
import { useAppStore } from "@/pinia/stores/app"
|
||||
import { usePermissionStore } from "@/pinia/stores/permission"
|
||||
import { useSettingsStore } from "@/pinia/stores/settings"
|
||||
import { getCssVar } from "@/utils/css"
|
||||
import { computed } from "vue"
|
||||
import { useRoute } from "vue-router"
|
||||
|
@ -3,7 +3,7 @@ import type { ElScrollbar } from "element-plus"
|
||||
import type { RouterLink } from "vue-router"
|
||||
import Screenfull from "@/components/Screenfull/index.vue"
|
||||
import { useRouteListener } from "@/composables/useRouteListener"
|
||||
import { useSettingsStore } from "@/store/modules/settings"
|
||||
import { useSettingsStore } from "@/pinia/stores/settings"
|
||||
import { ArrowLeft, ArrowRight } from "@element-plus/icons-vue"
|
||||
import { nextTick, ref } from "vue"
|
||||
import { useRoute } from "vue-router"
|
||||
|
@ -1,9 +1,9 @@
|
||||
<script lang="ts" setup>
|
||||
import type { TagView } from "@/store/modules/tags-view"
|
||||
import type { TagView } from "@/pinia/stores/tags-view"
|
||||
import type { RouteLocationNormalizedLoaded, RouteRecordRaw, RouterLink } from "vue-router"
|
||||
import { useRouteListener } from "@/composables/useRouteListener"
|
||||
import { usePermissionStore } from "@/store/modules/permission"
|
||||
import { useTagsViewStore } from "@/store/modules/tags-view"
|
||||
import { usePermissionStore } from "@/pinia/stores/permission"
|
||||
import { useTagsViewStore } from "@/pinia/stores/tags-view"
|
||||
import { Close } from "@element-plus/icons-vue"
|
||||
import path from "path-browserify"
|
||||
import { ref, watch } from "vue"
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { useRouteListener } from "@/composables/useRouteListener"
|
||||
import { DeviceEnum } from "@/constants/app-key"
|
||||
import { useAppStore } from "@/store/modules/app"
|
||||
import { useAppStore } from "@/pinia/stores/app"
|
||||
import { onBeforeMount, onBeforeUnmount, onMounted } from "vue"
|
||||
|
||||
/** 参考 Bootstrap 的响应式设计将最大移动端宽度设置为 992 */
|
||||
|
@ -2,7 +2,7 @@
|
||||
import { useDevice } from "@/composables/useDevice"
|
||||
import { useLayoutMode } from "@/composables/useLayoutMode"
|
||||
import { useWatermark } from "@/composables/useWatermark"
|
||||
import { useSettingsStore } from "@/store/modules/settings"
|
||||
import { useSettingsStore } from "@/pinia/stores/settings"
|
||||
import { getCssVar, setCssVar } from "@/utils/css"
|
||||
import { storeToRefs } from "pinia"
|
||||
import { watchEffect } from "vue"
|
||||
|
@ -1,8 +1,8 @@
|
||||
// core
|
||||
import App from "@/App.vue"
|
||||
import { loadDirectives } from "@/directives"
|
||||
import { pinia } from "@/pinia"
|
||||
import { router } from "@/router"
|
||||
import { pinia } from "@/store"
|
||||
import { createApp } from "vue"
|
||||
import "@/router/permission"
|
||||
// load
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { DeviceEnum, SIDEBAR_CLOSED, SIDEBAR_OPENED } from "@/constants/app-key"
|
||||
import { pinia } from "@/store"
|
||||
import { pinia } from "@/pinia"
|
||||
import { getSidebarStatus, setSidebarStatus } from "@/utils/cache/local-storage"
|
||||
import { defineStore } from "pinia"
|
||||
import { reactive, ref, watch } from "vue"
|
@ -1,8 +1,8 @@
|
||||
import type { RouteRecordRaw } from "vue-router"
|
||||
import routeSettings from "@/config/route"
|
||||
import { pinia } from "@/pinia"
|
||||
import { constantRoutes, dynamicRoutes } from "@/router"
|
||||
import { flatMultiLevelRoutes } from "@/router/helper"
|
||||
import { pinia } from "@/store"
|
||||
import { defineStore } from "pinia"
|
||||
import { ref } from "vue"
|
||||
|
@ -1,7 +1,7 @@
|
||||
import type { LayoutSettings } from "@/config/layouts"
|
||||
import type { Ref } from "vue"
|
||||
import { layoutSettings } from "@/config/layouts"
|
||||
import { pinia } from "@/store"
|
||||
import { pinia } from "@/pinia"
|
||||
import { setConfigLayout } from "@/utils/cache/local-storage"
|
||||
import { defineStore } from "pinia"
|
||||
import { ref, watch } from "vue"
|
@ -1,5 +1,5 @@
|
||||
import type { RouteLocationNormalized } from "vue-router"
|
||||
import { pinia } from "@/store"
|
||||
import { pinia } from "@/pinia"
|
||||
import { getCachedViews, getVisitedViews, setCachedViews, setVisitedViews } from "@/utils/cache/local-storage"
|
||||
import { defineStore } from "pinia"
|
||||
import { ref, watchEffect } from "vue"
|
@ -1,8 +1,8 @@
|
||||
import type { LoginRequestData } from "@/api/login/types/login"
|
||||
import { getUserInfoApi, loginApi } from "@/api/login"
|
||||
import routeSettings from "@/config/route"
|
||||
import { pinia } from "@/pinia"
|
||||
import { resetRouter } from "@/router"
|
||||
import { pinia } from "@/store"
|
||||
import { getToken, removeToken, setToken } from "@/utils/cache/cookies"
|
||||
import { defineStore } from "pinia"
|
||||
import { ref } from "vue"
|
@ -2,9 +2,9 @@ import { setRouteChange } from "@/composables/useRouteListener"
|
||||
import { useTitle } from "@/composables/useTitle"
|
||||
import routeSettings from "@/config/route"
|
||||
import isWhiteList from "@/config/white-list"
|
||||
import { usePermissionStoreOutside } from "@/pinia/stores/permission"
|
||||
import { useUserStoreOutside } from "@/pinia/stores/user"
|
||||
import { router } from "@/router"
|
||||
import { usePermissionStoreOutside } from "@/store/modules/permission"
|
||||
import { useUserStoreOutside } from "@/store/modules/user"
|
||||
import { getToken } from "@/utils/cache/cookies"
|
||||
import { ElMessage } from "element-plus"
|
||||
import NProgress from "nprogress"
|
||||
|
2
src/utils/cache/local-storage.ts
vendored
2
src/utils/cache/local-storage.ts
vendored
@ -3,7 +3,7 @@
|
||||
import type { ThemeName } from "@/composables/useTheme"
|
||||
import type { LayoutSettings } from "@/config/layouts"
|
||||
import type { SidebarClosed, SidebarOpened } from "@/constants/app-key"
|
||||
import type { TagView } from "@/store/modules/tags-view"
|
||||
import type { TagView } from "@/pinia/stores/tags-view"
|
||||
import CacheKey from "@/constants/cache-key"
|
||||
|
||||
// #region 系统布局配置
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { useUserStore } from "@/store/modules/user"
|
||||
import { useUserStore } from "@/pinia/stores/user"
|
||||
import { isArray } from "@/utils/validate"
|
||||
|
||||
/** 全局权限判断函数,和权限指令 v-permission 功能类似 */
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { AxiosInstance, AxiosRequestConfig } from "axios"
|
||||
import { useUserStore } from "@/store/modules/user"
|
||||
import { useUserStore } from "@/pinia/stores/user"
|
||||
import axios from "axios"
|
||||
import { ElMessage } from "element-plus"
|
||||
import { get, merge } from "lodash-es"
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { useUserStore } from "@/store/modules/user"
|
||||
import { useUserStore } from "@/pinia/stores/user"
|
||||
import Admin from "./components/Admin.vue"
|
||||
import Editor from "./components/Editor.vue"
|
||||
|
||||
|
@ -3,7 +3,7 @@ import type { LoginRequestData } from "@/api/login/types/login"
|
||||
import type { FormInstance, FormRules } from "element-plus"
|
||||
import { getLoginCodeApi } from "@/api/login"
|
||||
import ThemeSwitch from "@/components/ThemeSwitch/index.vue"
|
||||
import { useUserStore } from "@/store/modules/user"
|
||||
import { useUserStore } from "@/pinia/stores/user"
|
||||
import { Key, Loading, Lock, Picture, User } from "@element-plus/icons-vue"
|
||||
import { reactive, ref } from "vue"
|
||||
import { useRouter } from "vue-router"
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { useUserStore } from "@/store/modules/user"
|
||||
import { useUserStore } from "@/pinia/stores/user"
|
||||
import { ref, watch } from "vue"
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
Loading…
x
Reference in New Issue
Block a user