Bläddra i källkod

临时链接有效期

natasha 2 år sedan
förälder
incheckning
38b24e2ba6
2 ändrade filer med 62 tillägg och 28 borttagningar
  1. 19 1
      src/components/Adult/Preview.vue
  2. 43 27
      src/views/courseList.vue

+ 19 - 1
src/components/Adult/Preview.vue

@@ -86,9 +86,27 @@
                     :class="[
                       noFont.indexOf(itemCon.pinyin) > -1 ? 'noFont' : ''
                     ]"
+                    v-if="item.detail &&
+                      !(item.detail.wordsList &&
+                      item.detail.wordsList[indexCon - 1] &&
+                      item.detail.wordsList[indexCon - 1].chs &&
+                      chsFhList.indexOf(
+                        item.detail.wordsList[indexCon - 1].chs
+                      ) == -1&&chsFhList.indexOf(
+                        itemCon.chs
+                      ) > -1)"
                     >{{ itemCon.pinyin }}</span
                   >
-                  <span class="hanzi content-con">{{ itemCon.chs }}</span>
+                  <span class="hanzi content-con"
+                  v-if="item.detail &&
+                      !(item.detail.wordsList &&
+                      item.detail.wordsList[indexCon - 1] &&
+                      item.detail.wordsList[indexCon - 1].chs &&
+                      chsFhList.indexOf(
+                        item.detail.wordsList[indexCon - 1].chs
+                      ) == -1&&chsFhList.indexOf(
+                        itemCon.chs
+                      ) > -1)">{{ itemCon.chs }}</span>
                 </template>
               </div>
             </div>

+ 43 - 27
src/views/courseList.vue

@@ -762,33 +762,49 @@ export default {
       this.$router.push("/discountCodeList?bookId=" + row.id);
     }, // 生成临时链接
     handleCreatLink(row) {
-      let link =
-        "https://" +
-        window.location.host +
-        "/GCLS-Book/#/BookBrowsing?bookId=" +
-        row.id;
-      document.getElementById("temporaryLinks").innerHTML = link;
-      var doc = document,
-        text = doc.getElementById("temporaryLinks"),
-        range,
-        selection;
-      if (doc.body.createTextRange) {
-        range = doc.body.createTextRange();
-        range.moveToElementText(text);
-        range.select();
-      } else if (window.getSelection) {
-        selection = window.getSelection();
-        range = doc.createRange();
-        range.selectNodeContents(text);
-        selection.removeAllRanges();
-        selection.addRange(range);
-      }
-      document.execCommand("copy");
-      this.$message({
-        message: "复制成功",
-        type: "success"
-      });
-      window.getSelection().removeAllRanges();
+        var date1 = new Date(); 
+        var date2 = new Date(date1); 
+        date2.setDate(date1.getDate() + 30); 
+        let endtime = date2.getFullYear() + "-" + (date2.getMonth() + 1) + "-" + date2.getDate()
+        getContentFile('login_control-CreateValidDateEncryptionString', {
+            end_date: endtime,
+        })
+            .then((res) => {
+                let link =
+                    "https://" +
+                    window.location.host +
+                    "/GCLS-Book/#/BookBrowsing?bookId=" +
+                    row.id+"&encryption="+res.encryption_string;
+                document.getElementById("temporaryLinks").innerHTML = link;
+                var doc = document,
+                    text = doc.getElementById("temporaryLinks"),
+                    range,
+                    selection;
+                if (doc.body.createTextRange) {
+                    range = doc.body.createTextRange();
+                    range.moveToElementText(text);
+                    range.select();
+                } else if (window.getSelection) {
+                    selection = window.getSelection();
+                    range = doc.createRange();
+                    range.selectNodeContents(text);
+                    selection.removeAllRanges();
+                    selection.addRange(range);
+                }
+                document.execCommand("copy");
+                this.$message({
+                    message: "复制成功",
+                    type: "success",
+                });
+                window.getSelection().removeAllRanges();
+            })
+            .catch(() => {
+                this.$message({
+                    message: "生成失败,请稍后重试",
+                    type: "warning",
+                });
+            });
+      
     },
     // 新建教材
     handleAdd() {