Skip to content

Commit

Permalink
fix: 删除一些冗余的旧代码
Browse files Browse the repository at this point in the history
  • Loading branch information
buqiyuan committed Jan 2, 2022
1 parent 7ec9777 commit ddedca2
Show file tree
Hide file tree
Showing 25 changed files with 254 additions and 310 deletions.
10 changes: 5 additions & 5 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# 只在生产模式中被载入
ENV = 'production'

# base api
VUE_APP_BASE_API = 'http://buqiyuan.site:7001/admin/'
VUE_APP_BASE_SOCKET_PATH = '/ws-api'
VUE_APP_BASE_SOCKET_NSP = 'ws://buqiyuan.site:7002/admin'

# 网站前缀
BASE_URL = /vue3-antd-admin/

# base api
VUE_APP_BASE_API = 'https://nest-api.buqiyuan.site/api/admin/'
VUE_APP_BASE_SOCKET_PATH = '/ws-api'
VUE_APP_BASE_SOCKET_NSP = 'wss://nest-api.buqiyuan.site/admin'

# mock api
VUE_APP_MOCK_API = '/mock-api/'

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

- 账号:rootadmin,密码:123456
- [在线预览](http://buqiyuan.gitee.io/vue3-antd-admin/)
- [swagger 文档](http://buqiyuan.site:7001/swagger-api/static/index.html#/)
- [swagger 文档](https://nest-api.buqiyuan.site/swagger-api/static/index.html)
- [后台地址](https://github.com/buqiyuan/nest-admin)
- [react 版 coding](https://github.com/buqiyuan/react-antd-admin)
- [vite 版](https://github.com/buqiyuan/vite-vue3-admin)
Expand Down
18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,24 @@
"dev": "npm run serve",
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"build:test": "vue-cli-service build --mode test",
"build:preview": "npm run build && npx serve -s dist",
"build:prod": "vue-cli-service build --mode production",
"lint": "vue-cli-service lint",
"deploy": "gh-pages -d dist",
"deploy": "npm run build && npx gh-pages -d dist",
"lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock}/**/*.{vue,ts,tsx}\" --fix",
"lint:lint-staged": "lint-staged",
"lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"",
"lint:stylelint": "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
"prepare": "husky install",
"test prod cors": "http-server dist --cors --gzip -P http://29135jo738.zicp.vip",
"test prod gzip": "http-server dist --cors --gzip -c-1"
"test prod cors": "npx http-server dist --cors --gzip -P http://29135jo738.zicp.vip",
"test prod gzip": "npx http-server dist --cors --gzip -c-1"
},
"dependencies": {
"@vueuse/core": "^7.4.3",
"@vueuse/core": "^7.5.1",
"ant-design-vue": "3.0.0-beta.4",
"axios": "^0.24.0",
"core-js": "^3.20.1",
"core-js": "^3.20.2",
"dayjs": "^1.10.7",
"lodash": "^4.17.21",
"mitt": "^3.0.0",
Expand All @@ -37,7 +40,7 @@
"@commitlint/cli": "^16.0.1",
"@commitlint/config-conventional": "^16.0.0",
"@types/lodash": "^4.14.178",
"@types/node": "^17.0.5",
"@types/node": "^17.0.6",
"@types/webpack-env": "^1.16.3",
"@typescript-eslint/eslint-plugin": "^5.8.1",
"@typescript-eslint/parser": "^5.8.1",
Expand All @@ -53,11 +56,10 @@
"babel-plugin-lodash": "^3.3.4",
"commitizen": "^4.2.4",
"compression-webpack-plugin": "^9.2.0",
"eslint": "^8.5.0",
"eslint": "^8.6.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^8.2.0",
"gh-pages": "^3.2.3",
"husky": "^7.0.4",
"less": "^4.1.2",
"less-loader": "10.2.0",
Expand Down
2 changes: 0 additions & 2 deletions src/components/dynamic-table/dynamic-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@
const innerPropsRef = ref<Partial<TableProps>>();
console.log('slots', slots);
const getProps = computed(() => {
return { ...props, ...unref(innerPropsRef) };
});
Expand Down
5 changes: 3 additions & 2 deletions src/components/lockscreen/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<transition name="slide-up">
<LockScreen v-if="isLock && isMouted && $route.name != 'login'" />
<LockScreen v-if="isLock && isMouted && $route.name != LOGIN_NAME" />
</transition>
</template>

Expand All @@ -9,6 +9,7 @@
import { computed, ref, onMounted, onUnmounted } from 'vue';
import { useRoute } from 'vue-router';
import { useLockscreenStore } from '@/store/modules/lockscreen';
import { LOGIN_NAME } from '@/router/constant';
const lockscreenStore = useLockscreenStore();
const route = useRoute();
Expand All @@ -20,7 +21,7 @@
const timekeeping = () => {
clearInterval(timer);
if (route.name == 'login' || isLock.value) return;
if (route.name === LOGIN_NAME || isLock.value) return;
// 设置不锁屏
lockscreenStore.setLock(false);
// 重置锁屏时间
Expand Down
3 changes: 2 additions & 1 deletion src/components/lockscreen/lockscreen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
import { useBattery } from '@/hooks/useBattery';
import { useLockscreenStore } from '@/store/modules/lockscreen';
import { useUserStore } from '@/store/modules/user';
import { LOGIN_NAME } from '@/router/constant';
const lockscreenStore = useLockscreenStore();
const userStore = useUserStore();
Expand Down Expand Up @@ -137,7 +138,7 @@
unLockLogin(false);
lockscreenStore.setLock(false);
router.replace({
path: '/login',
name: LOGIN_NAME,
query: {
redirect: route.fullPath,
},
Expand Down
5 changes: 3 additions & 2 deletions src/layout/header/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<Menu :selectedKeys="[menus[rotueIndex + 1]?.name]">
<template v-for="childItem in routeItem?.children" :key="childItem.name">
<Menu.Item
v-if="!childItem.meta?.hideInMenu"
v-if="!childItem.meta?.hideInMenu && !childItem.meta?.hideInBreadcrumb"
:key="childItem.name"
@click="clickMenuItem(childItem)"
>
Expand Down Expand Up @@ -83,6 +83,7 @@
import { SearchModal } from './components';
import { useUserStore } from '@/store/modules/user';
import { useLockscreenStore } from '@/store/modules/lockscreen';
import { LOGIN_NAME } from '@/router/constant';
defineProps({
collapsed: {
Expand Down Expand Up @@ -172,7 +173,7 @@
// 移除标签页
localStorage.clear();
router.replace({
name: 'login',
name: LOGIN_NAME,
query: {
redirect: route.fullPath,
},
Expand Down
3 changes: 2 additions & 1 deletion src/layout/menu/menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import MenuItem from './menu-item.vue';
import { useUserStore } from '@/store/modules/user';
import { useRoute, useRouter } from 'vue-router';
import { LOGIN_NAME } from '@/router/constant';
const props = defineProps({
collapsed: {
Expand Down Expand Up @@ -68,7 +69,7 @@
watch(
() => currentRoute.fullPath,
() => {
if (currentRoute.name == 'login' || props.collapsed) return;
if (currentRoute.name === LOGIN_NAME || props.collapsed) return;
state.openKeys = getOpenKeys();
const meta = currentRoute.meta;
if (meta?.activeMenu) {
Expand Down
24 changes: 0 additions & 24 deletions src/layout/tabs/components.ts

This file was deleted.

Loading

0 comments on commit ddedca2

Please sign in to comment.