jinx hace 2 meses
padre
commit
3ab4cbd8fb

+ 3 - 3
src/components/Header/index.vue

@@ -8,7 +8,7 @@
         @click="router.push('/home')"
       >
         <div class="logo">
-          <img src="@/assets/pc/images/logo.png" alt="" />
+          <img src="@/assets/pc/images/logo.png" />
         </div>
 
         <div class="text">韩山师范学院文献数字化平台</div>
@@ -16,7 +16,7 @@
 
       <div class="normal-left" v-else>
         <div class="back" @click="handleBack">
-          <img src="@/assets/pc/images/back.png" alt="" />
+          <img src="@/assets/pc/images/back.png" />
         </div>
         <div class="read-msg" v-if="formDefInfo">
           <p class="title">{{ formDefInfo.name }}</p>
@@ -47,7 +47,7 @@
               src="@/assets/pc/images/ID.png"
               alt=""
             />
-            <img v-else :src="getThumb(userInfo.thumb)" alt="" />
+            <img v-else :src="getThumb(userInfo.thumb)" />
           </div>
           <span class="name">{{ userInfo.realName }}</span>
         </div>

+ 4 - 3
src/main.js

@@ -12,6 +12,7 @@ import store from "./store";
 import "./style.css";
 let router = browser.isMobile() ? routerM : routerP;
 let App = browser.isMobile() ? Mobile : Pc;
-setCurrentRouter(router);
-createApp(App).use(store).use(router).use(ElementPlus).mount("#app");
-// createApp(Pc).use(store).use(routerP).use(ElementPlus).mount("#app");
+// setCurrentRouter(router);
+// createApp(App).use(store).use(router).use(ElementPlus).mount("#app");
+setCurrentRouter(routerP);
+createApp(Pc).use(store).use(routerP).use(ElementPlus).mount("#app");

+ 26 - 21
src/router/index.js

@@ -206,31 +206,36 @@ router.beforeEach(async (to) => {
       return true;
     }
 
-    if (!hasUserInfo && token) {
-      try {
-        const res = await userDetail();
-        if (res?.data) {
-          store.commit("setStore", { userInfo: res.data });
-          return { name: "home" };
-        }
-      } catch {
-        localStorage.removeItem("token");
-        return true;
-      }
-    }
+    // if (!hasUserInfo && token) {
+    //   try {
+    //     const res = await userDetail();
+    //     if (res?.data) {
+    //       store.commit("setStore", { userInfo: res.data });
+    //       return { name: "home" };
+    //     }
+    //   } catch {
+    //     localStorage.removeItem("token");
+    //     return true;
+    //   }
+    // }
 
     return { name: "home" };
-  }
-  if (token && !hasUserInfo) {
-    try {
-      const res = await userDetail();
-      if (res?.data) {
-        store.commit("setStore", { userInfo: res.data });
-      }
-    } catch {
-      localStorage.removeItem("token");
+  } else {
+    const res = await userDetail();
+    if (res?.data) {
+      store.commit("setStore", { userInfo: res.data });
     }
   }
+  // if (token && !hasUserInfo) {
+  //   try {
+  //     const res = await userDetail();
+  //     if (res?.data) {
+  //       store.commit("setStore", { userInfo: res.data });
+  //     }
+  //   } catch {
+  //     localStorage.removeItem("token");
+  //   }
+  // }
 
   return true;
 });

+ 1 - 1
src/views/mobile/MhomeSearch.vue

@@ -11,7 +11,7 @@
               @keyup.enter="submitSearch"
             />
             <button type="button" class="search-btn" @click="submitSearch">
-              <img :src="searchIcon" alt="搜索" />
+              <img :src="searchIcon" />
             </button>
           </div>
 

+ 3 - 3
src/views/mobile/Mlogin.vue

@@ -11,7 +11,7 @@
 
         <div class="form-card">
           <label class="form-item">
-            <img :src="userIcon" alt="用户名" />
+            <img :src="userIcon" />
             <input
               v-model="form.username"
               type="text"
@@ -21,7 +21,7 @@
           </label>
 
           <label class="form-item">
-            <img :src="passIcon" alt="密码" />
+            <img :src="passIcon" />
             <input
               v-model="form.password"
               type="password"
@@ -36,7 +36,7 @@
             :disabled="loading"
             @click="handleLogin"
           >
-            <img :src="loginIcon" alt="登录" />
+            <img :src="loginIcon" />
             <span>{{ loading ? "登录中..." : "登录" }}</span>
           </button>
         </div>

+ 3 - 3
src/views/mobile/Mmine.vue

@@ -10,7 +10,7 @@
                 :src="getThumb(userInfo.thumb)"
                 alt="用户头像"
               />
-              <img v-else :src="currentAvatar" alt="用户头像" />
+              <img v-else :src="currentAvatar" />
             </div>
 
             <button
@@ -135,7 +135,7 @@
       <div class="avatar-dialog-body">
         <div class="upload-preview-panel">
           <div class="upload-preview-box">
-            <img :src="tempAvatar" alt="头像预览" />
+            <img :src="tempAvatar" />
           </div>
 
           <button type="button" class="reupload-btn" @click="triggerFilePick">
@@ -145,7 +145,7 @@
 
         <div class="avatar-side-info">
           <div class="circle-preview">
-            <img :src="tempAvatar" alt="头像预览" />
+            <img :src="tempAvatar" />
           </div>
 
           <p class="preview-title">头像预览</p>

+ 1 - 1
src/views/mobile/MresourceLibraryView.vue

@@ -11,7 +11,7 @@
               @keyup.enter="submitSearch"
             />
             <button type="button" class="search-btn" @click="submitSearch">
-              <img :src="searchIcon" alt="搜索" />
+              <img :src="searchIcon" />
             </button>
           </div>
 

