Browse Source

refactor: 使用`@/`别名替换`/@/`别名

i18n
xiaoxian521 2 years ago
parent
commit
7d419c3b35
  1. 2
      build/plugins.ts
  2. 2
      src/components/ReAuth/src/auth.tsx
  3. 2
      src/directives/auth/index.ts
  4. 2
      src/directives/elResizeDetector/index.ts
  5. 4
      src/layout/components/appMain.vue
  6. 6
      src/layout/components/navbar.vue
  7. 2
      src/layout/components/panel/index.vue
  8. 4
      src/layout/components/search/components/SearchFooter.vue
  9. 6
      src/layout/components/search/components/SearchModal.vue
  10. 6
      src/layout/components/search/components/SearchResult.vue
  11. 22
      src/layout/components/setting/index.vue
  12. 6
      src/layout/components/sidebar/breadCrumb.vue
  13. 8
      src/layout/components/sidebar/horizontal.vue
  14. 2
      src/layout/components/sidebar/logo.vue
  15. 14
      src/layout/components/sidebar/mixNav.vue
  16. 6
      src/layout/components/sidebar/sidebarItem.vue
  17. 8
      src/layout/components/sidebar/vertical.vue
  18. 12
      src/layout/components/tag/index.vue
  19. 4
      src/layout/hooks/useDataThemeChange.ts
  20. 2
      src/layout/hooks/useLayout.ts
  21. 14
      src/layout/hooks/useNav.ts
  22. 6
      src/layout/hooks/useTag.ts
  23. 8
      src/layout/index.vue
  24. 14
      src/main.ts
  25. 2
      src/plugins/vxe-table/index.ts
  26. 12
      src/router/index.ts
  27. 8
      src/router/modules/error.ts
  28. 6
      src/router/modules/home.ts
  29. 8
      src/router/modules/remaining.ts
  30. 10
      src/router/utils.ts
  31. 4
      src/store/modules/app.ts
  32. 4
      src/store/modules/epTheme.ts
  33. 4
      src/store/modules/multiTags.ts
  34. 6
      src/store/modules/permission.ts
  35. 4
      src/store/modules/settings.ts
  36. 19
      src/store/modules/user.ts
  37. 2
      src/utils/auth.ts
  38. 4
      src/utils/http/README.md
  39. 4
      src/utils/http/index.ts
  40. 2
      src/utils/responsive.ts
  41. 2
      src/views/error/403.vue
  42. 2
      src/views/error/404.vue
  43. 2
      src/views/error/500.vue
  44. 24
      src/views/login/index.vue
  45. 2
      src/views/login/utils/rule.ts
  46. 6
      src/views/login/utils/static.ts
  47. 2
      src/views/permission/button/index.vue
  48. 6
      src/views/permission/page/index.vue
  49. 2
      tsconfig.json
  50. 2
      vite.config.ts

2
build/plugins.ts

