Browse Source

721背景

tangjunhao 1 month ago
parent
commit
50d33baaea
3 changed files with 23 additions and 19 deletions
  1. BIN
      src/assets/img/card-body.png
  2. 18 18
      src/router/index.js
  3. 5 1
      src/style/index.css

BIN
src/assets/img/card-body.png


+ 18 - 18
src/router/index.js

@@ -38,26 +38,26 @@ const router = createRouter({
     ],
 })
 //修改动态网页标题 beforeEach 导航钩子,路由改变前触发
-router.beforeEach((to, from, next) => {
-  const token = getToken2(); // 获取 token
+// router.beforeEach((to, from, next) => {
+//   const token = getToken2(); // 获取 token
   
-  // 定义不需要登录的白名单路由
-  const whiteList = ['login', 'register'];
+//   // 定义不需要登录的白名单路由
+//   const whiteList = ['login', 'register'];
   
-  // 如果用户有 token,直接放行
-  if (token) {
-    document.title = to.name || '默认标题'; // 设置页面标题
-    next();
-  } 
-  // 如果没有 token,并且目标页面不在白名单里,跳转到登录页
-  else if (!whiteList.includes(to.name)) {
-    next({ name: 'login' });
-  }
-  else {
-    document.title = to.name || '默认标题';
-    next();
-  }
-});
+//   // 如果用户有 token,直接放行
+//   if (token) {
+//     document.title = to.name || '默认标题'; // 设置页面标题
+//     next();
+//   } 
+//   // 如果没有 token,并且目标页面不在白名单里,跳转到登录页
+//   else if (!whiteList.includes(to.name)) {
+//     next({ name: 'login' });
+//   }
+//   else {
+//     document.title = to.name || '默认标题';
+//     next();
+//   }
+// });
 // afterEach 不需要 next 参数
 router.afterEach(() => {
   window.scrollTo(0, 0); // 页面滚动到顶部

+ 5 - 1
src/style/index.css

@@ -125,6 +125,8 @@ img{
   
   height: 40px;
   background-image: url(@/assets/img/card-header.png);
+  background-size: 100% 100%;
+  background-repeat: no-repeat;
   border-radius: 0px 0px 0px 0px;
   
 }
@@ -133,7 +135,9 @@ img{
   width: 100%;
   height: calc(100% - 40px);
   padding: 5px 5px;
-  background: linear-gradient(to top, #173B77 0%, #132440 100%);
+  background-image: url(@/assets/img/card-body.png);
+  background-size: 100% 100%;
+  background-repeat: no-repeat; 
   border-radius: 0px 0px 0px 0px;
   border: 2px solid rgba(61,115,255,0.3);