diff --git a/src/function/setENV.mjs b/src/function/setENV.mjs index 25f02d2..1f15d3f 100644 --- a/src/function/setENV.mjs +++ b/src/function/setENV.mjs @@ -9,13 +9,13 @@ import { Lodash as _, getStorage, Console } from "@nsnanocat/util"; * @return {Object} { Settings, Caches, Configs } */ export default function setENV(name, platforms, database) { - Console.info("☑️ Set Environment Variables"); + Console.log("☑️ Set Environment Variables"); const { Settings, Caches, Configs } = getStorage(name, platforms, database); /***************** Settings *****************/ Console.debug(`Settings: ${typeof Settings}, Settings内容: ${JSON.stringify(Settings)}`); /***************** Caches *****************/ //Console.debug(`Caches: ${typeof Caches}, Caches内容: ${JSON.stringify(Caches)}`); /***************** Configs *****************/ - Console.info("✅ Set Environment Variables"); + Console.log("✅ Set Environment Variables"); return { Settings, Caches, Configs }; }; diff --git a/src/request.dev.js b/src/request.dev.js index 1367368..b98dc8c 100644 --- a/src/request.dev.js +++ b/src/request.dev.js @@ -7,13 +7,13 @@ let $response = undefined; /***************** Processing *****************/ // 解构URL const url = new URL($request.url); -Console.debug(`url: ${url.toJSON()}`); +Console.info(`url: ${url.toJSON()}`); // 获取连接参数 const PATHs = url.pathname.split("/").filter(Boolean); -Console.debug(`PATHs: ${PATHs}`); +Console.info(`PATHs: ${PATHs}`); // 解析格式 const FORMAT = ($request.headers?.["Content-Type"] ?? $request.headers?.["content-type"])?.split(";")?.[0]; -Console.debug(`FORMAT: ${FORMAT}`); +Console.info(`FORMAT: ${FORMAT}`); !(async () => { /** * 设置 diff --git a/src/request.js b/src/request.js index b9a3592..54e8506 100644 --- a/src/request.js +++ b/src/request.js @@ -4,17 +4,17 @@ import database from "./function/database.mjs"; import setENV from "./function/setENV.mjs"; // 构造回复数据 let $response = undefined; -Console.debug = (...msg) => { }; +Console.debug = () => {}; /***************** Processing *****************/ // 解构URL const url = new URL($request.url); -Console.debug(`url: ${url.toJSON()}`); +Console.info(`url: ${url.toJSON()}`); // 获取连接参数 const PATHs = url.pathname.split("/").filter(Boolean); -Console.debug(`PATHs: ${PATHs}`); +Console.info(`PATHs: ${PATHs}`); // 解析格式 const FORMAT = ($request.headers?.["Content-Type"] ?? $request.headers?.["content-type"])?.split(";")?.[0]; -Console.debug(`FORMAT: ${FORMAT}`); +Console.info(`FORMAT: ${FORMAT}`); !(async () => { /** * 设置 @@ -173,8 +173,8 @@ Console.debug(`FORMAT: ${FORMAT}`); $request.url = url.toString(); Console.debug(`$request.url: ${$request.url}`); })() -.catch(e => Console.error(e)) -.finally(() => { + .catch(e => Console.error(e)) + .finally(() => { switch (typeof $response) { case "object": // 有构造回复数据,返回构造的回复数据 //Console.debug("🚧 finally", `echo $response: ${JSON.stringify($response, null, 2)}`); diff --git a/src/response.dev.js b/src/response.dev.js index 97f8f0a..6a8794e 100644 --- a/src/response.dev.js +++ b/src/response.dev.js @@ -6,15 +6,13 @@ import { Any } from "./protobuf/google/protobuf/any.js"; /***************** Processing *****************/ // 解构URL const url = new URL($request.url); -Console.debug(`url: ${url.toJSON()}`, ""); +Console.info(`url: ${url.toJSON()}`, ""); // 获取连接参数 -const HOST = url.hostname, - PATH = url.pathname, - PATHs = url.pathname.split("/").filter(Boolean); -Console.debug(`HOST: ${HOST}, PATH: ${PATH}`, ""); +const PATHs = url.pathname.split("/").filter(Boolean); +Console.info(`PATHs: ${PATHs}`, ""); // 解析格式 const FORMAT = ($response.headers?.["Content-Type"] ?? $response.headers?.["content-type"])?.split(";")?.[0]; -Console.debug(`FORMAT: ${FORMAT}`, ""); +Console.info(`FORMAT: ${FORMAT}`, ""); !(async () => { /** * 设置 @@ -79,7 +77,7 @@ Console.debug(`FORMAT: ${FORMAT}`, ""); break; case "api.bilibili.com": case "api.biliapi.net": - switch (PATH) { + switch (url.pathname) { case "/pgc/player/api/playurl": // 番剧-播放地址-api case "/pgc/player/web/playurl": // 番剧-播放地址-web case "/pgc/player/web/playurl/html5": // 番剧-播放地址-web-HTML5