@ -12,8 +12,8 @@ import VueI18n from "@intlify/vite-plugin-vue-i18n";
import { visualizer } from "rollup-plugin-visualizer"; import { visualizer } from "rollup-plugin-visualizer";
import removeConsole from "vite-plugin-remove-console"; import removeConsole from "vite-plugin-remove-console";
import themePreprocessorPlugin from "@pureadmin/theme"; import themePreprocessorPlugin from "@pureadmin/theme";
import { genScssMultipleScopeVars } from "/@/layout/theme";
import DefineOptions from "unplugin-vue-define-options/vite"; import DefineOptions from "unplugin-vue-define-options/vite";
import { genScssMultipleScopeVars } from "../src/layout/theme";
export function getPluginsList( export function getPluginsList(
command: string, command: string,

2
src/components/ReAuth/src/auth.tsx

@ -1,5 +1,5 @@
import { defineComponent, Fragment } from "vue"; import { defineComponent, Fragment } from "vue";
import { hasAuth } from "/@/router/utils";
import { hasAuth } from "@/router/utils";
export default defineComponent({ export default defineComponent({
name: "Auth", name: "Auth",

2
src/directives/auth/index.ts

@ -1,4 +1,4 @@
import { hasAuth } from "/@/router/utils";
import { hasAuth } from "@/router/utils";
import { Directive, type DirectiveBinding } from "vue"; import { Directive, type DirectiveBinding } from "vue";
export const auth: Directive = { export const auth: Directive = {

2
src/directives/elResizeDetector/index.ts

@ -1,7 +1,7 @@
import { Directive, type DirectiveBinding, type VNode } from "vue"; import { Directive, type DirectiveBinding, type VNode } from "vue";
import elementResizeDetectorMaker from "element-resize-detector"; import elementResizeDetectorMaker from "element-resize-detector";
import type { Erd } from "element-resize-detector"; import type { Erd } from "element-resize-detector";
import { emitter } from "/@/utils/mitt";
import { emitter } from "@/utils/mitt";
const erd: Erd = elementResizeDetectorMaker({ const erd: Erd = elementResizeDetectorMaker({
strategy: "scroll" strategy: "scroll"

4
src/layout/components/appMain.vue

@ -1,8 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
import { useGlobal } from "@pureadmin/utils"; import { useGlobal } from "@pureadmin/utils";
import backTop from "/@/assets/svg/back_top.svg?component";
import backTop from "@/assets/svg/back_top.svg?component";
import { h, computed, Transition, defineComponent } from "vue"; import { h, computed, Transition, defineComponent } from "vue";
import { usePermissionStoreHook } from "/@/store/modules/permission";
import { usePermissionStoreHook } from "@/store/modules/permission";
const props = defineProps({ const props = defineProps({
fixedHeader: Boolean fixedHeader: Boolean

6
src/layout/components/navbar.vue

@ -2,12 +2,12 @@
import Search from "./search/index.vue"; import Search from "./search/index.vue";
import Notice from "./notice/index.vue"; import Notice from "./notice/index.vue";
import mixNav from "./sidebar/mixNav.vue"; import mixNav from "./sidebar/mixNav.vue";
import avatars from "/@/assets/avatars.jpg";
import { useNav } from "/@/layout/hooks/useNav";
import avatars from "@/assets/avatars.jpg";
import { useNav } from "@/layout/hooks/useNav";
import Breadcrumb from "./sidebar/breadCrumb.vue"; import Breadcrumb from "./sidebar/breadCrumb.vue";
import topCollapse from "./sidebar/topCollapse.vue"; import topCollapse from "./sidebar/topCollapse.vue";
import { useTranslationLang } from "../hooks/useTranslationLang"; import { useTranslationLang } from "../hooks/useTranslationLang";
import globalization from "/@/assets/svg/globalization.svg?component";
import globalization from "@/assets/svg/globalization.svg?component";
const { const {
layout, layout,

2
src/layout/components/panel/index.vue

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import { ref } from "vue";
import { onClickOutside } from "@vueuse/core"; import { onClickOutside } from "@vueuse/core";
import { emitter } from "/@/utils/mitt";
import { emitter } from "@/utils/mitt";
let show = ref<Boolean>(false); let show = ref<Boolean>(false);
const target = ref(null); const target = ref(null);

4
src/layout/components/search/components/SearchFooter.vue

@ -17,8 +17,8 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import enterOutlined from "/@/assets/svg/enter_outlined.svg?component";
import mdiKeyboardEsc from "/@/assets/svg/mdi_keyboard_esc.svg?component";
import enterOutlined from "@/assets/svg/enter_outlined.svg?component";
import mdiKeyboardEsc from "@/assets/svg/mdi_keyboard_esc.svg?component";
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.search-footer { .search-footer {

6
src/layout/components/search/components/SearchModal.vue

@ -3,12 +3,12 @@ import { useRouter } from "vue-router";
import { cloneDeep } from "lodash-unified"; import { cloneDeep } from "lodash-unified";
import SearchResult from "./SearchResult.vue"; import SearchResult from "./SearchResult.vue";
import SearchFooter from "./SearchFooter.vue"; import SearchFooter from "./SearchFooter.vue";
import { useNav } from "/@/layout/hooks/useNav";
import { transformI18n } from "/@/plugins/i18n";
import { useNav } from "@/layout/hooks/useNav";
import { transformI18n } from "@/plugins/i18n";
import { deleteChildren } from "@pureadmin/utils"; import { deleteChildren } from "@pureadmin/utils";
import { useDebounceFn, onKeyStroke } from "@vueuse/core"; import { useDebounceFn, onKeyStroke } from "@vueuse/core";
import { ref, watch, computed, nextTick, shallowRef } from "vue"; import { ref, watch, computed, nextTick, shallowRef } from "vue";
import { usePermissionStoreHook } from "/@/store/modules/permission";
import { usePermissionStoreHook } from "@/store/modules/permission";
interface Props { interface Props {
/** 弹窗显隐 */ /** 弹窗显隐 */

6
src/layout/components/search/components/SearchResult.vue

@ -1,9 +1,9 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed } from "vue"; import { computed } from "vue";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { useEpThemeStoreHook } from "/@/store/modules/epTheme";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
import enterOutlined from "/@/assets/svg/enter_outlined.svg?component";
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
import enterOutlined from "@/assets/svg/enter_outlined.svg?component";
const { t } = useI18n(); const { t } = useI18n();

22
src/layout/components/setting/index.vue

@ -8,18 +8,18 @@ import {
nextTick, nextTick,
useCssModule useCssModule
} from "vue"; } from "vue";
import { getConfig } from "/@/config";
import { getConfig } from "@/config";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import panel from "../panel/index.vue"; import panel from "../panel/index.vue";
import { emitter } from "/@/utils/mitt";
import { resetRouter } from "/@/router";
import { emitter } from "@/utils/mitt";
import { resetRouter } from "@/router";
import { templateRef } from "@vueuse/core"; import { templateRef } from "@vueuse/core";
import { removeToken } from "/@/utils/auth";
import { routerArrays } from "/@/layout/types";
import { useNav } from "/@/layout/hooks/useNav";
import { useAppStoreHook } from "/@/store/modules/app";
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
import { useDataThemeChange } from "/@/layout/hooks/useDataThemeChange";
import { removeToken } from "@/utils/auth";
import { routerArrays } from "@/layout/types";
import { useNav } from "@/layout/hooks/useNav";
import { useAppStoreHook } from "@/store/modules/app";
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
import { useDataThemeChange } from "@/layout/hooks/useDataThemeChange";
import { import {
useDark, useDark,
debounce, debounce,
@ -29,8 +29,8 @@ import {
} from "@pureadmin/utils"; } from "@pureadmin/utils";
import { toggleTheme } from "@pureadmin/theme/dist/browser-utils"; import { toggleTheme } from "@pureadmin/theme/dist/browser-utils";
import dayIcon from "/@/assets/svg/day.svg?component";
import darkIcon from "/@/assets/svg/dark.svg?component";
import dayIcon from "@/assets/svg/day.svg?component";
import darkIcon from "@/assets/svg/dark.svg?component";
const router = useRouter(); const router = useRouter();
const { device } = useNav(); const { device } = useNav();

6
src/layout/components/sidebar/breadCrumb.vue

@ -1,9 +1,9 @@
<script setup lang="ts"> <script setup lang="ts">
import { isEqual } from "lodash-unified"; import { isEqual } from "lodash-unified";
import { transformI18n } from "/@/plugins/i18n";
import { transformI18n } from "@/plugins/i18n";
import { ref, watch, onMounted, toRaw } from "vue"; import { ref, watch, onMounted, toRaw } from "vue";
import { getParentPaths, findRouteByPath } from "/@/router/utils";
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
import { getParentPaths, findRouteByPath } from "@/router/utils";
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
import { useRoute, useRouter, RouteLocationMatched } from "vue-router"; import { useRoute, useRouter, RouteLocationMatched } from "vue-router";
const route = useRoute(); const route = useRoute();

8
src/layout/components/sidebar/horizontal.vue

@ -3,11 +3,11 @@ import Search from "../search/index.vue";
import Notice from "../notice/index.vue"; import Notice from "../notice/index.vue";
import { ref, watch, nextTick } from "vue"; import { ref, watch, nextTick } from "vue";
import SidebarItem from "./sidebarItem.vue"; import SidebarItem from "./sidebarItem.vue";
import avatars from "/@/assets/avatars.jpg";
import { useNav } from "/@/layout/hooks/useNav";
import avatars from "@/assets/avatars.jpg";
import { useNav } from "@/layout/hooks/useNav";
import { useTranslationLang } from "../../hooks/useTranslationLang"; import { useTranslationLang } from "../../hooks/useTranslationLang";
import { usePermissionStoreHook } from "/@/store/modules/permission";
import globalization from "/@/assets/svg/globalization.svg?component";
import { usePermissionStoreHook } from "@/store/modules/permission";
import globalization from "@/assets/svg/globalization.svg?component";
const menuRef = ref(); const menuRef = ref();

2
src/layout/components/sidebar/logo.vue

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { useNav } from "/@/layout/hooks/useNav";
import { useNav } from "@/layout/hooks/useNav";
const props = defineProps({ const props = defineProps({
collapse: Boolean collapse: Boolean

14
src/layout/components/sidebar/mixNav.vue

@ -1,15 +1,15 @@
<script setup lang="ts"> <script setup lang="ts">
import Search from "../search/index.vue"; import Search from "../search/index.vue";
import Notice from "../notice/index.vue"; import Notice from "../notice/index.vue";
import avatars from "/@/assets/avatars.jpg";
import { useNav } from "/@/layout/hooks/useNav";
import { transformI18n } from "/@/plugins/i18n";
import avatars from "@/assets/avatars.jpg";
import { useNav } from "@/layout/hooks/useNav";
import { transformI18n } from "@/plugins/i18n";
import { ref, toRaw, watch, onMounted, nextTick } from "vue"; import { ref, toRaw, watch, onMounted, nextTick } from "vue";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
import { getParentPaths, findRouteByPath } from "/@/router/utils";
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
import { getParentPaths, findRouteByPath } from "@/router/utils";
import { useTranslationLang } from "../../hooks/useTranslationLang"; import { useTranslationLang } from "../../hooks/useTranslationLang";
import { usePermissionStoreHook } from "/@/store/modules/permission";
import globalization from "/@/assets/svg/globalization.svg?component";
import { usePermissionStoreHook } from "@/store/modules/permission";
import globalization from "@/assets/svg/globalization.svg?component";
const menuRef = ref(); const menuRef = ref();
let defaultActive = ref(null); let defaultActive = ref(null);

6
src/layout/components/sidebar/sidebarItem.vue

@ -1,9 +1,9 @@
<script setup lang="ts"> <script setup lang="ts">
import path from "path"; import path from "path";
import { childrenType } from "../../types"; import { childrenType } from "../../types";
import { useNav } from "/@/layout/hooks/useNav";
import { transformI18n } from "/@/plugins/i18n";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
import { useNav } from "@/layout/hooks/useNav";
import { transformI18n } from "@/plugins/i18n";
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
import { ref, toRaw, PropType, nextTick, computed, CSSProperties } from "vue"; import { ref, toRaw, PropType, nextTick, computed, CSSProperties } from "vue";
const { layout, isCollapse } = useNav(); const { layout, isCollapse } = useNav();

8
src/layout/components/sidebar/vertical.vue

@ -1,15 +1,15 @@
<script setup lang="ts"> <script setup lang="ts">
import Logo from "./logo.vue"; import Logo from "./logo.vue";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import { emitter } from "/@/utils/mitt";
import { emitter } from "@/utils/mitt";
import SidebarItem from "./sidebarItem.vue"; import SidebarItem from "./sidebarItem.vue";
import leftCollapse from "./leftCollapse.vue"; import leftCollapse from "./leftCollapse.vue";
import type { StorageConfigs } from "/#/index"; import type { StorageConfigs } from "/#/index";
import { useNav } from "/@/layout/hooks/useNav";
import { useNav } from "@/layout/hooks/useNav";
import { storageLocal } from "@pureadmin/utils"; import { storageLocal } from "@pureadmin/utils";
import { ref, computed, watch, onBeforeMount } from "vue"; import { ref, computed, watch, onBeforeMount } from "vue";
import { findRouteByPath, getParentPaths } from "/@/router/utils";
import { usePermissionStoreHook } from "/@/store/modules/permission";
import { findRouteByPath, getParentPaths } from "@/router/utils";
import { usePermissionStoreHook } from "@/store/modules/permission";
const route = useRoute(); const route = useRoute();
const showLogo = ref( const showLogo = ref(

12
src/layout/components/tag/index.vue

@ -1,14 +1,14 @@
<script setup lang="ts"> <script setup lang="ts">
import { $t } from "/@/plugins/i18n";
import { emitter } from "/@/utils/mitt";
import { $t } from "@/plugins/i18n";
import { emitter } from "@/utils/mitt";
import { RouteConfigs } from "../../types"; import { RouteConfigs } from "../../types";
import { useTags } from "../../hooks/useTag"; import { useTags } from "../../hooks/useTag";
import { routerArrays } from "/@/layout/types";
import { routerArrays } from "@/layout/types";
import { isEqual, isEmpty } from "lodash-unified"; import { isEqual, isEmpty } from "lodash-unified";
import { useSettingStoreHook } from "/@/store/modules/settings";
import { useSettingStoreHook } from "@/store/modules/settings";
import { ref, watch, unref, nextTick, onBeforeMount } from "vue"; import { ref, watch, unref, nextTick, onBeforeMount } from "vue";
import { handleAliveRoute, delAliveRoutes } from "/@/router/utils";
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
import { handleAliveRoute, delAliveRoutes } from "@/router/utils";
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
import { useResizeObserver, useDebounceFn, useFullscreen } from "@vueuse/core"; import { useResizeObserver, useDebounceFn, useFullscreen } from "@vueuse/core";
const { const {

4
src/layout/hooks/useDataThemeChange.ts

@ -1,11 +1,11 @@
import { ref } from "vue"; import { ref } from "vue";
import { getConfig } from "/@/config";
import { getConfig } from "@/config";
import { find } from "lodash-unified"; import { find } from "lodash-unified";
import { useLayout } from "./useLayout"; import { useLayout } from "./useLayout";
import { themeColorsType } from "../types"; import { themeColorsType } from "../types";
import { TinyColor } from "@ctrl/tinycolor"; import { TinyColor } from "@ctrl/tinycolor";
import { useGlobal } from "@pureadmin/utils"; import { useGlobal } from "@pureadmin/utils";
import { useEpThemeStoreHook } from "/@/store/modules/epTheme";
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
import { import {
darken, darken,
lighten, lighten,

2
src/layout/hooks/useLayout.ts

@ -2,7 +2,7 @@ import { computed } from "vue";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { routerArrays } from "../types"; import { routerArrays } from "../types";
import { useGlobal } from "@pureadmin/utils"; import { useGlobal } from "@pureadmin/utils";
import { useMultiTagsStore } from "/@/store/modules/multiTags";
import { useMultiTagsStore } from "@/store/modules/multiTags";
export function useLayout() { export function useLayout() {
const { $storage, $config } = useGlobal<GlobalPropertiesApi>(); const { $storage, $config } = useGlobal<GlobalPropertiesApi>();

14
src/layout/hooks/useNav.ts

@ -1,14 +1,14 @@
import { computed } from "vue"; import { computed } from "vue";
import { getConfig } from "/@/config";
import { getConfig } from "@/config";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { emitter } from "/@/utils/mitt";
import { emitter } from "@/utils/mitt";
import { routeMetaType } from "../types"; import { routeMetaType } from "../types";
import { useGlobal } from "@pureadmin/utils"; import { useGlobal } from "@pureadmin/utils";
import { transformI18n } from "/@/plugins/i18n";
import { router, remainingPaths } from "/@/router";
import { useAppStoreHook } from "/@/store/modules/app";
import { useUserStoreHook } from "/@/store/modules/user";
import { useEpThemeStoreHook } from "/@/store/modules/epTheme";
import { transformI18n } from "@/plugins/i18n";
import { router, remainingPaths } from "@/router";
import { useAppStoreHook } from "@/store/modules/app";
import { useUserStoreHook } from "@/store/modules/user";
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
const errorInfo = "当前路由配置不正确,请检查配置"; const errorInfo = "当前路由配置不正确,请检查配置";

6
src/layout/hooks/useTag.ts

@ -13,9 +13,9 @@ import { isEqual } from "lodash-unified";
import type { StorageConfigs } from "/#/index"; import type { StorageConfigs } from "/#/index";
import { useEventListener } from "@vueuse/core"; import { useEventListener } from "@vueuse/core";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import { transformI18n, $t } from "/@/plugins/i18n";
import { useSettingStoreHook } from "/@/store/modules/settings";
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
import { transformI18n, $t } from "@/plugins/i18n";
import { useSettingStoreHook } from "@/store/modules/settings";
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
import { storageLocal, toggleClass, hasClass } from "@pureadmin/utils"; import { storageLocal, toggleClass, hasClass } from "@pureadmin/utils";
export function useTags() { export function useTags() {

8
src/layout/index.vue

@ -1,9 +1,9 @@
<script setup lang="ts"> <script setup lang="ts">
import { setType } from "./types"; import { setType } from "./types";
import { emitter } from "/@/utils/mitt";
import { emitter } from "@/utils/mitt";
import { useLayout } from "./hooks/useLayout"; import { useLayout } from "./hooks/useLayout";
import { useAppStoreHook } from "/@/store/modules/app";
import { useSettingStoreHook } from "/@/store/modules/settings";
import { useAppStoreHook } from "@/store/modules/app";
import { useSettingStoreHook } from "@/store/modules/settings";
import { deviceDetection, useDark, useGlobal } from "@pureadmin/utils"; import { deviceDetection, useDark, useGlobal } from "@pureadmin/utils";
import { h, reactive, computed, onMounted, defineComponent } from "vue"; import { h, reactive, computed, onMounted, defineComponent } from "vue";
@ -13,7 +13,7 @@ import appMain from "./components/appMain.vue";
import setting from "./components/setting/index.vue"; import setting from "./components/setting/index.vue";
import Vertical from "./components/sidebar/vertical.vue"; import Vertical from "./components/sidebar/vertical.vue";
import Horizontal from "./components/sidebar/horizontal.vue"; import Horizontal from "./components/sidebar/horizontal.vue";
import backTop from "/@/assets/svg/back_top.svg?component";
import backTop from "@/assets/svg/back_top.svg?component";
const { isDark } = useDark(); const { isDark } = useDark();
const { layout } = useLayout(); const { layout } = useLayout();

14
src/main.ts

@ -1,14 +1,14 @@
import App from "./App.vue"; import App from "./App.vue";
import router from "./router"; import router from "./router";
import { setupStore } from "/@/store";
import { setupStore } from "@/store";
import ElementPlus from "element-plus"; import ElementPlus from "element-plus";
import { useI18n } from "@/plugins/i18n";
import { getServerConfig } from "./config"; import { getServerConfig } from "./config";
import { createApp, Directive } from "vue"; import { createApp, Directive } from "vue";
import { useI18n } from "../src/plugins/i18n";
import { MotionPlugin } from "@vueuse/motion"; import { MotionPlugin } from "@vueuse/motion";
// import { useEcharts } from "/@/plugins/echarts";
// import { useTable } from "../src/plugins/vxe-table";
import { injectResponsiveStorage } from "/@/utils/responsive";
// import { useEcharts } from "@/plugins/echarts";
// import { useTable } from "@/plugins/vxe-table";
import { injectResponsiveStorage } from "@/utils/responsive";
// import Table from "@pureadmin/table"; // import Table from "@pureadmin/table";
// import PureDescriptions from "@pureadmin/descriptions"; // import PureDescriptions from "@pureadmin/descriptions";
@ -29,7 +29,7 @@ import "./assets/iconfont/iconfont.css";
const app = createApp(App); const app = createApp(App);
// 自定义指令 // 自定义指令
import * as directives from "/@/directives";
import * as directives from "@/directives";
Object.keys(directives).forEach(key => { Object.keys(directives).forEach(key => {
app.directive(key, (directives as { [key: string]: Directive })[key]); app.directive(key, (directives as { [key: string]: Directive })[key]);
}); });
@ -45,7 +45,7 @@ app.component("IconifyIconOnline", IconifyIconOnline);
app.component("FontIcon", FontIcon); app.component("FontIcon", FontIcon);
// 全局注册按钮级别权限组件 // 全局注册按钮级别权限组件
import { Auth } from "/@/components/ReAuth";
import { Auth } from "@/components/ReAuth";
app.component("Auth", Auth); app.component("Auth", Auth);
getServerConfig(app).then(async config => { getServerConfig(app).then(async config => {

2
src/plugins/vxe-table/index.ts

@ -2,7 +2,7 @@ import "xe-utils";
import "./index.scss"; import "./index.scss";
import XEUtils from "xe-utils"; import XEUtils from "xe-utils";
import { App, unref } from "vue"; import { App, unref } from "vue";
import { i18n } from "/@/plugins/i18n";
import { i18n } from "@/plugins/i18n";
import "font-awesome/css/font-awesome.min.css"; import "font-awesome/css/font-awesome.min.css";
import zh from "vxe-table/lib/locale/lang/zh-CN"; import zh from "vxe-table/lib/locale/lang/zh-CN";
import en from "vxe-table/lib/locale/lang/en-US"; import en from "vxe-table/lib/locale/lang/en-US";

12
src/router/index.ts

@ -1,11 +1,11 @@
import { getConfig } from "/@/config";
import { getConfig } from "@/config";
import { toRouteType } from "./types"; import { toRouteType } from "./types";
import NProgress from "/@/utils/progress";
import NProgress from "@/utils/progress";
import { findIndex } from "lodash-unified"; import { findIndex } from "lodash-unified";
import { transformI18n } from "/@/plugins/i18n";
import { sessionKey, type DataInfo } from "/@/utils/auth";
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
import { usePermissionStoreHook } from "/@/store/modules/permission";
import { transformI18n } from "@/plugins/i18n";
import { sessionKey, type DataInfo } from "@/utils/auth";
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
import { usePermissionStoreHook } from "@/store/modules/permission";
import { import {
Router, Router,
createRouter, createRouter,

8
src/router/modules/error.ts

@ -1,4 +1,4 @@
import { $t } from "/@/plugins/i18n";
import { $t } from "@/plugins/i18n";
import type { RouteConfigsTable } from "/#/index"; import type { RouteConfigsTable } from "/#/index";
const errorRouter: RouteConfigsTable = { const errorRouter: RouteConfigsTable = {
@ -13,7 +13,7 @@ const errorRouter: RouteConfigsTable = {
{ {
path: "/error/403", path: "/error/403",
name: "403", name: "403",
component: () => import("/@/views/error/403.vue"),
component: () => import("@/views/error/403.vue"),
meta: { meta: {
title: $t("menus.hsfourZeroOne") title: $t("menus.hsfourZeroOne")
} }
@ -21,7 +21,7 @@ const errorRouter: RouteConfigsTable = {
{ {
path: "/error/404", path: "/error/404",
name: "404", name: "404",
component: () => import("/@/views/error/404.vue"),
component: () => import("@/views/error/404.vue"),
meta: { meta: {
title: $t("menus.hsfourZeroFour") title: $t("menus.hsfourZeroFour")
} }
@ -29,7 +29,7 @@ const errorRouter: RouteConfigsTable = {
{ {
path: "/error/500", path: "/error/500",
name: "500", name: "500",
component: () => import("/@/views/error/500.vue"),
component: () => import("@/views/error/500.vue"),
meta: { meta: {
title: $t("menus.hsFive") title: $t("menus.hsFive")
} }

6
src/router/modules/home.ts

@ -1,6 +1,6 @@
import { $t } from "/@/plugins/i18n";
import { $t } from "@/plugins/i18n";
import type { RouteConfigsTable } from "/#/index"; import type { RouteConfigsTable } from "/#/index";
const Layout = () => import("/@/layout/index.vue");
const Layout = () => import("@/layout/index.vue");
const homeRouter: RouteConfigsTable = { const homeRouter: RouteConfigsTable = {
path: "/", path: "/",
@ -16,7 +16,7 @@ const homeRouter: RouteConfigsTable = {
{ {
path: "/welcome", path: "/welcome",
name: "Welcome", name: "Welcome",
component: () => import("/@/views/welcome/index.vue"),
component: () => import("@/views/welcome/index.vue"),
meta: { meta: {
title: $t("menus.hshome") title: $t("menus.hshome")
} }

8
src/router/modules/remaining.ts

@ -1,12 +1,12 @@
import { $t } from "/@/plugins/i18n";
import { $t } from "@/plugins/i18n";
import type { RouteConfigsTable } from "/#/index"; import type { RouteConfigsTable } from "/#/index";
const Layout = () => import("/@/layout/index.vue");
const Layout = () => import("@/layout/index.vue");
const remainingRouter: Array<RouteConfigsTable> = [ const remainingRouter: Array<RouteConfigsTable> = [
{ {
path: "/login", path: "/login",
name: "Login", name: "Login",
component: () => import("/@/views/login/index.vue"),
component: () => import("@/views/login/index.vue"),
meta: { meta: {
title: $t("menus.hslogin"), title: $t("menus.hslogin"),
showLink: false, showLink: false,
@ -26,7 +26,7 @@ const remainingRouter: Array<RouteConfigsTable> = [
{ {
path: "/redirect/:path(.*)", path: "/redirect/:path(.*)",
name: "Redirect", name: "Redirect",
component: () => import("/@/layout/redirect.vue")
component: () => import("@/layout/redirect.vue")
} }
] ]
} }

10
src/router/utils.ts

@ -10,7 +10,7 @@ import { router } from "./index";
import { isProxy, toRaw } from "vue"; import { isProxy, toRaw } from "vue";
import { loadEnv } from "../../build"; import { loadEnv } from "../../build";
import { useTimeoutFn } from "@vueuse/core"; import { useTimeoutFn } from "@vueuse/core";
import { RouteConfigs } from "/@/layout/types";
import { RouteConfigs } from "@/layout/types";
import { import {
isString, isString,
storageSession, storageSession,
@ -18,14 +18,14 @@ import {
isIncludeAllChildren isIncludeAllChildren
} from "@pureadmin/utils"; } from "@pureadmin/utils";
import { cloneDeep, intersection } from "lodash-unified"; import { cloneDeep, intersection } from "lodash-unified";
import { sessionKey, type DataInfo } from "/@/utils/auth";
import { usePermissionStoreHook } from "/@/store/modules/permission";
const IFrame = () => import("/@/layout/frameView.vue");
import { sessionKey, type DataInfo } from "@/utils/auth";
import { usePermissionStoreHook } from "@/store/modules/permission";
const IFrame = () => import("@/layout/frameView.vue");
// https://cn.vitejs.dev/guide/features.html#glob-import // https://cn.vitejs.dev/guide/features.html#glob-import
const modulesRoutes = import.meta.glob("/src/views/**/*.{vue,tsx}"); const modulesRoutes = import.meta.glob("/src/views/**/*.{vue,tsx}");
// 动态路由 // 动态路由
import { getAsyncRoutes } from "/@/api/routes";
import { getAsyncRoutes } from "@/api/routes";
/** 按照路由中meta下的rank等级升序来排序路由 */ /** 按照路由中meta下的rank等级升序来排序路由 */
function ascending(arr: any[]) { function ascending(arr: any[]) {

4
src/store/modules/app.ts

@ -1,7 +1,7 @@
import { store } from "/@/store";
import { store } from "@/store";
import { appType } from "./types"; import { appType } from "./types";
import { defineStore } from "pinia"; import { defineStore } from "pinia";
import { getConfig } from "/@/config";
import { getConfig } from "@/config";
import type { StorageConfigs } from "/#/index"; import type { StorageConfigs } from "/#/index";
import { deviceDetection, storageLocal } from "@pureadmin/utils"; import { deviceDetection, storageLocal } from "@pureadmin/utils";

4
src/store/modules/epTheme.ts

@ -1,6 +1,6 @@
import { store } from "/@/store";
import { store } from "@/store";
import { defineStore } from "pinia"; import { defineStore } from "pinia";
import { getConfig } from "/@/config";
import { getConfig } from "@/config";
import type { StorageConfigs } from "/#/index"; import type { StorageConfigs } from "/#/index";
import { storageLocal } from "@pureadmin/utils"; import { storageLocal } from "@pureadmin/utils";

4
src/store/modules/multiTags.ts

@ -1,8 +1,8 @@
import { defineStore } from "pinia"; import { defineStore } from "pinia";
import { store } from "/@/store";
import { store } from "@/store";
import { isEqual } from "lodash-unified"; import { isEqual } from "lodash-unified";
import type { StorageConfigs } from "/#/index"; import type { StorageConfigs } from "/#/index";
import { routerArrays } from "/@/layout/types";
import { routerArrays } from "@/layout/types";
import { multiType, positionType } from "./types"; import { multiType, positionType } from "./types";
import { isUrl, storageLocal } from "@pureadmin/utils"; import { isUrl, storageLocal } from "@pureadmin/utils";

6
src/store/modules/permission.ts

@ -1,8 +1,8 @@
import { defineStore } from "pinia"; import { defineStore } from "pinia";
import { store } from "/@/store";
import { store } from "@/store";
import { cacheType } from "./types"; import { cacheType } from "./types";
import { constantMenus } from "/@/router";
import { ascending, filterTree, filterNoPermissionTree } from "/@/router/utils";
import { constantMenus } from "@/router";
import { ascending, filterTree, filterNoPermissionTree } from "@/router/utils";
export const usePermissionStore = defineStore({ export const usePermissionStore = defineStore({
id: "pure-permission", id: "pure-permission",

4
src/store/modules/settings.ts

@ -1,7 +1,7 @@
import { defineStore } from "pinia"; import { defineStore } from "pinia";
import { store } from "/@/store";
import { store } from "@/store";
import { setType } from "./types"; import { setType } from "./types";
import { getConfig } from "/@/config";
import { getConfig } from "@/config";
export const useSettingStore = defineStore({ export const useSettingStore = defineStore({
id: "pure-setting", id: "pure-setting",

19
src/store/modules/user.ts

@ -1,18 +1,13 @@
import { defineStore } from "pinia"; import { defineStore } from "pinia";
import { store } from "/@/store";
import { store } from "@/store";
import { userType } from "./types"; import { userType } from "./types";
import { routerArrays } from "/@/layout/types";
import { router, resetRouter } from "/@/router";
import { routerArrays } from "@/layout/types";
import { router, resetRouter } from "@/router";
import { storageSession } from "@pureadmin/utils"; import { storageSession } from "@pureadmin/utils";
import { getLogin, refreshTokenApi } from "/@/api/user";
import { UserResult, RefreshTokenResult } from "/@/api/user";
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
import {
type DataInfo,
setToken,
removeToken,
sessionKey
} from "/@/utils/auth";
import { getLogin, refreshTokenApi } from "@/api/user";
import { UserResult, RefreshTokenResult } from "@/api/user";
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
import { type DataInfo, setToken, removeToken, sessionKey } from "@/utils/auth";
export const useUserStore = defineStore({ export const useUserStore = defineStore({
id: "pure-user", id: "pure-user",

2
src/utils/auth.ts

@ -1,6 +1,6 @@
import Cookies from "js-cookie"; import Cookies from "js-cookie";
import { storageSession } from "@pureadmin/utils"; import { storageSession } from "@pureadmin/utils";
import { useUserStoreHook } from "/@/store/modules/user";
import { useUserStoreHook } from "@/store/modules/user";
export interface DataInfo<T> { export interface DataInfo<T> {
/** token */ /** token */

4
src/utils/http/README.md

@ -3,7 +3,7 @@
### Get 请求 ### Get 请求
``` ```
import { http } from "/@/utils/http";
import { http } from "@/utils/http";
// params传参 // params传参
http.request('get', '/xxx', { params: param }); http.request('get', '/xxx', { params: param });
@ -15,7 +15,7 @@ http.request('get', '/xxx?message=' + msg);
### Post 请求 ### Post 请求
``` ```
import { http } from "/@/utils/http";
import { http } from "@/utils/http";
// params传参 // params传参
http.request('post', '/xxx', { params: param }); http.request('post', '/xxx', { params: param });

4
src/utils/http/index.ts

@ -12,8 +12,8 @@ import {
import { stringify } from "qs"; import { stringify } from "qs";
import NProgress from "../progress"; import NProgress from "../progress";
// import { loadEnv } from "@build/index"; // import { loadEnv } from "@build/index";
import { getToken } from "/@/utils/auth";
import { useUserStoreHook } from "/@/store/modules/user";
import { getToken } from "@/utils/auth";
import { useUserStoreHook } from "@/store/modules/user";
// 加载环境变量 VITE_PROXY_DOMAIN(开发环境) VITE_PROXY_DOMAIN_REAL(打包后的线上环境) // 加载环境变量 VITE_PROXY_DOMAIN(开发环境) VITE_PROXY_DOMAIN_REAL(打包后的线上环境)
// const { VITE_PROXY_DOMAIN, VITE_PROXY_DOMAIN_REAL } = loadEnv(); // const { VITE_PROXY_DOMAIN, VITE_PROXY_DOMAIN_REAL } = loadEnv();

2
src/utils/responsive.ts

@ -1,7 +1,7 @@
// 响应式storage // 响应式storage
import { App } from "vue"; import { App } from "vue";
import Storage from "responsive-storage"; import Storage from "responsive-storage";
import { routerArrays } from "/@/layout/types";
import { routerArrays } from "@/layout/types";
const nameSpace = "responsive-"; const nameSpace = "responsive-";

2
src/views/error/403.vue

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import noAccess from "/@/assets/status/403.svg?component";
import noAccess from "@/assets/status/403.svg?component";
defineOptions({ defineOptions({
name: "403" name: "403"

2
src/views/error/404.vue

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import noExist from "/@/assets/status/404.svg?component";
import noExist from "@/assets/status/404.svg?component";
defineOptions({ defineOptions({
name: "404" name: "404"

2
src/views/error/500.vue

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import noServer from "/@/assets/status/500.svg?component";
import noServer from "@/assets/status/500.svg?component";
defineOptions({ defineOptions({
name: "500" name: "500"

24
src/views/login/index.vue

@ -3,22 +3,22 @@ import { useI18n } from "vue-i18n";
import Motion from "./utils/motion"; import Motion from "./utils/motion";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { loginRules } from "./utils/rule"; import { loginRules } from "./utils/rule";
import { initRouter } from "/@/router/utils";
import { useNav } from "/@/layout/hooks/useNav";
import { initRouter } from "@/router/utils";
import { useNav } from "@/layout/hooks/useNav";
import { message } from "@pureadmin/components"; import { message } from "@pureadmin/components";
import type { FormInstance } from "element-plus"; import type { FormInstance } from "element-plus";
import { $t, transformI18n } from "/@/plugins/i18n";
import { useLayout } from "/@/layout/hooks/useLayout";
import { useUserStoreHook } from "/@/store/modules/user";
import { $t, transformI18n } from "@/plugins/i18n";
import { useLayout } from "@/layout/hooks/useLayout";
import { useUserStoreHook } from "@/store/modules/user";
import { bg, avatar, illustration } from "./utils/static"; import { bg, avatar, illustration } from "./utils/static";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
import { ref, reactive, toRaw, onMounted, onBeforeUnmount } from "vue"; import { ref, reactive, toRaw, onMounted, onBeforeUnmount } from "vue";
import { useTranslationLang } from "/@/layout/hooks/useTranslationLang";
import { useDataThemeChange } from "/@/layout/hooks/useDataThemeChange";
import { useTranslationLang } from "@/layout/hooks/useTranslationLang";
import { useDataThemeChange } from "@/layout/hooks/useDataThemeChange";
import dayIcon from "/@/assets/svg/day.svg?component";
import darkIcon from "/@/assets/svg/dark.svg?component";
import globalization from "/@/assets/svg/globalization.svg?component";
import dayIcon from "@/assets/svg/day.svg?component";
import darkIcon from "@/assets/svg/dark.svg?component";
import globalization from "@/assets/svg/globalization.svg?component";
defineOptions({ defineOptions({
name: "Login" name: "Login"
@ -193,7 +193,7 @@ onBeforeUnmount(() => {
</template> </template>
<style scoped> <style scoped>
@import url("/@/style/login.css");
@import url("@/style/login.css");
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>

2
src/views/login/utils/rule.ts

@ -1,6 +1,6 @@
import { reactive } from "vue"; import { reactive } from "vue";
import type { FormRules } from "element-plus"; import type { FormRules } from "element-plus";
import { $t, transformI18n } from "/@/plugins/i18n";
import { $t, transformI18n } from "@/plugins/i18n";
/** 密码正则(密码格式应为8-18位数字、字母、符号的任意两种组合) */ /** 密码正则(密码格式应为8-18位数字、字母、符号的任意两种组合) */
export const REGEXP_PWD = export const REGEXP_PWD =

6
src/views/login/utils/static.ts

@ -1,5 +1,5 @@
import bg from "/@/assets/login/bg.png";
import avatar from "/@/assets/login/avatar.svg?component";
import illustration from "/@/assets/login/illustration.svg?component";
import bg from "@/assets/login/bg.png";
import avatar from "@/assets/login/avatar.svg?component";
import illustration from "@/assets/login/illustration.svg?component";
export { bg, avatar, illustration }; export { bg, avatar, illustration };

2
src/views/permission/button/index.vue

@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { type CSSProperties, computed } from "vue"; import { type CSSProperties, computed } from "vue";
import { hasAuth, getAuths } from "/@/router/utils";
import { hasAuth, getAuths } from "@/router/utils";
defineOptions({ defineOptions({
name: "PermissionButton" name: "PermissionButton"

6
src/views/permission/page/index.vue

@ -1,8 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
import { initRouter } from "/@/router/utils";
import { initRouter } from "@/router/utils";
import { type CSSProperties, ref, computed } from "vue"; import { type CSSProperties, ref, computed } from "vue";
import { useUserStoreHook } from "/@/store/modules/user";
import { usePermissionStoreHook } from "/@/store/modules/permission";
import { useUserStoreHook } from "@/store/modules/user";
import { usePermissionStoreHook } from "@/store/modules/permission";
defineOptions({ defineOptions({
name: "PermissionPage" name: "PermissionPage"

2
tsconfig.json

@ -20,7 +20,7 @@
"lib": ["dom", "esnext"], "lib": ["dom", "esnext"],
"incremental": true, "incremental": true,
"paths": { "paths": {
"/@/*": ["src/*"],
"@/*": ["src/*"],
"@build/*": ["build/*"], "@build/*": ["build/*"],
"/#/*": ["types/*"] "/#/*": ["types/*"]
}, },

2
vite.config.ts

@ -15,7 +15,7 @@ const pathResolve = (dir: string): string => {
/** 设置别名 */ /** 设置别名 */
const alias: Record<string, string> = { const alias: Record<string, string> = {
"/@": pathResolve("src"),
"@": pathResolve("src"),
"@build": pathResolve("build") "@build": pathResolve("build")
}; };

Loading…
Cancel
Save