From c3025b9c90336ae3ca305ba11c7368f180a63e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=B6=E9=9B=A8=E2=97=8E=E6=98=9F=E7=A9=BA?= Date: Wed, 22 Mar 2023 03:19:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20segment=20=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=20(#525)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/character/AvatarCard.js | 1 - apps/character/ImgUpload.js | 1 - apps/profile/ProfileCommon.js | 1 - apps/profile/ProfileUtils.js | 1 - apps/wiki/CharWiki.js | 1 - index.js | 4 ++++ 6 files changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/character/AvatarCard.js b/apps/character/AvatarCard.js index 27254675..30c9ebe7 100644 --- a/apps/character/AvatarCard.js +++ b/apps/character/AvatarCard.js @@ -1,7 +1,6 @@ import { Character, MysApi, Player } from '#miao.models' import { Cfg, Common } from '#miao' import lodash from 'lodash' -import { segment } from 'oicq' import moment from 'moment' let Avatar = { diff --git a/apps/character/ImgUpload.js b/apps/character/ImgUpload.js index 148f74b6..03c89a5a 100644 --- a/apps/character/ImgUpload.js +++ b/apps/character/ImgUpload.js @@ -1,7 +1,6 @@ import fs from 'fs' import { promisify } from 'util' import { pipeline } from 'stream' -import { segment } from 'oicq' import MD5 from 'md5' import fetch from 'node-fetch' import lodash from 'lodash' diff --git a/apps/profile/ProfileCommon.js b/apps/profile/ProfileCommon.js index ecba5637..b66b99a4 100644 --- a/apps/profile/ProfileCommon.js +++ b/apps/profile/ProfileCommon.js @@ -1,7 +1,6 @@ /* * 面板公共方法及处理 * */ -import { segment } from 'oicq' import { Version } from '#miao' import { Character, MysApi, Player } from '#miao.models' diff --git a/apps/profile/ProfileUtils.js b/apps/profile/ProfileUtils.js index 521a1545..4453f80a 100644 --- a/apps/profile/ProfileUtils.js +++ b/apps/profile/ProfileUtils.js @@ -1,4 +1,3 @@ -import { segment } from 'oicq' import { Cfg } from '#miao' import { MysApi } from '#miao.models' diff --git a/apps/wiki/CharWiki.js b/apps/wiki/CharWiki.js index 6739675f..8e7c47ba 100644 --- a/apps/wiki/CharWiki.js +++ b/apps/wiki/CharWiki.js @@ -1,5 +1,4 @@ import lodash from 'lodash' -import { segment } from 'oicq' import CharTalent from './CharTalent.js' import CharWikiData from './CharWikiData.js' import CharMaterial from './CharMaterial.js' diff --git a/index.js b/index.js index 07b23694..001fd530 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,10 @@ import { Data, Version } from '#miao' import fs from 'fs' +if (!global.segment) { + global.segment = (await import("oicq")).segment +} + export * from './apps/index.js' if (Bot?.logger?.info) {