liyongli 2 жил өмнө
parent
commit
eef18be7e6
4 өөрчлөгдсөн 4 нэмэгдсэн , 232 устгасан
  1. 4 21
      README.md
  2. 0 65
      saveGit.js
  3. 0 38
      src/node/h.html
  4. 0 108
      src/node/node.js

+ 4 - 21
README.md

@@ -1,24 +1,7 @@
 # ott
 
-## Project setup
-```
-yarn install
-```
+## Project run
+pnpm serve
 
-### Compiles and hot-reloads for development
-```
-yarn serve
-```
-
-### Compiles and minifies for production
-```
-yarn build
-```
-
-### Lints and fixes files
-```
-yarn lint
-```
-
-### Customize configuration
-See [Configuration Reference](https://cli.vuejs.org/config/).
+## Project build
+pnpm build

+ 0 - 65
saveGit.js

@@ -1,68 +1,6 @@
-// const client = require("ssh2-sftp-client");
-// const path = require("path");
-// const fs = require("fs");
-
 const { execSync } = require("child_process");
 
 (async function Init() {
-//   const list = [];
-
-  /**
-   * 获取localDir下的所有文件路径
-   */
-//   async function getFiles() {
-//      const pathDir = path.resolve(__dirname, "./dist");
-//     const dirList = fs.readdirSync(pathDir) || [];
-//     for (let i = 0; i < dirList.length; i++) {
-//       const P = [pathDir, dirList[i]];
-//       const stat = fs.lstatSync(P.join("\\"));
-//       if (!stat.isDirectory()) {
-//         list.push(P);
-//       } else getFiles(P.join("\\"));
-//     }
-//   }
-
-//   async function upServer() {
-//     const config = {
-//       path: {
-//         // 远程地址
-//         romotePath: "/data2/zyx/static/",
-//         // 本地地址
-//         localPath: path.resolve(__dirname, "./dist"),
-//       },
-//       romote: {
-//         // 服务器 ip 地址
-//         host: "123.57.195.226",
-//         // 端口号,默认是 22
-//         port: 22,
-//         // 登录的用户名
-//         username: "root",
-//         // 登录密码
-//         password: "581100Li.",
-//       },
-//     };
-//     const sftp = new client();
-//     try {
-//       await sftp.connect(config.romote);
-//       const romotePath = config.path.romotePath;
-//       const isCss = await sftp.exists(romotePath + "css");
-//       const isFonts = await sftp.exists(romotePath + "fonts");
-//       const isJs = await sftp.exists(romotePath + "js");
-//       const isIndexHtml = await sftp.exists(romotePath + "index.html");
-//       isCss && await sftp.rmdir(romotePath + "css", true);
-//       isFonts && await sftp.rmdir(romotePath + "fonts", true);
-//       isJs && await sftp.rmdir(romotePath + "js", true);
-//       isIndexHtml && await sftp.delete(romotePath + "index.html", true);
-//       console.log("已清空原有文件");
-//       await sftp.uploadDir(config.path.localPath, romotePath);
-//       console.log("上传完成");
-//       // 断开连接
-//       sftp.end();
-//       console.log("断开链接");
-//     } catch (err) {
-//       console.log("更新失败", err);
-//     }
-//   }
 
   /**
    * 上传git
@@ -81,9 +19,6 @@ const { execSync } = require("child_process");
 
   try {
     execFun();
-    // await getFiles();
-    // console.log("获取文件路径---完成");
-    // await upServer();
   } catch (err) {
     console.log("失败", err);
   }

+ 0 - 38
src/node/h.html

@@ -1,38 +0,0 @@
-<!DOCTYPE html>
-<html>
-
-<head>
-    <meta charset="utf-8" />
-    <title></title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
-    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
-    <meta http-equiv="Pragma" content="no-cache" />
-    <meta http-equiv="Expires" content="0" />
-    <script src="https://djweb.smcic.net/gouju/js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
-</head>
-
-<body>
-    <script>
-        $.ajax({
-            url: 'http://114.117.161.191:9001/kuyun/api/evaluation/eye/performance/absepg_filter',
-            type: 'put',
-            dataType: 'json',
-            //data: JSON.stringify({data:{status: "start"}}),
-            data: {
-                date: ["2021-01-01", "2021-01-02"],
-                key: "abs_epg,channel_0,time,week,area_c_1",
-                org_id: 20,
-            },
-            cache: false,
-            headers: {
-                'Content-Type': 'application/json;charset=UTF-8'  //multipart/form-data;boundary=--xxxxxxx   application/json
-            },
-            success: function (res) {
-                console.log(res)
-            }
-        })
-    </script>
-</body>
-
-</html>

+ 0 - 108
src/node/node.js

@@ -1,108 +0,0 @@
-// const { Promise } = require("core-js");
-// const https = require("https");
-// const fs = require("fs");
-
-// async function getlist() {
-//   return new Promise((resolve, reject) => {
-//     https
-//       .get("https://bigdata.smcic.net/overview?&season=1", res => {
-//         let d = "";
-
-//         res.on("data", data => {
-//           d += data;
-//         });
-//         res.on("end", () => {
-//           let date = JSON.parse(d);
-//           resolve(date);
-//         });
-//       })
-//       .on("error", e => {
-//         reject(e);
-//       });
-//   });
-// }
-// async function getpla(v) {
-//   return new Promise((resolve, reject) => {
-//     https
-//       .get(
-//         "https://bigdata.smcic.net/name?topic_name=" +
-//           v +
-//           "&platform=ALL&type=all&season=1",
-//         res => {
-//           let d = "";
-//           res.on("data", data => {
-//             d += data;
-//           });
-//           res.on("end", () => {
-//             let date = JSON.parse(d);
-//             resolve(date);
-//           });
-//         }
-//       )
-//       .on("error", e => {
-//         reject(e);
-//       });
-//   });
-// }
-
-// async function t() {
-//   const list = await getlist();
-//   const out = {};
-//   const li = [];
-//   for (let i = 0; i < list.length; i++) {
-//     const v = list[i];
-//     const plist = await getpla(v.topic_name);
-//     for (let o = 0; o < plist.length; o++) {
-//       const item = plist[o];
-//       const key = item.nickname.replace(/\s*/g, "")
-//       if (out[key] === undefined) {
-//         li.push(item);
-//         out[key] = li.length - 1;
-//         continue;
-//       }
-//       let keys = Object.keys(item);
-//       for (let p = 0; p < keys.length; p++) {
-//         const value = keys[p];
-//         if (value !== "nickname") li[out[key]][value] += item[value];
-//       }
-//     }
-//   }
-
-//   fs.writeFileSync("./list.json", JSON.stringify(li.sort((a,b)=>a.pv -b.pv)));
-// }
-
-// t();
-
-const request = require("request");
-
-request.post(
-  "http://114.117.161.191:9001/kuyun/api/evaluation/eye/performance/absepgkpi",
-  {
-    json: {
-      date: ["2021-01-01", "2021-01-08"],
-      filter: {
-        week: [1, 2, 3, 4, 5, 6, 7],
-        channel_0: [5],
-        area_c_1: ["area_c_320000", "area_c_640000"],
-        abs_epg: [10231],
-        time: ["0000_2400"],
-      },
-      field: [
-        "area_c_1",
-        "abs_epg",
-        "indicators_tv_ratings",
-        "indicators_market_ratings",
-      ],
-      info: 1,
-      org_id: 20,
-    },
-  },
-  (error, res, body) => {
-    if (error) {
-      console.error(error);
-      return;
-    }
-    console.log(`statusCode: ${res.statusCode}`);
-    console.log(body);
-  }
-);