+ 2 - 2
src/views/mobile/components/FileReader/epub.vue

@@ -58,7 +58,7 @@
         :disabled="!epubReady"
         @click="prevPage"
       >
-        <img :src="arrowIcon" alt="上一页" />
+        <img :src="arrowIcon" />
       </button>
 
       <div class="reader-stage">
@@ -72,7 +72,7 @@
         :disabled="!epubReady"
         @click="nextPage"
       >
-        <img :src="arrowIcon" alt="下一页" />
+        <img :src="arrowIcon" />
       </button>
     </section>
   </div>

+ 6 - 6
src/views/mobile/components/FileReader/image.vue

@@ -2,34 +2,34 @@
   <div class="image-view">
     <div ref="viewerRef" class="image-viewer" @dblclick="resetView">
       <div ref="canvasRef" class="image-canvas">
-        <img class="image-content" :src="currentImage" alt="图片预览" />
+        <img class="image-content" :src="currentImage" />
       </div>
     </div>
 
     <div class="image-toolbar">
       <button class="toolbar-btn icon-btn" type="button" @click="prevPage">
-        <img :src="prevIcon" alt="上一页" />
+        <img :src="prevIcon" />
       </button>
       <span class="toolbar-text page-text">
         {{ currentIndex + 1 }}/{{ imageList.length }}
       </span>
       <button class="toolbar-btn icon-btn" type="button" @click="nextPage">
-        <img :src="nextIcon" alt="下一页" />
+        <img :src="nextIcon" />
       </button>
       <span class="divider"></span>
       <button class="toolbar-btn icon-btn" type="button" @click="zoomOut">
-        <img :src="zoomOutIcon" alt="缩小" />
+        <img :src="zoomOutIcon" />
       </button>
       <span class="toolbar-text scale-text">{{ zoomPercent }}%</span>
       <button class="toolbar-btn icon-btn" type="button" @click="zoomIn">
-        <img :src="zoomInIcon" alt="放大" />
+        <img :src="zoomInIcon" />
       </button>
       <button
         class="toolbar-btn icon-btn"
         type="button"
         @click="toggleFullscreen"
       >
-        <img :src="fullscreenIcon" alt="全屏" />
+        <img :src="fullscreenIcon" />
       </button>
     </div>
   </div>

+ 2 - 2
src/views/pc/DeepSearch.vue

@@ -76,7 +76,7 @@
                 type="button"
                 @click="addCondition"
               >
-                <img src="@/assets/pc/images/jia.png" alt="添加" />
+                <img src="@/assets/pc/images/jia.png" />
               </button>
               <button
                 v-if="shouldShowMinus(index)"
@@ -84,7 +84,7 @@
                 type="button"
                 @click="removeCondition(index)"
               >
-                <img src="@/assets/pc/images/jian.png" alt="删除" />
+                <img src="@/assets/pc/images/jian.png" />
               </button>
             </div>
           </div>

+ 2 - 2
src/views/pc/HomeView.vue

@@ -26,7 +26,7 @@
           type="button"
           @click="slidePrev"
         >
-          <img :src="arrowIcon" alt="上一张" />
+          <img :src="arrowIcon" />
         </button>
 
         <Swiper
@@ -56,7 +56,7 @@
           type="button"
           @click="slideNext"
         >
-          <img :src="arrowIcon" alt="下一张" />
+          <img :src="arrowIcon" />
         </button>
       </div>
 

+ 4 - 4
src/views/pc/LoginView.vue

@@ -77,7 +77,7 @@ const handleLogin = async () => {
         :style="{ backgroundImage: `url(${cardBg})` }"
       >
         <div class="login-brand">
-          <img class="login-brand-text" :src="textLogo" alt="韩山师范学院" />
+          <img class="login-brand-text" :src="textLogo" />
         </div>
       </div>
 
@@ -86,7 +86,7 @@ const handleLogin = async () => {
           <h2>韩山师范学院文献数字化平台</h2>
 
           <div class="login-field">
-            <img :src="userIcon" alt="" />
+            <img :src="userIcon" />
             <input
               v-model="form.username"
               type="text"
@@ -96,7 +96,7 @@ const handleLogin = async () => {
           </div>
 
           <div class="login-field">
-            <img :src="passIcon" alt="" />
+            <img :src="passIcon" />
             <input
               v-model="form.password"
               type="password"
@@ -111,7 +111,7 @@ const handleLogin = async () => {
             :disabled="loading"
             @click="handleLogin"
           >
-            <img :src="loginButtonIcon" alt="" />
+            <img :src="loginButtonIcon" />
             <span>{{ loading ? "登录中..." : "登录" }}</span>
           </button>
         </div>

+ 1 - 1
src/views/pc/MineView.vue

@@ -109,7 +109,7 @@
 
         <div class="avatar-side-info">
           <div class="circle-preview">
-            <img :src="tempAvatar" alt="头像预览" />
+            <img :src="tempAvatar" />
           </div>
 
           <p class="preview-title">头像预览</p>

+ 2 - 2
src/views/pc/ResourceDetailView.vue

@@ -5,7 +5,7 @@
     <div class="detail-top" v-if="info">
       <div class="detail-cover">
         <div class="cover-frame">
-          <img :src="getThumb(info.thumb)" alt="封面" />
+          <img :src="getThumb(info.thumb)" />
         </div>
         <div class="bottom-box">
           <template v-for="i in fileTypes">
@@ -64,7 +64,7 @@
           @click="goRelatedDetail(item)"
         >
           <div class="related-cover">
-            <img :src="getThumb(item.thumb)" alt="关联资源封面" />
+            <img :src="getThumb(item.thumb)" />
           </div>
           <h3>{{ item.name }}</h3>
           <p>{{ item.create_by }}</p>