tianyunperfect há 11 meses atrás
pai
commit
3a225558dd
1 ficheiros alterados com 8 adições e 1 exclusões
  1. 8 1
      simple-demo/send_memos.html

+ 8 - 1
simple-demo/send_memos.html

@@ -204,7 +204,7 @@
 <!--异步请求示例:requestUtil.sync('https://jsonplaceholder.typicode.com/posts/1', 'post', data, headers) .then(data => console.log(data))-->
 <script>
     if (getQueryString("id") !== "tianyunperfect") {
-        location.href = "http://127.0.0.1";
+        // location.href = "http://127.0.0.1";
     }
     let authStr = "bearer eyJhbGciOiJIUzI1NiIsImtpZCI6InYxIiwidHlwIjoiSldUIn0.eyJuYW1lIjoidGlhbnl1bnBlcmZlY3QiLCJpc3MiOiJtZW1vcyIsInN1YiI6IjEiLCJhdWQiOlsidXNlci5hY2Nlc3MtdG9rZW4iXSwiaWF0IjoxNzA5MTc5NTUyfQ.LFxWB4efya1sL7VoJ42xpXxbAip-udT_Kx2OwZ8Y3-E";
     let myHeaders = {
@@ -248,6 +248,7 @@
             }
         },
         mounted() {
+
             // 初始化contentStr,如果本地有缓存
             let item = localStorage.getItem('contentStr');
             if (item) {
@@ -528,6 +529,12 @@
             },
             getAllTags: function () {
                 this.allTags = requestUtil.sync('https://memos.tianyunperfect.cn/api/v1/tag', 'get', null, myHeaders);
+                // 先检查url
+                if (getQueryString("tags")) {
+                    this.tagChecked = getQueryString("tags").split(',')
+                    return
+                }
+                // 否则检查本地存储
                 let item1 = localStorage.getItem('tags'); // 获取本地存储的标签
                 if (item1) {
                     this.tagChecked = JSON.parse(item1);