|
@@ -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() {
|