From 6664ae8f7bd6ce617137772229a08c4b2e4ef30f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=BC=A0=E9=BE=99?= Date: Sun, 18 Sep 2022 20:05:40 +0800 Subject: [PATCH] refactor: folders --- src/api/index.js | 2 +- src/components/common/AppProvider.vue | 2 +- src/components/icon/TheIcon.vue | 2 +- src/components/query-bar/QueryBarItem.vue | 2 +- src/composables/useCRUD.js | 2 +- src/layout/components/AppMain.vue | 2 +- .../header/components/BreadCrumb.vue | 2 +- .../header/components/MenuCollapse.vue | 2 +- .../header/components/UserAvatar.vue | 4 +- .../sidebar/components/SideLogo.vue | 2 +- .../sidebar/components/SideMenu.vue | 7 +- src/layout/components/tags/ContextMenu.vue | 5 +- src/layout/components/tags/index.vue | 2 +- src/layout/index.vue | 2 +- src/main.js | 3 +- src/router/guard/permission-guard.js | 3 +- src/router/index.js | 6 +- src/store/index.js | 2 + src/store/modules/{app.js => app/index.js} | 0 src/store/modules/index.js | 4 + .../{permission.js => permission/index.js} | 0 src/store/modules/tags/helpers.js | 2 +- src/store/modules/tags/index.js | 2 +- src/store/modules/{user.js => user/index.js} | 3 +- src/styles/{index.scss => global.scss} | 17 ++-- src/styles/reset.css | 5 -- src/utils/{ => auth}/auth.js | 0 src/utils/auth/index.js | 2 + src/utils/{ => auth}/token.js | 2 +- src/utils/common/common.js | 76 ++++++++++++++++++ src/utils/{ => common}/icon.js | 0 src/utils/common/index.js | 4 + src/utils/{ => common}/is.js | 0 src/utils/common/naiveTools.js | 2 +- src/utils/http/helpers.js | 6 +- src/utils/http/index.js | 2 +- src/utils/http/interceptors.js | 3 +- src/utils/index.js | 80 +------------------ src/utils/{cache => storage}/index.js | 0 src/utils/{cache => storage}/storage.js | 2 +- src/views/demo/table/api.js | 2 +- src/views/demo/table/index.vue | 4 +- src/views/login/api.js | 2 +- src/views/login/index.vue | 3 +- src/views/workbench/index.vue | 2 +- 45 files changed, 138 insertions(+), 139 deletions(-) rename src/store/modules/{app.js => app/index.js} (100%) create mode 100644 src/store/modules/index.js rename src/store/modules/{permission.js => permission/index.js} (100%) rename src/store/modules/{user.js => user/index.js} (91%) rename src/styles/{index.scss => global.scss} (87%) rename src/utils/{ => auth}/auth.js (100%) create mode 100644 src/utils/auth/index.js rename src/utils/{ => auth}/token.js (95%) create mode 100644 src/utils/common/common.js rename src/utils/{ => common}/icon.js (100%) create mode 100644 src/utils/common/index.js rename src/utils/{ => common}/is.js (100%) rename src/utils/{cache => storage}/index.js (100%) rename src/utils/{cache => storage}/storage.js (96%) diff --git a/src/api/index.js b/src/api/index.js index bbb9df8..38843fa 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,4 +1,4 @@ -import request from '@/utils/http' +import { request } from '@/utils' export default { getUser: () => request.get('/user'), diff --git a/src/components/common/AppProvider.vue b/src/components/common/AppProvider.vue index 718b0b7..9b7bdc7 100644 --- a/src/components/common/AppProvider.vue +++ b/src/components/common/AppProvider.vue @@ -18,7 +18,7 @@ import { defineComponent, h } from 'vue' import { useLoadingBar, useDialog, useMessage, useNotification } from 'naive-ui' import { useCssVar } from '@vueuse/core' import { kebabCase } from 'lodash-es' -import { setupMessage, setupDialog } from '@/utils/common/naiveTools' +import { setupMessage, setupDialog } from '@/utils' import { naiveThemeOverrides } from '~/settings' function setupCssVar() { diff --git a/src/components/icon/TheIcon.vue b/src/components/icon/TheIcon.vue index adb58c5..62edef1 100644 --- a/src/components/icon/TheIcon.vue +++ b/src/components/icon/TheIcon.vue @@ -1,5 +1,5 @@ diff --git a/src/layout/components/header/components/UserAvatar.vue b/src/layout/components/header/components/UserAvatar.vue index 9a06b2e..a8b7b67 100644 --- a/src/layout/components/header/components/UserAvatar.vue +++ b/src/layout/components/header/components/UserAvatar.vue @@ -8,8 +8,8 @@