tianyunperfect 3 years ago
parent
commit
de9d4ff1f1
3 changed files with 12 additions and 19 deletions
  1. 1 1
      tmp/index.html
  2. 10 11
      tmp/monkey/AAAAA-复制标题-到memory.js
  3. 1 7
      tmp/monkey/util.js

+ 1 - 1
tmp/index.html

@@ -2,10 +2,10 @@
 <head>
     <title>JavaScript自动关闭窗口</title>
     <meta http-equiv="content-Type" content="text/html;charset=utf-8">
+    <script src="monkey/util.js"></script>
 </head>
 <body>
 <script>
-
 </script>
 </body>
 </html>

+ 10 - 11
tmp/monkey/AAAAA-复制标题-到memory.js

@@ -32,18 +32,17 @@
             "updateTime": "",
             "userId": 1
         }
-        if (window.confirm(`${title}\n${location.host}\n`)) {
-            let memory_url = "https://memory.tianyunperfect.cn/api/memory-64B206F1-E915-4298-9AB7-9C561040B012/insert";
-            axios.post(memory_url, body).then((res) => {
-                console.log(res.data);
-                let data = res.data;
-                if (data.success) {
+        let memory_url = "https://memory.tianyunperfect.cn/api/memory-64B206F1-E915-4298-9AB7-9C561040B012/insert";
+        axios.post(memory_url, body).then((res) => {
+            console.log(res.data);
+            let data = res.data;
+            if (data.success) {
 
-                } else {
-                    alert(data.message);
-                }
-            })
-        }
+            } else {
+                alert(data.message);
+            }
+        })
+        MyAlert(`${title}<br/>${location.host}`,2)
     }
 
     function copyTitle() {

+ 1 - 7
tmp/monkey/util.js

@@ -74,10 +74,7 @@ function myCopy(inner_html) {
 
 //自动关闭提示框
 function MyAlert(str, sec) {
-    let msgw, msgh, bordercolor;
-    msgw = 350;//提示窗口的宽度
-    msgh = 80;//提示窗口的高度
-    bordercolor = "#336699";//提示窗口的边框颜色
+    let bordercolor = "#336699";//提示窗口的边框颜色
     let sWidth, sHeight;
     //获取当前窗口尺寸
     sWidth = document.body.offsetWidth;
@@ -108,8 +105,6 @@ function MyAlert(str, sec) {
     msgObj.style.marginLeft = "-225px";
     //窗口被卷去的高+(屏幕可用工作区高/2)-150
     msgObj.style.top = document.body.scrollTop + (window.screen.availHeight / 2) - 150 + "px";
-    msgObj.style.width = msgw + "px";
-    msgObj.style.height = msgh + "px";
     msgObj.style.textAlign = "center";
     msgObj.style.lineHeight = "25px";
     msgObj.style.zIndex = "10001";
@@ -124,7 +119,6 @@ function MyAlert(str, sec) {
     title.style.filter = "progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);";
     title.style.opacity = "0.75";
     title.style.border = "1px solid " + bordercolor;
-    title.style.height = "18px";
     title.style.font = "12px Verdana, Geneva, Arial, Helvetica, sans-serif";
     title.style.color = "white";
     title.innerHTML = "提示信息";