Skip to content

Commit

Permalink
refactor(projects): all file and folder use kebab-case
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Mar 6, 2023
1 parent bf2f617 commit cea600f
Show file tree
Hide file tree
Showing 138 changed files with 130 additions and 155 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script setup lang="ts">
import WebSiteLink from './WebSiteLink.vue';
import WebSiteLink from './web-site-link.vue';
defineOptions({ name: 'GithubLink' });
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/composables/icon.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { h } from 'vue';
import SvgIcon from '@/components/custom/SvgIcon.vue';
import SvgIcon from '~/src/components/custom/svg-icon.vue';

/**
* 图标渲染
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/business/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import useCountDown from './useCountDown';
import useSmsCode from './useSmsCode';
import useImageVerify from './useImageVerify';
import useCountDown from './use-count-down';
import useSmsCode from './use-sms-code';
import useImageVerify from './use-image-verify';

export { useCountDown, useSmsCode, useImageVerify };
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { computed } from 'vue';
import { REGEXP_PHONE } from '@/config';
import { fetchSmsCode } from '@/service';
import { useLoading } from '../common';
import useCountDown from './useCountDown';
import useCountDown from './use-count-down';

export default function useSmsCode() {
const { loading, startLoading, endLoading } = useLoading();
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions src/hooks/common/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import useContext from './useContext';
import useBoolean from './useBoolean';
import useLoading from './useLoading';
import useLoadingEmpty from './useLoadingEmpty';
import useReload from './useReload';
import useContext from './use-context';
import useBoolean from './use-boolean';
import useLoading from './use-loading';
import useLoadingEmpty from './use-loading-empty';
import useReload from './use-reload';

export { useContext, useBoolean, useLoading, useLoadingEmpty, useReload };
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import useBoolean from './useBoolean';
import useBoolean from './use-boolean';

export default function useLoadingEmpty(initLoading = false, initEmpty = false) {
const { bool: loading, setTrue: startLoading, setFalse: endLoading } = useBoolean(initLoading);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import useBoolean from './useBoolean';
import useBoolean from './use-boolean';

export default function useLoading(initValue = false) {
const { bool: loading, setTrue: startLoading, setFalse: endLoading } = useBoolean(initValue);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { nextTick } from 'vue';
import useBoolean from './useBoolean';
import useBoolean from './use-boolean';

/** 重载 */
export default function useReload() {
Expand Down
File renamed without changes.
File renamed without changes.
21 changes: 0 additions & 21 deletions src/layouts/common/GlobalHeader/components/index.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/layouts/common/GlobalSearch/components/index.ts

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions src/layouts/common/GlobalSider/components/index.ts

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions src/layouts/common/GlobalTab/components/index.ts

This file was deleted.

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions src/layouts/common/SettingDrawer/components/index.ts

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions src/layouts/common/global-header/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import MenuCollapse from './menu-collapse.vue';
import GlobalBreadcrumb from './global-breadcrumb.vue';
import HeaderMenu from './header-menu.vue';
import GithubSite from './github-site.vue';
import FullScreen from './full-screen.vue';
import ThemeMode from './theme-mode.vue';
import UserAvatar from './user-avatar.vue';
import SystemMessage from './system-message.vue';
import SettingButton from './setting-button.vue';

export {
MenuCollapse,
GlobalBreadcrumb,
HeaderMenu,
GithubSite,
FullScreen,
ThemeMode,
UserAvatar,
SystemMessage,
SettingButton
};
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import { computed, ref } from 'vue';
import { useThemeStore } from '@/store';
import { useBasicLayout } from '@/composables';
import { useBoolean } from '@/hooks';
import MessageList from './MessageList.vue';
import MessageList from './message-list.vue';
defineOptions({ name: 'SystemMessage' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<script setup lang="ts">
import { useThemeStore } from '@/store';
import { useBasicLayout } from '@/composables';
import GlobalLogo from '../GlobalLogo/index.vue';
import GlobalSearch from '../GlobalSearch/index.vue';
import GlobalLogo from '../global-logo/index.vue';
import GlobalSearch from '../global-search/index.vue';
import {
FullScreen,
GithubSite,
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions src/layouts/common/global-search/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import SearchModal from './search-modal.vue';

export { SearchModal };
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import { useRouter } from 'vue-router';
import { onKeyStroke, useDebounceFn } from '@vueuse/core';
import { useRouteStore } from '@/store';
import { useBasicLayout } from '@/composables';
import SearchResult from './SearchResult.vue';
import SearchFooter from './SearchFooter.vue';
import SearchResult from './search-result.vue';
import SearchFooter from './search-footer.vue';
defineOptions({ name: 'SearchModal' });
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions src/layouts/common/global-sider/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import VerticalSider from './vertical-sider/index.vue';
import VerticalMixSider from './vertical-mix-sider/index.vue';

export { VerticalSider, VerticalMixSider };
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import MixMenuDetail from './mix-menu-detail.vue';
import MixMenuDrawer from './mix-menu-drawer.vue';
import MixMenuCollapse from './mix-menu-collapse.vue';

export { MixMenuDetail, MixMenuDrawer, MixMenuCollapse };
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import VerticalMenu from './vertical-menu.vue';

export { VerticalMenu };
File renamed without changes.
4 changes: 4 additions & 0 deletions src/layouts/common/global-tab/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import TabDetail from './tab-detail/index.vue';
import ReloadButton from './reload-button/index.vue';

export { TabDetail, ReloadButton };
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ContextMenu from './context-menu.vue';

export { ContextMenu };
File renamed without changes.
16 changes: 8 additions & 8 deletions src/layouts/common/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import SettingDrawer from './SettingDrawer/index.vue';
import GlobalHeader from './GlobalHeader/index.vue';
import GlobalTab from './GlobalTab/index.vue';
import GlobalSider from './GlobalSider/index.vue';
import GlobalContent from './GlobalContent/index.vue';
import GlobalFooter from './GlobalFooter/index.vue';
import GlobalLogo from './GlobalLogo/index.vue';
import GlobalBackTop from './GlobalBackTop/index.vue';
import SettingDrawer from './setting-drawer/index.vue';
import GlobalHeader from './global-header/index.vue';
import GlobalTab from './global-tab/index.vue';
import GlobalSider from './global-sider/index.vue';
import GlobalContent from './global-content/index.vue';
import GlobalFooter from './global-footer/index.vue';
import GlobalLogo from './global-logo/index.vue';
import GlobalBackTop from './global-back-top/index.vue';

export { SettingDrawer, GlobalHeader, GlobalTab, GlobalSider, GlobalContent, GlobalFooter, GlobalLogo, GlobalBackTop };
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<script lang="ts" setup>
import { useThemeStore } from '@/store';
import SettingMenu from '../SettingMenu/index.vue';
import SettingMenu from '../setting-menu/index.vue';
defineOptions({ name: 'DarkMode' });
Expand Down
9 changes: 9 additions & 0 deletions src/layouts/common/setting-drawer/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import DrawerButton from './drawer-button/index.vue';
import DarkMode from './dark-mode/index.vue';
import LayoutMode from './layout-mode/index.vue';
import ThemeColorSelect from './theme-color-select/index.vue';
import PageFunc from './page-func/index.vue';
import PageView from './page-view/index.vue';
import ThemeConfig from './theme-config/index.vue';

export { DrawerButton, DarkMode, LayoutMode, ThemeColorSelect, PageFunc, PageView, ThemeConfig };
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import LayoutCheckbox from './layout-checkbox.vue';

export { LayoutCheckbox };
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

<script lang="ts" setup>
import { useThemeStore } from '@/store';
import SettingMenu from '../SettingMenu/index.vue';
import SettingMenu from '../setting-menu/index.vue';
defineOptions({ name: 'PageFunc' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

<script lang="ts" setup>
import { useThemeStore } from '@/store';
import SettingMenu from '../SettingMenu/index.vue';
import SettingMenu from '../setting-menu/index.vue';
defineOptions({ name: 'PageView' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<script setup lang="ts">
import { traditionColors } from '@/settings';
import { useThemeStore } from '@/store';
import ColorCheckbox from './ColorCheckbox.vue';
import ColorCheckbox from './color-checkbox.vue';
defineOptions({ name: 'ColorModal' });
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import ColorCheckbox from './color-checkbox.vue';
import ColorModal from './color-modal.vue';

export { ColorCheckbox, ColorModal };
File renamed without changes.
4 changes: 2 additions & 2 deletions src/layouts/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const BasicLayout = () => import('./BasicLayout/index.vue');
const BlankLayout = () => import('./BlankLayout/index.vue');
const BasicLayout = () => import('./basic-layout/index.vue');
const BlankLayout = () => import('./blank-layout/index.vue');

export { BasicLayout, BlankLayout };
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createApp } from 'vue';
import App from './App.vue';
import AppLoading from './components/common/AppLoading.vue';
import AppLoading from './components/common/app-loading.vue';
import { setupDirectives } from './directives';
import { setupRouter } from './router';
import { setupAssets } from './plugins';
Expand Down
1 change: 1 addition & 0 deletions src/store/modules/theme/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export function initThemeSettings() {
const isProd = import.meta.env.PROD;
// 生产环境才缓存主题配置,本地开发实时调整配置更改配置的json
const storageSettings = localStg.get('themeSettings');

if (isProd && storageSettings) {
return storageSettings;
}
Expand Down
26 changes: 0 additions & 26 deletions src/utils/storage/session.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,5 @@
import { decrypto, encrypto } from '../crypto';

export function setSession(key: string, value: unknown) {
const json = encrypto(value);
sessionStorage.setItem(key, json);
}

export function getSession<T>(key: string) {
const json = sessionStorage.getItem(key);
let data: T | null = null;
if (json) {
try {
data = decrypto(json);
} catch {
// 防止解析失败
}
}
return data;
}

export function removeSession(key: string) {
window.sessionStorage.removeItem(key);
}

export function clearSession() {
window.sessionStorage.clear();
}

function createSessionStorage<T extends StorageInterface.Session = StorageInterface.Session>() {
function set<K extends keyof T>(key: K, value: T[K]) {
const json = encrypto(value);
Expand Down

This file was deleted.

This file was deleted.

12 changes: 6 additions & 6 deletions src/views/_builtin/login/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import LoginBg from './LoginBg/index.vue';
import PwdLogin from './PwdLogin/index.vue';
import CodeLogin from './CodeLogin/index.vue';
import Register from './Register/index.vue';
import ResetPwd from './ResetPwd/index.vue';
import BindWechat from './BindWechat/index.vue';
import LoginBg from './login-bg/index.vue';
import PwdLogin from './pwd-login/index.vue';
import CodeLogin from './code-login/index.vue';
import Register from './register-user/index.vue';
import ResetPwd from './reset-pwd/index.vue';
import BindWechat from './bind-wechat/index.vue';

export { LoginBg, PwdLogin, CodeLogin, Register, ResetPwd, BindWechat };
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import CornerTop from './corner-top.vue';
import CornerBottom from './corner-bottom.vue';

export { CornerTop, CornerBottom };
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import OtherLogin from './other-login.vue';
import OtherAccount from './other-account.vue';

export { OtherLogin, OtherAccount };
8 changes: 4 additions & 4 deletions src/views/about/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ProjectIntroduction from './ProjectIntroduction.vue';
import ProjectInfo from './ProjectInfo.vue';
import ProDependency from './ProDependency.vue';
import DevDependency from './DevDependency.vue';
import ProjectIntroduction from './project-introduction.vue';
import ProjectInfo from './project-info.vue';
import ProDependency from './pro-dependency.vue';
import DevDependency from './dev-dependency.vue';

export { ProjectIntroduction, ProjectInfo, ProDependency, DevDependency };
File renamed without changes.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import GradientBg from './gradient-bg.vue';

export { GradientBg };
Loading

0 comments on commit cea600f

Please sign in to comment.