diff --git a/README.md b/README.md index ffef565..6ae09e7 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ The framework is available in js,ts, plus and electron versions - ts version:[vue3-element-ts](https://github.com/jzfai/vue3-admin-ts.git) - ts version for plus:[vue3-element-plus](https://github.com/jzfai/vue3-admin-plus.git) - ts version for electron:[vue3-element-electron](https://github.com/jzfai/vue3-admin-electron.git) -- java Micro-service background data:[micro-service-plus](https://github.com/jzfai/micro-service-plus) +- java Micro-service background data:[micro-service-single](https://github.com/jzfai/micro-service-single) ## Build Setup diff --git a/src/hooks/use-error-log.ts b/src/hooks/use-error-log.ts index 3bd9f7d..ef5cd99 100644 --- a/src/hooks/use-error-log.ts +++ b/src/hooks/use-error-log.ts @@ -3,11 +3,13 @@ import { jsErrorCollection } from 'js-error-collection' import pack from '../../package.json' import settings from '@/settings' import bus from '@/utils/bus' +//此处不要使用utils下的axios import axiosReq from 'axios' const reqUrl = '/integration-front/errorCollection/insert' +let repeatErrorLogJudge = '' const errorLogReq = (errLog: string) => { axiosReq({ - url: reqUrl, + url: import.meta.env.VITE_APP_BASE_URL+reqUrl, data: { pageUrl: window.location.href, errorLog: errLog, @@ -25,8 +27,11 @@ export const useErrorLog = () => { //判断该环境是否需要收集错误日志,由settings配置决定 if (settings.errorLog?.includes(import.meta.env.VITE_APP_ENV)) { jsErrorCollection({ runtimeError: true, rejectError: true, consoleError: true }, (errLog) => { - //判断是否是reqUrl错误,避免死循环 - if (!errLog.includes(reqUrl)) errorLogReq(errLog) + if (!repeatErrorLogJudge || !errLog.includes(repeatErrorLogJudge)) { + errorLogReq(errLog) + //移除重复日志,fix重复提交错误日志,避免造成死循环 + repeatErrorLogJudge = errLog.slice(0, 20) + } }) } } diff --git a/src/layout/app-main/TagsView.vue b/src/layout/app-main/TagsView.vue index b6ddfe3..ec24927 100644 --- a/src/layout/app-main/TagsView.vue +++ b/src/layout/app-main/TagsView.vue @@ -219,7 +219,7 @@ const { visible, top, left, selectedTag } = toRefs(state) height: var(--tag-view-height); width: 100%; background: var(--tags-view-background); - border-bottom: 1px solid var(--tags-view-border-bottom-color); + border-bottom: 1px solid var(--tags-view-border-bottom); box-shadow: var(--tags-view-box-shadow); .tags-view-wrapper { .tags-view-item { diff --git a/src/layout/sidebar/index.vue b/src/layout/sidebar/index.vue index 318d4bf..7eebb3f 100644 --- a/src/layout/sidebar/index.vue +++ b/src/layout/sidebar/index.vue @@ -25,9 +25,9 @@ import Logo from './Logo.vue' import SidebarItem from './SidebarItem.vue' import { useBasicStore } from '@/store/basic' const { settings, allRoutes, sidebar } = storeToRefs(useBasicStore()) -const route = useRoute() +const routeInstance = useRoute() const activeMenu = computed(() => { - const { meta, path } = route + const { meta, path } = routeInstance // if set path, the sidebar will highlight the path you set if (meta.activeMenu) { return meta.activeMenu @@ -40,4 +40,7 @@ const activeMenu = computed(() => { .el-menu-vertical { width: var(--side-bar-width); } +.reset-menu-style{ + border-right: 1px solid var(--side-bar-border-right-color); +} diff --git a/src/permission.ts b/src/permission.ts index a2f7bb3..9e65ed2 100644 --- a/src/permission.ts +++ b/src/permission.ts @@ -3,6 +3,7 @@ import { filterAsyncRouter, progressClose, progressStart } from '@/hooks/use-per import { useBasicStore } from '@/store/basic' import { userInfoReq } from '@/api/user' import { langTitle } from '@/hooks/use-common' +import settings from "@/settings"; //路由进入前拦截 //to:将要进入的页面 vue-router4.0 不推荐使用next() @@ -11,6 +12,11 @@ router.beforeEach(async (to) => { progressStart() document.title = langTitle(to.meta?.title) // i18 page title const basicStore = useBasicStore() + //not login + if (!settings.isNeedLogin) { + basicStore.setFilterAsyncRoutes([]) + return true + } //1.判断token if (basicStore.token) { if (to.path === '/login') { diff --git a/src/theme/base/custom/ct-css-vars.scss b/src/theme/base/custom/ct-css-vars.scss index c97b647..cc4a49b 100644 --- a/src/theme/base/custom/ct-css-vars.scss +++ b/src/theme/base/custom/ct-css-vars.scss @@ -24,10 +24,10 @@ html.base-theme { --sidebar-logo-height: 32px; --sidebar-logo-title-color: #fff; --side-bar-width: 210px; - --side-bar-border-right-color: '#ddd'; + --side-bar-border-right-color: #eee; //TagsView --tags-view-background: #fff; - --tags-view-border-bottom-color: #d8dce5; + --tags-view-border-bottom: #eee; --tags-view-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04); --tags-view-item-background: #fff; --tags-view-item-border-color: #d8dce5; diff --git a/src/theme/china-red/custom/ct-css-vars.scss b/src/theme/china-red/custom/ct-css-vars.scss index 17f6c47..52ad8f2 100644 --- a/src/theme/china-red/custom/ct-css-vars.scss +++ b/src/theme/china-red/custom/ct-css-vars.scss @@ -47,10 +47,10 @@ html.china-red { --sidebar-logo-height: 32px; --sidebar-logo-title-color: #2b2f3a; --side-bar-width: 210px; - --side-bar-border-right-color: '#ddd'; + --side-bar-border-right-color: #eee; //TagsView --tags-view-background: #fff; - --tags-view-border-bottom-color: #d8dce5; + --tags-view-border-bottom: #d8dce5; --tags-view-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04); --tags-view-item-background: #fff; --tags-view-item-border-color: #d8dce5; diff --git a/src/theme/dark/custom/ct-css-vars.scss b/src/theme/dark/custom/ct-css-vars.scss index 772b972..44fd437 100644 --- a/src/theme/dark/custom/ct-css-vars.scss +++ b/src/theme/dark/custom/ct-css-vars.scss @@ -28,7 +28,7 @@ html.dark { --side-bar-border-right-color: #2b2f3a; //TagsView --tags-view-background: #304156; - --tags-view-border-bottom-color: #2b2f3a; + --tags-view-border-bottom: #2b2f3a; --tags-view-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04); --tags-view-item-background: #fff; --tags-view-item-border-color: #d8dce5; diff --git a/src/theme/lighting/custom/ct-css-vars.scss b/src/theme/lighting/custom/ct-css-vars.scss index 7aad9d4..1bbba78 100644 --- a/src/theme/lighting/custom/ct-css-vars.scss +++ b/src/theme/lighting/custom/ct-css-vars.scss @@ -6,7 +6,7 @@ html.lighting-theme { //--el-menu-bg-color: #304156; //--el-menu-hover-bg-color: #263445; //--el-menu-item-height: 56px; - //--el-menu-border-color: none; + --el-menu-border-color: none; /*layout section*/ //layout --layout-border-left-color: #ddd; @@ -24,10 +24,10 @@ html.lighting-theme { --sidebar-logo-height: 32px; --sidebar-logo-title-color: #2b2f3a; --side-bar-width: 210px; - --side-bar-border-right-color: '#ddd'; + --side-bar-border-right-color: #eee; //TagsView --tags-view-background: #fff; - --tags-view-border-bottom-color: #d8dce5; + --tags-view-border-bottom: #d8dce5; --tags-view-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04); --tags-view-item-background: #fff; --tags-view-item-border-color: #d8dce5;