From e2a49427b08fa77a3c8ada5454d0f1d5d6a56cc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=8C=8C?= Date: Wed, 22 Mar 2023 19:27:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20segment=20=E5=AF=BC?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/Note.js | 3 --- apps/map.js | 3 --- apps/mhyTopUpLogin.js | 1 - apps/sign.js | 3 --- apps/xiaoyao_image.js | 3 --- components/Common.js | 1 - index.js | 4 ++++ model/mhyTopUpLogin.js | 1 - 8 files changed, 4 insertions(+), 15 deletions(-) diff --git a/apps/Note.js b/apps/Note.js index 0cd69eb..316974c 100644 --- a/apps/Note.js +++ b/apps/Note.js @@ -1,6 +1,3 @@ -import { - segment -} from "oicq"; import fetch from "node-fetch"; import fs from "fs"; import { diff --git a/apps/map.js b/apps/map.js index 7e3955a..26494d2 100644 --- a/apps/map.js +++ b/apps/map.js @@ -5,9 +5,6 @@ import { import fs from "fs"; import fetch from "node-fetch"; import utils from "../model/mys/utils.js"; -import { - segment -} from "oicq"; let path = './data/map' //mapId-地图别名 let getPath={ diff --git a/apps/mhyTopUpLogin.js b/apps/mhyTopUpLogin.js index 028eefb..a12e859 100644 --- a/apps/mhyTopUpLogin.js +++ b/apps/mhyTopUpLogin.js @@ -5,7 +5,6 @@ import mys from "../model/mhyTopUpLogin.js" import Common from "../components/Common.js"; import { bindStoken } from './user.js' import utils from '../model/mys/utils.js'; -import { segment } from 'oicq' const _path = process.cwd(); export const rule = { qrCodeLogin: { diff --git a/apps/sign.js b/apps/sign.js index eaf96e3..1677c1c 100644 --- a/apps/sign.js +++ b/apps/sign.js @@ -1,8 +1,5 @@ import User from "../model/user.js" import moment from 'moment'; -import { - segment -} from "oicq"; export const rule = { sign: { reg: `^#*(原神|崩坏3|崩坏2|未定事件簿)签到$`, diff --git a/apps/xiaoyao_image.js b/apps/xiaoyao_image.js index a34f43d..c859b0b 100644 --- a/apps/xiaoyao_image.js +++ b/apps/xiaoyao_image.js @@ -1,6 +1,3 @@ -import { - segment -} from "oicq"; import fs from "fs"; import { Cfg diff --git a/components/Common.js b/components/Common.js index c2238e0..32fd699 100644 --- a/components/Common.js +++ b/components/Common.js @@ -1,5 +1,4 @@ import { Cfg } from "./index.js"; -import { segment } from "oicq"; import { currentVersion, yunzaiVersion,isV3 } from "./Changelog.js"; export const render = async function (path, params, cfg) { let paths = path.split("/"); diff --git a/index.js b/index.js index 5ffc01f..1f79fbc 100644 --- a/index.js +++ b/index.js @@ -5,6 +5,10 @@ import { } from './components/Changelog.js' import Data from './components/Data.js' +if (!global.segment) { + global.segment = (await import("oicq")).segment +} + export * from './apps/index.js' let index = { atlas: {} diff --git a/model/mhyTopUpLogin.js b/model/mhyTopUpLogin.js index 121f6ff..2a558e7 100644 --- a/model/mhyTopUpLogin.js +++ b/model/mhyTopUpLogin.js @@ -1,6 +1,5 @@ import User from "./user.js"; import utils from './mys/utils.js'; -import { segment } from 'oicq' import Common from "../components/Common.js"; export default class mysTopLogin { constructor(e) {