Skip to content

Commit

Permalink
fix some already know issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jzfai committed Feb 6, 2023
1 parent e9e2ced commit dd60cd6
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions src/hooks/use-error-log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
}
})
}
}
2 changes: 1 addition & 1 deletion src/layout/app-main/TagsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 5 additions & 2 deletions src/layout/sidebar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
</style>
6 changes: 6 additions & 0 deletions src/permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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') {
Expand Down
4 changes: 2 additions & 2 deletions src/theme/base/custom/ct-css-vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/theme/china-red/custom/ct-css-vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/theme/dark/custom/ct-css-vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/theme/lighting/custom/ct-css-vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit dd60cd6

Please sign in to comment.