From ddedca2179f2740affbbd1414bd67fb290784d9a Mon Sep 17 00:00:00 2001 From: bqy_fe <1743369777@qq.com> Date: Sun, 2 Jan 2022 18:27:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E5=86=97=E4=BD=99=E7=9A=84=E6=97=A7=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.production | 10 +- README.md | 2 +- package.json | 18 ++- .../dynamic-table/dynamic-table.vue | 2 - src/components/lockscreen/index.vue | 5 +- src/components/lockscreen/lockscreen.vue | 3 +- src/layout/header/index.vue | 5 +- src/layout/menu/menu.vue | 3 +- src/layout/tabs/components.ts | 24 --- src/layout/tabs/tabs-view.vue | 88 ++++------- src/router/constant.ts | 10 +- src/router/generator-router.tsx | 20 +-- src/router/index.ts | 11 +- src/router/outsideLayout.ts | 16 ++ src/router/router-guards.ts | 11 +- src/router/staticModules/besidesLayout.ts | 75 +++++---- src/router/staticModules/error.ts | 11 +- src/store/modules/tabsView.ts | 42 ++++- src/utils/request.ts | 8 +- src/views/shared/redirect/index.vue | 22 --- tsconfig.json | 3 +- types/shims/shims-vue.d.ts | 8 +- types/vue-router.d.ts | 4 + vue.config.js | 16 +- yarn.lock | 147 +++++------------- 25 files changed, 254 insertions(+), 310 deletions(-) delete mode 100644 src/layout/tabs/components.ts create mode 100644 src/router/outsideLayout.ts delete mode 100644 src/views/shared/redirect/index.vue diff --git a/.env.production b/.env.production index ed85a0735..f529d6fd4 100644 --- a/.env.production +++ b/.env.production @@ -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/' diff --git a/README.md b/README.md index f514c732a..9ad8d7ff1 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/package.json b/package.json index a7600b572..cfebc7320 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", @@ -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", diff --git a/src/components/dynamic-table/dynamic-table.vue b/src/components/dynamic-table/dynamic-table.vue index 7bb1403a6..c3ca236b0 100644 --- a/src/components/dynamic-table/dynamic-table.vue +++ b/src/components/dynamic-table/dynamic-table.vue @@ -96,8 +96,6 @@ const innerPropsRef = ref>(); - console.log('slots', slots); - const getProps = computed(() => { return { ...props, ...unref(innerPropsRef) }; }); diff --git a/src/components/lockscreen/index.vue b/src/components/lockscreen/index.vue index 39b6a0021..90d071903 100644 --- a/src/components/lockscreen/index.vue +++ b/src/components/lockscreen/index.vue @@ -1,6 +1,6 @@ @@ -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(); @@ -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); // 重置锁屏时间 diff --git a/src/components/lockscreen/lockscreen.vue b/src/components/lockscreen/lockscreen.vue index ac947115e..eb5702c69 100644 --- a/src/components/lockscreen/lockscreen.vue +++ b/src/components/lockscreen/lockscreen.vue @@ -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(); @@ -137,7 +138,7 @@ unLockLogin(false); lockscreenStore.setLock(false); router.replace({ - path: '/login', + name: LOGIN_NAME, query: { redirect: route.fullPath, }, diff --git a/src/layout/header/index.vue b/src/layout/header/index.vue index 9aa84f18d..dbe088e0e 100644 --- a/src/layout/header/index.vue +++ b/src/layout/header/index.vue @@ -12,7 +12,7 @@