Skip to content

Commit dc5f3b2

Browse files
committed
fix some already know issue
1 parent ea75f41 commit dc5f3b2

File tree

8 files changed

+33
-14
lines changed

8 files changed

+33
-14
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue3-admin-ts",
3-
"version": "2.0.2",
3+
"version": "2.0.5",
44
"license": "MIT",
55
"author": "kuanghua",
66
"packageManager": "pnpm@7.9.0",

src/hooks/use-error-log.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ import bus from '@/utils/bus'
66
//此处不要使用utils下的axios
77
import axiosReq from 'axios'
88
const reqUrl = '/integration-front/errorCollection/insert'
9+
let repeatErrorLogJudge = ''
910
const errorLogReq = (errLog: string) => {
1011
axiosReq({
11-
url: reqUrl,
12+
url: import.meta.env.VITE_APP_BASE_URL+reqUrl,
1213
data: {
1314
pageUrl: window.location.href,
1415
errorLog: errLog,
@@ -26,8 +27,11 @@ export const useErrorLog = () => {
2627
//判断该环境是否需要收集错误日志,由settings配置决定
2728
if (settings.errorLog?.includes(import.meta.env.VITE_APP_ENV)) {
2829
jsErrorCollection({ runtimeError: true, rejectError: true, consoleError: true }, (errLog) => {
29-
//判断是否是reqUrl错误,避免死循环
30-
if (!errLog.includes(reqUrl)) errorLogReq(errLog)
30+
if (!repeatErrorLogJudge || !errLog.includes(repeatErrorLogJudge)) {
31+
errorLogReq(errLog)
32+
//移除重复日志,fix重复提交错误日志,避免造成死循环
33+
repeatErrorLogJudge = errLog.slice(0, 20)
34+
}
3135
})
3236
}
3337
}

src/layout/sidebar/index.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ import Logo from './Logo.vue'
2525
import SidebarItem from './SidebarItem.vue'
2626
import { useBasicStore } from '@/store/basic'
2727
const { settings, allRoutes, sidebar } = storeToRefs(useBasicStore())
28-
const route = useRoute()
28+
const routeInstance = useRoute()
2929
const activeMenu = computed(() => {
30-
const { meta, path } = route
30+
const { meta, path } = routeInstance
3131
// if set path, the sidebar will highlight the path you set
3232
if (meta.activeMenu) {
3333
return meta.activeMenu
@@ -40,4 +40,13 @@ const activeMenu = computed(() => {
4040
.el-menu-vertical {
4141
width: var(--side-bar-width);
4242
}
43+
.reset-menu-style{
44+
border-right: 1px solid var(--side-bar-border-right-color);
45+
}
4346
</style>
47+
48+
49+
<style lang="scss">
50+
51+
</style>
52+

src/permission.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { filterAsyncRouter, progressClose, progressStart } from '@/hooks/use-per
33
import { useBasicStore } from '@/store/basic'
44
import { userInfoReq } from '@/api/user'
55
import { langTitle } from '@/hooks/use-common'
6+
import settings from "@/settings";
67

78
//路由进入前拦截
89
//to:将要进入的页面 vue-router4.0 不推荐使用next()
@@ -11,6 +12,11 @@ router.beforeEach(async (to) => {
1112
progressStart()
1213
document.title = langTitle(to.meta?.title) // i18 page title
1314
const basicStore = useBasicStore()
15+
//not login
16+
if (!settings.isNeedLogin) {
17+
basicStore.setFilterAsyncRoutes([])
18+
return true
19+
}
1420
//1.判断token
1521
if (basicStore.token) {
1622
if (to.path === '/login') {

src/theme/base/custom/ct-css-vars.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ html.base-theme {
2424
--sidebar-logo-height: 32px;
2525
--sidebar-logo-title-color: #fff;
2626
--side-bar-width: 210px;
27-
--side-bar-border-right-color: '#ddd';
27+
--side-bar-border-right-color: #eee;
2828
//TagsView
2929
--tags-view-background: #fff;
30-
--tags-view-border-bottom-color: #d8dce5;
30+
--tags-view-border-bottom: #eee;
3131
--tags-view-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);
3232
--tags-view-item-background: #fff;
3333
--tags-view-item-border-color: #d8dce5;

src/theme/china-red/custom/ct-css-vars.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ html.china-red {
4747
--sidebar-logo-height: 32px;
4848
--sidebar-logo-title-color: #2b2f3a;
4949
--side-bar-width: 210px;
50-
--side-bar-border-right-color: '#ddd';
50+
--side-bar-border-right-color: #eee;
5151
//TagsView
5252
--tags-view-background: #fff;
53-
--tags-view-border-bottom-color: #d8dce5;
53+
--tags-view-border-bottom: #d8dce5;
5454
--tags-view-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);
5555
--tags-view-item-background: #fff;
5656
--tags-view-item-border-color: #d8dce5;

src/theme/dark/custom/ct-css-vars.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ html.dark {
2828
--side-bar-border-right-color: #2b2f3a;
2929
//TagsView
3030
--tags-view-background: #304156;
31-
--tags-view-border-bottom-color: #2b2f3a;
31+
--tags-view-border-bottom: #2b2f3a;
3232
--tags-view-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);
3333
--tags-view-item-background: #fff;
3434
--tags-view-item-border-color: #d8dce5;

src/theme/lighting/custom/ct-css-vars.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ html.lighting-theme {
66
//--el-menu-bg-color: #304156;
77
//--el-menu-hover-bg-color: #263445;
88
//--el-menu-item-height: 56px;
9-
//--el-menu-border-color: none;
9+
--el-menu-border-color: none;
1010
/*layout section*/
1111
//layout
1212
--layout-border-left-color: #ddd;
@@ -24,10 +24,10 @@ html.lighting-theme {
2424
--sidebar-logo-height: 32px;
2525
--sidebar-logo-title-color: #2b2f3a;
2626
--side-bar-width: 210px;
27-
--side-bar-border-right-color: '#ddd';
27+
--side-bar-border-right-color: #eee;
2828
//TagsView
2929
--tags-view-background: #fff;
30-
--tags-view-border-bottom-color: #d8dce5;
30+
--tags-view-border-bottom: #d8dce5;
3131
--tags-view-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);
3232
--tags-view-item-background: #fff;
3333
--tags-view-item-border-color: #d8dce5;

0 commit comments

Comments
 (0)