Parcourir la source

update blog id copy

fengchang il y a 1 an
Parent
commit
db609d211f

+ 34 - 0
hichina-admin-front/src/pages/BlogManagePage.vue

@@ -81,6 +81,17 @@
             </template>
           </q-input>
         </template>
+        <template v-slot:body-cell-blogId="props">
+          <q-td :props="props">
+            <q-btn
+              color="blue-grey-3"
+              style="cursor: pointer"
+              @click="copyText(props.row.blogId)"
+              type="button"
+              >复制ID</q-btn
+            >
+          </q-td>
+        </template>
       </q-table>
     </div>
   </q-page>
@@ -123,6 +134,29 @@ export default {
     this.$refs.blogTableRef.requestServerInteraction();
   },
   methods: {
+    copyText(text) {
+      const unsecuredCopyToClipboard = (text) => {
+        const textArea = document.createElement("textarea");
+        textArea.value = text;
+        document.body.appendChild(textArea);
+        textArea.focus();
+        textArea.select();
+        try {
+          document.execCommand("copy");
+        } catch (err) {
+          console.error("Unable to copy to clipboard", err);
+        }
+        document.body.removeChild(textArea);
+      };
+
+      if (window.isSecureContext && navigator.clipboard) {
+        navigator.clipboard.writeText(text);
+        this.showNotifyMessageSucceed("成功复制" + text + "到剪贴板");
+      } else {
+        unsecuredCopyToClipboard(text);
+        this.showNotifyMessageSucceed("成功复制" + text + "到剪贴板");
+      }
+    },
     executeDraft() {
       console.log(this.selected);
 

+ 1 - 1
hichina-main-back/src/main/java/com/hichina/main/back/hichinamainback/controller/PublicRegisterController.java

@@ -140,7 +140,7 @@ public class PublicRegisterController {
                 "              </tr>\n" +
                 "              <tr height=\"30\">\n" +
                 "                <td style=\"padding-left:55px;padding-right:55px;font-family:'微软雅黑','黑体',arial;font-size:14px;\">\n" +
-                "                  Please click link below(available for 5 minutes),so that you can start using HiChinaTravel service:\n" +
+                "                  Please click link below(available for 10 minutes),so that you can start using HiChinaTravel service:\n" +
                 "                </td>\n" +
                 "              </tr>\n" +
                 "              <tr height=\"60\">\n" +