tianyun 1 年之前
父节点
当前提交
843e7ff263
共有 1 个文件被更改,包括 8 次插入5 次删除
  1. 8 5
      simple-demo/send_memos.html

+ 8 - 5
simple-demo/send_memos.html

@@ -17,7 +17,9 @@
 <div id="editor"></div>
 
 <!-- 添加多选按钮 -->
-<input type="checkbox" id="work" name="category" value="工作" checked>
+<input type="checkbox" id="todo" name="category" value="todo" checked>
+<label for="todo">todo</label>
+<input type="checkbox" id="work" name="category" value="工作">
 <label for="work">工作</label>
 <input type="checkbox" id="diary" name="category" value="日记">
 <label for="diary">日记</label>
@@ -105,7 +107,7 @@
         // 添加多选按钮选择的分类到内容前面
         let updatedContent = content;
         if (categories.length > 0) {
-            updatedContent = `#${categories.join(' ')} ${content}`;
+            updatedContent = `${content} #${categories.join(' ')}`;
         }
 
         // 调用数据备份接口
@@ -116,10 +118,11 @@
         // 发送异步请求
         requestUtil.async('https://memos.tianyunperfect.cn/api/v1/memo', 'post', data, {
             'Content-type': 'application/json',
-            'Authorization': 'bearer eyJhbGciOiJIUzI1NiIsImtpZCI6InYxIiwidHlwIjoiSldUIn0.eyJuYW1lIjoidGlhbnl1bnBlcmZlY3QiLCJpc3MiOiJtZW1vcyIsInN1YiI6IjEiLCJhdWQiOlsidXNlci5hY2Nlc3MtdG9rZW4iXSwiaWF0IjoxNjk2Mjk3NjQwfQ.cUwdFFJp_Dv-MKy9BsrDPdjyxZrSaiPUqlMkdQEmJRE'
+            'Authorization': 'bearer eyJhbGciOiJIUzI1NiIsImtpZCI6InYxIiwidHlwIjoiSldUIn0.eyJuYW1lIjoidGlhbnl1bnBlcmZlY3QiLCJpc3MiOiJtZW1vcyIsInN1YiI6IjEiLCJhdWQiOlsidXNlci5hY2Nlc3MtdG9rZW4iXSwiaWF0IjoxNjk4OTg1OTIzfQ.yLXV9z4xzbJZGPTvUH3WXZEO3p4HUDgHxg-8gHVzoCw'
         }).then(res => {
-            if (res['id']) {
-                window.location.href = `https://memos.tianyunperfect.cn/m/${res['id']}`;
+            // alert(JSON.stringify(res));
+            if (res['name']) {
+                window.location.href = `https://memos.tianyunperfect.cn/m/${res['name']}`;
             }
         });
     }