DESKTOP-25GEPB2\Mr-Gao %!s(int64=2) %!d(string=hai) anos
pai
achega
c88ec73da0
Modificáronse 2 ficheiros con 9 adicións e 7 borrados
  1. 1 0
      .gitignore
  2. 8 7
      src/views/bookManage/index.vue

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+node_modules

+ 8 - 7
src/views/bookManage/index.vue

@@ -119,8 +119,8 @@
             <a-popconfirm title="确定删除该资源?" @confirm="deleteRecord(record)">
               <a>删除</a>
             </a-popconfirm>
-            <div class="read_txt" @click="readPdf(record.uploadFile)">
-              {{ isRead(record.uploadFile) }}
+            <div class="read_txt" @click="readPdf(record.linkAddress)">
+              {{ isRead(record.fileType) }}
             </div>
             <a-button type="link" @click="auditBook(record)">审核</a-button>
           </a-space>
@@ -493,11 +493,11 @@ const cuerrchange = (page) => {
 };
 const isRead = (file) => {
   if (file) {
-    var index = file.lastIndexOf('.');
-    //获取后缀
-    var ext = file.substr(index + 1);
-    console.log(ext);
-    if (ext == 'pdf' || ext == 'PDF') {
+    // var index = file.lastIndexOf('.');
+    // //获取后缀
+    // var ext = file.substr(index + 1);
+    // console.log(ext);
+    if (file == 'pdf' || file == 'PDF') {
       return '立即阅读';
     } else {
       return '立即下载';
@@ -509,6 +509,7 @@ const isRead = (file) => {
 
 const readPdf = (file) => {
   window.open(file);
+  console.log(file)
 };
 // 分页查询参数
 const queryList = () => {