🔨 Refactor(custom): refactored all imports

This commit is contained in:
Kuingsmile
2024-06-09 11:53:07 +08:00
parent 8a565c1333
commit e87e3999b4
138 changed files with 947 additions and 1333 deletions

View File

@@ -6,12 +6,14 @@
<script lang="ts" setup>
import { useStore } from '@/hooks/useStore'
import { onBeforeMount, onMounted, onUnmounted } from 'vue'
import { getConfig } from './utils/dataSender'
import type { IConfig } from 'piclist'
import bus from './utils/bus'
import { FORCE_UPDATE } from '~/universal/events/constants'
import { useATagClick } from './hooks/useATagClick'
import { onBeforeMount, onMounted, onUnmounted } from 'vue'
import { useATagClick } from '@/hooks/useATagClick'
import bus from '@/utils/bus'
import { getConfig } from '@/utils/dataSender'
import { FORCE_UPDATE } from '#/events/constants'
useATagClick()
const store = useStore()

View File

@@ -1,7 +1,8 @@
import { deleteFailedLog, deleteLog } from '@/utils/common'
import axios from 'axios'
import path from 'path'
import { deleteFailedLog, deleteLog } from '@/utils/common'
interface IConfigMap {
fileName: string
config: {

View File

@@ -1,6 +1,7 @@
import { deleteFailedLog, deleteLog } from '@/utils/common'
import OSS from 'ali-oss'
import { deleteFailedLog, deleteLog } from '@/utils/common'
interface IConfigMap {
fileName: string
config: PartialKeys<IAliYunConfig, 'path'>

View File

@@ -1,38 +1,38 @@
import AliyunApi from './aliyun'
import AwsS3Api from './awss3'
import GithubApi from './github'
import ImgurApi from './imgur'
import LocalApi from './local'
import QiniuApi from './qiniu'
import SftpPlistApi from './sftpplist'
import SmmsApi from './smms'
import TcyunApi from './tcyun'
import UpyunApi from './upyun'
import WebdavApi from './webdav'
import DogeCloudApi from './dogecloud'
import HuaweicloudApi from './huaweiyun'
import AlistApi from './alist'
import PiclistApi from './piclist'
import LskyplistApi from './lskyplist'
import AlistApi from '@/apis/alist'
import AliyunApi from '@/apis/aliyun'
import AwsS3Api from '@/apis/awss3'
import DogeCloudApi from '@/apis/dogecloud'
import GithubApi from '@/apis/github'
import HuaweicloudApi from '@/apis/huaweiyun'
import ImgurApi from '@/apis/imgur'
import LocalApi from '@/apis/local'
import LskyplistApi from '@/apis/lskyplist'
import PiclistApi from '@/apis/piclist'
import QiniuApi from '@/apis/qiniu'
import SftpPlistApi from '@/apis/sftpplist'
import SmmsApi from '@/apis/smms'
import TcyunApi from '@/apis/tcyun'
import UpyunApi from '@/apis/upyun'
import WebdavApi from '@/apis/webdav'
const apiMap: IStringKeyMap = {
alist: AlistApi,
aliyun: AliyunApi,
'aws-s3': AwsS3Api,
'aws-s3-plist': AwsS3Api,
dogecloud: DogeCloudApi,
github: GithubApi,
'huaweicloud-uploader': HuaweicloudApi,
imgur: ImgurApi,
local: LocalApi,
lskyplist: LskyplistApi,
piclist: PiclistApi,
qiniu: QiniuApi,
sftpplist: SftpPlistApi,
smms: SmmsApi,
tcyun: TcyunApi,
upyun: UpyunApi,
webdavplist: WebdavApi,
dogecloud: DogeCloudApi,
'huaweicloud-uploader': HuaweicloudApi,
alist: AlistApi,
piclist: PiclistApi,
lskyplist: LskyplistApi
webdavplist: WebdavApi
}
export default class ALLApi {

View File

@@ -1,6 +1,7 @@
import { ipcRenderer } from 'electron'
import { deleteFailedLog, getRawData } from '~/renderer/utils/common'
import { removeFileFromS3InMain } from '~/main/utils/deleteFunc'
import { deleteFailedLog, getRawData } from '@/utils/common'
import { removeFileFromS3InMain } from '~/utils/deleteFunc'
export default class AwsS3Api {
static async delete (configMap: IStringKeyMap): Promise<boolean> {

View File

@@ -1,6 +1,7 @@
import { ipcRenderer } from 'electron'
import { deleteFailedLog, getRawData } from '~/renderer/utils/common'
import { removeFileFromDogeInMain } from '~/main/utils/deleteFunc'
import { deleteFailedLog, getRawData } from '@/utils/common'
import { removeFileFromDogeInMain } from '~/utils/deleteFunc'
export default class AwsS3Api {
static async delete (configMap: IStringKeyMap): Promise<boolean> {

View File

@@ -1,6 +1,7 @@
import { deleteFailedLog, deleteLog } from '@/utils/common'
import { Octokit } from '@octokit/rest'
import { deleteFailedLog, deleteLog } from '@/utils/common'
interface IConfigMap {
fileName: string
hash: string

View File

@@ -1,6 +1,7 @@
import { ipcRenderer } from 'electron'
import { deleteFailedLog, getRawData } from '~/renderer/utils/common'
import { removeFileFromHuaweiInMain } from '~/main/utils/deleteFunc'
import { deleteFailedLog, getRawData } from '@/utils/common'
import { removeFileFromHuaweiInMain } from '~/utils/deleteFunc'
export default class HuaweicloudApi {
static async delete (configMap: IStringKeyMap): Promise<boolean> {

View File

@@ -1,6 +1,7 @@
import { deleteFailedLog, deleteLog } from '@/utils/common'
import axios, { AxiosResponse } from 'axios'
import { deleteFailedLog, deleteLog } from '@/utils/common'
interface IConfigMap {
config?: Partial<IImgurConfig>
hash?: string

View File

@@ -1,6 +1,7 @@
import { deleteFailedLog, deleteLog } from '@/utils/common'
import fs from 'fs-extra'
import { deleteFailedLog, deleteLog } from '@/utils/common'
interface IConfigMap {
hash: string
}

View File

@@ -1,7 +1,8 @@
import { deleteFailedLog, deleteLog } from '@/utils/common'
import axios, { AxiosResponse } from 'axios'
import https from 'https'
import { deleteFailedLog, deleteLog } from '@/utils/common'
export default class LskyplistApi {
static async delete (configMap: IStringKeyMap): Promise<boolean> {
const { hash, config } = configMap

View File

@@ -1,6 +1,7 @@
import { deleteFailedLog, deleteLog } from '@/utils/common'
import axios, { AxiosResponse } from 'axios'
import { deleteFailedLog, deleteLog } from '@/utils/common'
export default class PiclistApi {
static async delete (configMap: IStringKeyMap): Promise<boolean> {
const { config, fullResult } = configMap

View File

@@ -1,6 +1,7 @@
import { deleteFailedLog, deleteLog } from '@/utils/common'
import Qiniu from 'qiniu'
import { deleteFailedLog, deleteLog } from '@/utils/common'
interface IConfigMap {
fileName: string
config: PartialKeys<IQiniuConfig, 'path'>

View File

@@ -1,5 +1,6 @@
import { ipcRenderer } from 'electron'
import { deleteFailedLog, getRawData } from '~/renderer/utils/common'
import { deleteFailedLog, getRawData } from '@/utils/common'
export default class SftpPlistApi {
static async delete (configMap: IStringKeyMap): Promise<boolean> {

View File

@@ -1,6 +1,7 @@
import { deleteFailedLog, deleteLog } from '@/utils/common'
import axios, { AxiosResponse } from 'axios'
import { deleteFailedLog, deleteLog } from '@/utils/common'
interface IConfigMap {
hash?: string
config?: Partial<ISMMSConfig>

View File

@@ -1,6 +1,7 @@
import { deleteFailedLog, deleteLog } from '@/utils/common'
import COS from 'cos-nodejs-sdk-v5'
import { deleteFailedLog, deleteLog } from '@/utils/common'
interface IConfigMap {
fileName: string
config: PartialKeys<ITcYunConfig, 'path'>

View File

@@ -1,6 +1,7 @@
import { deleteFailedLog, deleteLog } from '@/utils/common'
import Upyun from 'upyun'
import { deleteFailedLog, deleteLog } from '@/utils/common'
interface IConfigMap {
fileName: string
config: PartialKeys<IUpYunConfig, 'path'>

View File

@@ -1,6 +1,8 @@
import { deleteFailedLog, deleteLog } from '@/utils/common'
import { AuthType, WebDAVClientOptions, createClient } from 'webdav'
import { formatEndpoint } from '~/main/manage/utils/common'
import { deleteFailedLog, deleteLog } from '@/utils/common'
import { formatEndpoint } from '~/manage/utils/common'
interface IConfigMap {
fileName: string

View File

@@ -99,14 +99,16 @@
</el-form>
</div>
</template>
<script lang="ts" setup>
import { reactive, ref, watch, toRefs } from 'vue'
import { cloneDeep, union } from 'lodash'
import { getConfig } from '@/utils/dataSender'
import { useRoute } from 'vue-router'
import type { FormInstance } from 'element-plus'
import { InfoFilled } from '@element-plus/icons-vue'
import { cloneDeep, union } from 'lodash'
import { marked } from 'marked'
import { reactive, ref, watch, toRefs } from 'vue'
import { useRoute } from 'vue-router'
import { InfoFilled } from '@element-plus/icons-vue'
import { getConfig } from '@/utils/dataSender'
interface IProps {
config: any[]

View File

@@ -76,11 +76,13 @@
</el-form>
</div>
</template>
<script lang="ts" setup>
import { reactive, ref, watch } from 'vue'
import { cloneDeep, union } from 'lodash'
import { getConfig } from '@/utils/dataSender'
import type { FormInstance } from 'element-plus'
import { cloneDeep, union } from 'lodash'
import { reactive, ref, watch } from 'vue'
import { getConfig } from '@/utils/dataSender'
import { T as $T } from '@/i18n'
interface IProps {

View File

@@ -22,12 +22,13 @@
</template>
<script lang="ts" setup>
import { ref, onBeforeMount } from 'vue'
import { getFileIconPath } from '@/manage/utils/common'
import { Loading } from '@element-plus/icons-vue'
import fs from 'fs-extra'
import mime from 'mime-types'
import path from 'path'
import { ref, onBeforeMount } from 'vue'
import { Loading } from '@element-plus/icons-vue'
import { getFileIconPath } from '@/manage/utils/common'
const base64Image = ref('')
const props = defineProps<{

View File

@@ -262,11 +262,12 @@
</template>
<script lang="ts" setup>
import { T as $T } from '@/i18n/index'
import { IBuildInCompressOptions, IBuildInWaterMarkOptions } from 'piclist'
import { onBeforeMount, reactive, ref, toRaw } from 'vue'
import { T as $T } from '@/i18n/index'
import { getConfig, saveConfig } from '@/utils/dataSender'
import { configPaths } from '~/universal/utils/configPaths'
import { configPaths } from '#/utils/configPaths'
const imageProcessDialogVisible = defineModel<boolean>()

View File

@@ -21,10 +21,12 @@
<script lang="ts" setup>
import { ref, onMounted, watch, computed } from 'vue'
import { getFileIconPath } from '@/manage/utils/common'
import { Loading } from '@element-plus/icons-vue'
import { getAuthHeader } from '@/manage/utils/digestAuth'
import { formatEndpoint } from '~/main/manage/utils/common'
import { getFileIconPath } from '@/manage/utils/common'
import { formatEndpoint } from '~/manage/utils/common'
const base64Url = ref('')
const success = ref(false)

View File

@@ -1,9 +1,11 @@
import { defineComponent, ref, onMounted, watch, computed } from 'vue'
import { getFileIconPath } from '@/manage/utils/common'
import { Loading } from '@element-plus/icons-vue'
import { getAuthHeader } from '@/manage/utils/digestAuth'
import { formatEndpoint } from '~/main/manage/utils/common'
import { ElImage, ElIcon } from 'element-plus'
import { defineComponent, ref, onMounted, watch, computed } from 'vue'
import { Loading } from '@element-plus/icons-vue'
import { getFileIconPath } from '@/manage/utils/common'
import { getAuthHeader } from '@/manage/utils/digestAuth'
import { formatEndpoint } from '~/manage/utils/common'
export default defineComponent({
props: {

View File

@@ -26,16 +26,19 @@
</template>
</el-dialog>
</template>
<script lang="ts" setup>
import { ref, reactive, onBeforeUnmount, onBeforeMount } from 'vue'
import { ipcRenderer, IpcRendererEvent } from 'electron'
import { ref, reactive, onBeforeUnmount, onBeforeMount } from 'vue'
import { T as $T } from '@/i18n/index'
import $bus from '@/utils/bus'
import { sendToMain } from '@/utils/dataSender'
import {
SHOW_INPUT_BOX,
SHOW_INPUT_BOX_RESPONSE
} from '~/universal/events/constants'
import $bus from '@/utils/bus'
import { sendToMain } from '@/utils/dataSender'
import { T as $T } from '@/i18n/index'
} from '#/events/constants'
const inputBoxValue = ref('')
const showInputBoxVisible = ref(false)

View File

@@ -9,8 +9,9 @@
</ElButton>
</div>
</template>
<script lang="ts" setup>
import { IToolboxItemCheckStatus } from '~/universal/types/enum'
import { IToolboxItemCheckStatus } from '#/types/enum'
interface IProps {
status: IToolboxItemCheckStatus

View File

@@ -14,10 +14,12 @@
</template>
</el-icon>
</template>
<script lang="ts" setup>
import { CircleCloseFilled, Loading, SuccessFilled } from '@element-plus/icons-vue'
import { computed } from 'vue'
import { IToolboxItemCheckStatus } from '~/universal/types/enum'
import { IToolboxItemCheckStatus } from '#/types/enum'
interface IProps {
status: IToolboxItemCheckStatus

View File

@@ -1,6 +1,7 @@
import { openURL } from '@/utils/common'
import { onMounted, onUnmounted } from 'vue'
import { openURL } from '@/utils/common'
export function useATagClick () {
const handleATagClick = (e: MouseEvent) => {
if (e.target instanceof HTMLAnchorElement) {

View File

@@ -1,6 +1,7 @@
import { ipcRenderer } from 'electron'
import { onUnmounted } from 'vue'
import { IRPCActionType } from '~/universal/types/enum'
import { IRPCActionType } from '#/types/enum'
export const useIPCOn = (channel: string, listener: IpcRendererListener) => {
ipcRenderer.on(channel, listener)

View File

@@ -1,7 +1,9 @@
import { ipcRenderer } from 'electron'
import { ObjectAdapter, I18n } from '@picgo/i18n'
import { GET_CURRENT_LANGUAGE, SET_CURRENT_LANGUAGE, FORCE_UPDATE, GET_LANGUAGE_LIST } from '#/events/constants'
import bus from '@/utils/bus'
import { GET_CURRENT_LANGUAGE, SET_CURRENT_LANGUAGE, FORCE_UPDATE, GET_LANGUAGE_LIST } from '#/events/constants'
import { builtinI18nList } from '#/i18n'
export class I18nManager {

View File

@@ -216,8 +216,8 @@
<input-box-dialog />
</div>
</template>
<script lang="ts" setup>
// Element Plus 图标
import {
Tools,
UploadFilled,
@@ -232,55 +232,34 @@ import {
Link,
ArrowUpBold
} from '@element-plus/icons-vue'
// Element Plus 消息框组件
import { ElMessage as $message, ElMessageBox } from 'element-plus'
// 国际化函数
import { T as $T } from '@/i18n/index'
// Vue 相关
import { ref, onBeforeUnmount, Ref, onBeforeMount, watch, nextTick, reactive } from 'vue'
// Vue Router 相关
import { onBeforeRouteUpdate, useRouter } from 'vue-router'
// 二维码组件
import QrcodeVue from 'qrcode.vue'
// Lodash pick 函数
import pick from 'lodash/pick'
// 根目录 package.json
import pkg from 'root/package.json'
// 路由配置常量
import * as config from '@/router/config'
// Electron 相关
import {
ipcRenderer,
IpcRendererEvent,
clipboard
} from 'electron'
import { ElMessage as $message, ElMessageBox } from 'element-plus'
import pick from 'lodash/pick'
import QrcodeVue from 'qrcode.vue'
import { ref, onBeforeUnmount, Ref, onBeforeMount, watch, nextTick, reactive } from 'vue'
import { onBeforeRouteUpdate, useRouter } from 'vue-router'
// 输入框对话框组件
import InputBoxDialog from '@/components/InputBoxDialog.vue'
import { T as $T } from '@/i18n/index'
import * as config from '@/router/config'
import { getConfig, saveConfig, sendToMain } from '@/utils/dataSender'
import { openURL } from '@/utils/common'
// 事件常量
import {
MINIMIZE_WINDOW,
CLOSE_WINDOW,
SHOW_MAIN_PAGE_MENU,
SHOW_MAIN_PAGE_QRCODE,
GET_PICBEDS
} from '~/universal/events/constants'
} from '#/events/constants'
import { configPaths, manualPageOpenType } from '#/utils/configPaths'
import { II18nLanguage } from '#/types/enum'
// 数据发送工具函数
import { getConfig, saveConfig, sendToMain } from '@/utils/dataSender'
import { openURL } from '@/utils/common'
import { configPaths, manualPageOpenType } from '~/universal/utils/configPaths'
import { II18nLanguage } from '~/universal/types/enum'
import pkg from 'root/package.json'
const version = ref(process.env.NODE_ENV === 'production' ? pkg.version : 'Dev')
const routerConfig = reactive(config)

View File

@@ -1438,37 +1438,8 @@ https://www.baidu.com/img/bd_logo1.png"
</template>
<script lang="tsx" setup>
// Vue 相关
import { ref, reactive, watch, onBeforeMount, computed, onBeforeUnmount } from 'vue'
// Vue Router 相关
import { useRoute } from 'vue-router'
// Element Plus 图标
import { InfoFilled, Grid, Fold, Close, Folder, FolderAdd, Upload, CircleClose, Loading, CopyDocument, Edit, UploadFilled, Link, Refresh, ArrowRight, HomeFilled, Document, Coin, Download, DeleteFilled, Sort, FolderOpened } from '@element-plus/icons-vue'
// 状态管理相关
import { useManageStore } from '../store/manageStore'
// 工具函数
import { customRenameFormatTable, customStrMatch, customStrReplace, renameFile, formatLink, formatFileName, getFileIconPath, formatFileSize, getExtension, isValidUrl, svg } from '../utils/common'
// 静态工具函数
import { cancelDownloadLoadingFileList, refreshDownloadFileTransferList } from '../utils/static'
// Electron 相关
import { ipcRenderer, clipboard, IpcRendererEvent } from 'electron'
// 数据库操作
import { fileCacheDbInstance } from '../store/bucketFileDb'
// 工具函数
import { trimPath } from '~/main/manage/utils/common'
// Axios
import axios from 'axios'
// Element Plus 组件
import { ipcRenderer, clipboard, IpcRendererEvent } from 'electron'
import {
ElMessage, ElMessageBox, ElNotification,
ElButton,
@@ -1485,44 +1456,31 @@ import {
ElTag,
ElCard
} from 'element-plus'
// 类型声明
import type { Column, RowClassNameGetter } from 'element-plus'
// 状态管理相关
import { useFileTransferStore, useDownloadFileTransferStore } from '@/manage/store/manageStore'
// UUID
import { v4 as uuidv4 } from 'uuid'
// 路径处理库
import path from 'path'
// 文件系统库
import { InfoFilled, Grid, Fold, Close, Folder, FolderAdd, Upload, CircleClose, Loading, CopyDocument, Edit, UploadFilled, Link, Refresh, ArrowRight, HomeFilled, Document, Coin, Download, DeleteFilled, Sort, FolderOpened } from '@element-plus/icons-vue'
import fs from 'fs-extra'
// 数据发送工具函数
import { getConfig, saveConfig } from '../utils/dataSender'
// Markdown 解析库
import { marked } from 'marked'
import path from 'path'
import { v4 as uuidv4 } from 'uuid'
import { ref, reactive, watch, onBeforeMount, computed, onBeforeUnmount } from 'vue'
import { useRoute } from 'vue-router'
// 文本文件扩展名列表
import { textFileExt } from '../utils/textfile'
import { fileCacheDbInstance } from '@/manage/store/bucketFileDb'
import { useFileTransferStore, useDownloadFileTransferStore, useManageStore } from '@/manage/store/manageStore'
import { customRenameFormatTable, customStrMatch, customStrReplace, renameFile, formatLink, formatFileName, getFileIconPath, formatFileSize, getExtension, isValidUrl, svg } from '@/manage/utils/common'
import { getConfig, saveConfig } from '@/manage/utils/dataSender'
import { cancelDownloadLoadingFileList, refreshDownloadFileTransferList } from '@/manage/utils/static'
import { textFileExt } from '@/manage/utils/textfile'
import { videoExt } from '@/manage/utils/videofile'
// 视频文件扩展名列表
import { videoExt } from '../utils/videofile'
// 组件
import ImageWebdav from '@/components/ImageWebdav.vue'
import ImageLocal from '@/components/ImageLocal.vue'
import ImageWebdavTsx from '@/components/ImageWebdavTsx'
// 国际化函数
import { T as $T } from '@/i18n'
import { IUploadTask, IDownloadTask } from '~/main/manage/datastore/upDownTaskQueue'
import { IUploadTask, IDownloadTask } from '~/manage/datastore/upDownTaskQueue'
import { trimPath } from '~/manage/utils/common'
/*
configMap:{
prefix: string, -> baseDir

View File

@@ -267,43 +267,23 @@
</template>
<script lang="ts" setup>
// Vue 相关
import { reactive, ref, onMounted, computed } from 'vue'
// 支持的图床列表
import { supportedPicBedList } from '../utils/constants'
// Element Plus 图标
import { Delete, Edit, Pointer, InfoFilled } from '@element-plus/icons-vue'
// Element Plus 消息组件
import { ElMessage, ElMessageBox, ElNotification } from 'element-plus'
// 数据发送工具函数
import { getConfig, saveConfig, removeConfig } from '../utils/dataSender'
// Electron 相关
import { shell } from 'electron'
// Vue Router 相关
import { ElMessage, ElMessageBox, ElNotification } from 'element-plus'
import { Delete, Edit, Pointer, InfoFilled } from '@element-plus/icons-vue'
import { reactive, ref, onMounted, computed } from 'vue'
import { useRouter } from 'vue-router'
// 状态管理相关
import { useManageStore } from '../store/manageStore'
import { useManageStore } from '@/manage/store/manageStore'
import { supportedPicBedList } from '@/manage/utils/constants'
import { getConfig, saveConfig, removeConfig } from '@/manage/utils/dataSender'
import { formObjToTableData, svg } from '@/manage/utils/common'
// 工具函数
import { formObjToTableData, svg } from '../utils/common'
// 数据发送工具函数
import { getConfig as getPicBedsConfig } from '@/utils/dataSender'
// 端点地址格式化
import { formatEndpoint } from '~/main/manage/utils/common'
import { isNeedToShorten, safeSliceF } from '#/utils/common'
// 国际化函数
import { T as $T } from '@/i18n'
import { formatEndpoint } from '~/manage/utils/common'
import { isNeedToShorten, safeSliceF } from '#/utils/common'
const manageStore = useManageStore()
const router = useRouter()

View File

@@ -279,36 +279,19 @@
</template>
<script lang="ts" setup>
// Vue 相关
import { ref, reactive, computed, onBeforeMount, watch } from 'vue'
// Electron 相关
import { shell } from 'electron'
// 支持的图床列表
import { supportedPicBedList } from '../utils/constants'
// Element Plus 图标
import { ElNotification } from 'element-plus'
import { CirclePlus, SuccessFilled, Folder, Switch, Tools, ChromeFilled, HomeFilled, FolderOpened } from '@element-plus/icons-vue'
// Vue Router 相关
import path from 'path'
import { ref, reactive, computed, onBeforeMount, watch } from 'vue'
import { useRouter, useRoute } from 'vue-router'
// Element Plus 通知组件
import { ElNotification } from 'element-plus'
import { supportedPicBedList } from '@/manage/utils/constants'
import { invokeToMain } from '@/manage/utils/dataSender'
import { useManageStore } from '@/manage/store/manageStore'
import { newBucketConfig } from '@/manage/utils/newBucketConfig'
// 数据发送工具函数
import { invokeToMain } from '../utils/dataSender'
// 新建图床配置
import { newBucketConfig } from '../utils/newBucketConfig'
// 状态管理相关
import { useManageStore } from '../store/manageStore'
// 国际化函数
import { T as $T } from '@/i18n'
import path from 'path'
const manageStore = useManageStore() as any
const route = useRoute()

View File

@@ -241,15 +241,17 @@
</template>
<script lang="ts" setup>
import { ElMessage } from 'element-plus'
import { InfoFilled, Folder } from '@element-plus/icons-vue'
import { ref, onBeforeMount, watch } from 'vue'
import { getConfig, saveConfig, invokeToMain } from '../utils/dataSender'
import { ElMessage } from 'element-plus'
import { fileCacheDbInstance } from '../store/bucketFileDb'
import { formatFileSize, customRenameFormatTable } from '../utils/common'
import DynamicSwitch from '@/manage/components/DynamicSwitch.vue'
import { fileCacheDbInstance } from '@/manage/store/bucketFileDb'
import { formatFileSize, customRenameFormatTable } from '@/manage/utils/common'
import { getConfig, saveConfig, invokeToMain } from '@/manage/utils/dataSender'
import { selectDownloadFolder } from '@/manage/utils/static'
import { T as $T } from '@/i18n'
import { selectDownloadFolder } from '../utils/static'
import DynamicSwitch from '../components/DynamicSwitch.vue'
const form = ref<IStringKeyMap>({
timestampRename: false,

View File

@@ -1,5 +1,6 @@
import { defineStore } from 'pinia'
import { getConfig } from '../utils/dataSender'
import { getConfig } from '@/manage/utils/dataSender'
export const useManageStore = defineStore('manageConfig', {
state: () => {

View File

@@ -1,20 +1,11 @@
// UUID
import crypto from 'crypto'
import path from 'path'
import { v4 as uuidv4 } from 'uuid'
// 路径处理库
import path from 'path'
import { availableIconList } from '@/manage/utils/icon'
import { getConfig } from '@/manage/utils/dataSender'
// 加密库
import crypto from 'crypto'
// 可用图标列表
import { availableIconList } from './icon'
// 数据发送工具函数
import { getConfig } from './dataSender'
// 工具函数
import { handleUrlEncode, safeSliceF, isNeedToShorten } from '~/universal/utils/common'
import { handleUrlEncode, safeSliceF, isNeedToShorten } from '#/utils/common'
export function randomStringGenerator (length: number): string {
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'

View File

@@ -1,12 +1,14 @@
import { ipcRenderer, IpcRendererEvent } from 'electron'
import { PICLIST_MANAGE_GET_CONFIG, PICLIST_MANAGE_SAVE_CONFIG, PICLIST_MANAGE_REMOVE_CONFIG } from '~/main/manage/events/constants'
import { v4 as uuid } from 'uuid'
import { getRawData } from '~/renderer/utils/common'
import { getRawData } from '@/utils/common'
import { PICLIST_MANAGE_GET_CONFIG, PICLIST_MANAGE_SAVE_CONFIG, PICLIST_MANAGE_REMOVE_CONFIG } from '~/manage/events/constants'
export function getConfig<T> (key?: string): Promise<T | undefined> {
return new Promise((resolve) => {
const callbackId = uuid()
const callback = (event: IpcRendererEvent, config: T | undefined, returnCallbackId: string) => {
const callback = (_: IpcRendererEvent, config: T | undefined, returnCallbackId: string) => {
if (returnCallbackId === callbackId) {
resolve(config)
ipcRenderer.removeListener(PICLIST_MANAGE_GET_CONFIG, callback)

View File

@@ -1,4 +1,4 @@
import { AliyunAreaCodeName, QiniuAreaCodeName, TencentAreaCodeName } from '~/main/manage/utils/constants'
import { AliyunAreaCodeName, QiniuAreaCodeName, TencentAreaCodeName } from '~/manage/utils/constants'
import { T as $T } from '@/i18n'
export const newBucketConfig:IStringKeyMap = {

View File

@@ -10,10 +10,12 @@
</template>
<script lang="ts" setup>
import { getConfig } from '@/utils/dataSender'
import { onMounted, ref } from 'vue'
import { II18nLanguage } from '~/universal/types/enum'
import { configPaths } from '~/universal/utils/configPaths'
import { getConfig } from '@/utils/dataSender'
import { II18nLanguage } from '#/types/enum'
import { configPaths } from '#/utils/configPaths'
const srcUrl = ref('https://piclist.cn/app.html')

View File

@@ -458,50 +458,30 @@
</el-dialog>
</div>
</template>
<script lang="ts" setup>
// 类型声明
import type { IResult } from '@picgo/store/dist/types'
// 事件常量
import { PASTE_TEXT, GET_PICBEDS } from '#/events/constants'
// Element Plus 组件
import { CheckboxValueType, ElMessageBox, ElNotification, ElMessage } from 'element-plus'
// Element Plus 图标
import { InfoFilled, Close, CaretBottom, Document, Edit, Delete, CaretTop, Sort, Refresh } from '@element-plus/icons-vue'
// Electron 相关
import {
ipcRenderer,
clipboard,
IpcRendererEvent
} from 'electron'
// Vue 相关
import { CheckboxValueType, ElMessageBox, ElNotification, ElMessage } from 'element-plus'
import { InfoFilled, Close, CaretBottom, Document, Edit, Delete, CaretTop, Sort, Refresh } from '@element-plus/icons-vue'
import path from 'path'
import { computed, nextTick, onActivated, onBeforeUnmount, onBeforeMount, reactive, ref, watch } from 'vue'
// 数据发送工具函数
import { getConfig, saveConfig, sendToMain } from '@/utils/dataSender'
// Vue Router 相关
import { onBeforeRouteUpdate } from 'vue-router'
import type { IResult } from '@picgo/store/dist/types'
// 国际化函数
import ALLApi from '@/apis/allApi'
import { T as $T } from '@/i18n/index'
// 数据库操作
import { customRenameFormatTable, customStrMatch, customStrReplace } from '@/manage/utils/common'
import { getConfig, saveConfig, sendToMain } from '@/utils/dataSender'
import $$db from '@/utils/db'
// API 接口
import ALLApi from '@/apis/allApi'
// 工具函数
import { customRenameFormatTable, customStrMatch, customStrReplace } from '../manage/utils/common'
import { PASTE_TEXT, GET_PICBEDS } from '#/events/constants'
import { configPaths } from '#/utils/configPaths'
import { picBedsCanbeDeleted } from '#/utils/static'
import path from 'path'
import { configPaths } from '~/universal/utils/configPaths'
import { IPasteStyle } from '~/universal/types/enum'
import { IPasteStyle } from '#/types/enum'
const images = ref<ImgInfo[]>([])
const dialogVisible = ref(false)

View File

@@ -29,19 +29,22 @@
</div>
</div>
</template>
<script lang="ts" setup>
import { T as $T } from '@/i18n/index'
import { ElMessage as $message } from 'element-plus'
import {
ipcRenderer,
IpcRendererEvent
} from 'electron'
import { onBeforeUnmount, onBeforeMount, ref, watch } from 'vue'
import { SHOW_MINI_PAGE_MENU, SET_MINI_WINDOW_POS } from '~/universal/events/constants'
import { isUrl } from '~/universal/utils/common'
import { getConfig, sendToMain } from '@/utils/dataSender'
import { IConfig } from 'piclist'
import { onBeforeUnmount, onBeforeMount, ref, watch } from 'vue'
import { T as $T } from '@/i18n/index'
import { invokeToMain } from '@/manage/utils/dataSender'
import { getConfig, sendToMain } from '@/utils/dataSender'
import { SHOW_MINI_PAGE_MENU, SET_MINI_WINDOW_POS } from '#/events/constants'
import { isUrl } from '#/utils/common'
const logoPath = ref('')
const dragover = ref(false)

View File

@@ -1377,25 +1377,28 @@
</template>
<script lang="ts" setup>
import { compare } from 'compare-versions'
import { ipcRenderer } from 'electron'
import { ElForm, ElMessage as $message, ElMessage, ElMessageBox, FormRules } from 'element-plus'
import { Reading, Close, Edit, InfoFilled } from '@element-plus/icons-vue'
import pkg from 'root/package.json'
import { PICGO_OPEN_FILE, PICGO_OPEN_DIRECTORY, OPEN_URL, GET_PICBEDS, HIDE_DOCK } from '#/events/constants'
import { II18nLanguage, IRPCActionType, ISartMode } from '~/universal/types/enum'
import { ipcRenderer } from 'electron'
import { i18nManager, T as $T } from '@/i18n/index'
import { enforceNumber } from '~/universal/utils/common'
import { getLatestVersion } from '#/utils/getLatestVersion'
import { compare } from 'compare-versions'
import { computed, onBeforeMount, onBeforeUnmount, reactive, ref, toRaw, watch } from 'vue'
import { getConfig, saveConfig, sendRPC, sendToMain } from '@/utils/dataSender'
import { useRouter } from 'vue-router'
import { SHORTKEY_PAGE } from '@/router/config'
import { IConfig } from 'piclist'
import { invokeToMain } from '@/manage/utils/dataSender'
import { buildInRenameFormatTable } from '../manage/utils/common'
import { configPaths, ISartModeValues } from '~/universal/utils/configPaths'
import { computed, onBeforeMount, onBeforeUnmount, reactive, ref, toRaw, watch } from 'vue'
import { useRouter } from 'vue-router'
import ImageProcessSetting from '@/components/ImageProcessSetting.vue'
import { i18nManager, T as $T } from '@/i18n/index'
import { buildInRenameFormatTable } from '@/manage/utils/common'
import { invokeToMain } from '@/manage/utils/dataSender'
import { SHORTKEY_PAGE } from '@/router/config'
import { getConfig, saveConfig, sendRPC, sendToMain } from '@/utils/dataSender'
import { PICGO_OPEN_FILE, PICGO_OPEN_DIRECTORY, OPEN_URL, GET_PICBEDS, HIDE_DOCK } from '#/events/constants'
import { II18nLanguage, IRPCActionType, ISartMode } from '#/types/enum'
import { enforceNumber } from '#/utils/common'
import { configPaths, ISartModeValues } from '#/utils/configPaths'
import { getLatestVersion } from '#/utils/getLatestVersion'
import pkg from 'root/package.json'
const $router = useRouter()
const activeName = ref<'system' | 'syncAndConfigure' | 'upload' | 'advanced' | 'upadte'>('system')

View File

@@ -227,16 +227,22 @@
</el-dialog>
</div>
</template>
<script lang="ts" setup>
import { Close, Download, Refresh, Goods, Remove, Tools } from '@element-plus/icons-vue'
import { T as $T } from '@/i18n/index'
import ConfigForm from '@/components/ConfigFormForPlugin.vue'
import { debounce, DebouncedFunc } from 'lodash'
import axios from 'axios'
import {
ipcRenderer,
IpcRendererEvent
} from 'electron'
import { handleStreamlinePluginName } from '~/universal/utils/common'
import { ElMessageBox } from 'element-plus'
import { debounce, DebouncedFunc } from 'lodash'
import { Close, Download, Refresh, Goods, Remove, Tools } from '@element-plus/icons-vue'
import { computed, ref, onBeforeMount, onBeforeUnmount, watch, onMounted, reactive, toRaw } from 'vue'
import ConfigForm from '@/components/ConfigFormForPlugin.vue'
import { T as $T } from '@/i18n/index'
import { getConfig, saveConfig, sendRPC, sendToMain } from '@/utils/dataSender'
import {
OPEN_URL,
PICGO_CONFIG_PLUGIN,
@@ -246,12 +252,9 @@ import {
GET_PICBEDS,
PICGO_HANDLE_PLUGIN_DONE
} from '#/events/constants'
import { computed, ref, onBeforeMount, onBeforeUnmount, watch, onMounted, reactive, toRaw } from 'vue'
import { getConfig, saveConfig, sendRPC, sendToMain } from '@/utils/dataSender'
import { ElMessageBox } from 'element-plus'
import axios from 'axios'
import { IRPCActionType } from '~/universal/types/enum'
import { configPaths } from '~/universal/utils/configPaths'
import { IRPCActionType } from '#/types/enum'
import { handleStreamlinePluginName } from '#/utils/common'
import { configPaths } from '#/utils/configPaths'
const $confirm = ElMessageBox.confirm
const searchText = ref('')

View File

@@ -53,14 +53,16 @@
</template>
<script lang="ts" setup>
import { Close } from '@element-plus/icons-vue'
import { GET_RENAME_FILE_NAME, RENAME_FILE_NAME } from '#/events/constants'
import { sendToMain } from '@/utils/dataSender'
import { T as $T } from '@/i18n/index'
import { ipcRenderer, IpcRendererEvent } from 'electron'
import { onBeforeUnmount, onBeforeMount, ref, reactive } from 'vue'
import { useIPCOn } from '@/hooks/useIPC'
import { FormInstance } from 'element-plus'
import { Close } from '@element-plus/icons-vue'
import { onBeforeUnmount, onBeforeMount, ref, reactive } from 'vue'
import { useIPCOn } from '@/hooks/useIPC'
import { T as $T } from '@/i18n/index'
import { sendToMain } from '@/utils/dataSender'
import { GET_RENAME_FILE_NAME, RENAME_FILE_NAME } from '#/events/constants'
const id = ref<string | null>(null)
const formRef = ref<FormInstance>()

View File

@@ -116,14 +116,17 @@
</el-dialog>
</div>
</template>
<script lang="ts" setup>
import keyBinding from '@/utils/key-binding'
import { ipcRenderer, IpcRendererEvent } from 'electron'
import { TOGGLE_SHORTKEY_MODIFIED_MODE } from '#/events/constants'
import { onBeforeUnmount, onBeforeMount, ref, watch } from 'vue'
import { getConfig, sendToMain } from '@/utils/dataSender'
import { T as $T } from '@/i18n'
import { configPaths } from '~/universal/utils/configPaths'
import { getConfig, sendToMain } from '@/utils/dataSender'
import keyBinding from '@/utils/key-binding'
import { TOGGLE_SHORTKEY_MODIFIED_MODE } from '#/events/constants'
import { configPaths } from '#/utils/configPaths'
const list = ref<IShortKeyConfig[]>([])
const keyBindingVisible = ref(false)

View File

@@ -94,28 +94,18 @@
</el-collapse>
</div>
</template>
<script lang="ts" setup>
// 自定义钩子
import { useIPC } from '@/hooks/useIPC'
// 数据发送工具函数
import { sendRPC, triggerRPC } from '@/utils/dataSender'
// Element Plus 消息框组件
import { ElMessageBox } from 'element-plus'
// Vue 相关
import { computed, reactive, ref } from 'vue'
// 枚举类型声明
import { IToolboxItemType, IToolboxItemCheckStatus, IRPCActionType } from '~/universal/types/enum'
// 国际化函数
import { T as $T } from '@/i18n'
// 组件
import ToolboxStatusIcon from '@/components/ToolboxStatusIcon.vue'
import ToolboxHandler from '@/components/ToolboxHandler.vue'
import { useIPC } from '@/hooks/useIPC'
import { T as $T } from '@/i18n'
import { sendRPC, triggerRPC } from '@/utils/dataSender'
import { IToolboxItemType, IToolboxItemCheckStatus, IRPCActionType } from '#/types/enum'
const $confirm = ElMessageBox.confirm
const defaultLogo = ref(`file://${__static.replace(/\\/g, '/')}/roundLogo.png`)

View File

@@ -62,16 +62,19 @@
</template>
<script lang="ts" setup>
import { reactive, ref, onBeforeUnmount, onBeforeMount } from 'vue'
import { clipboard, ipcRenderer } from 'electron'
import $$db from '@/utils/db'
import { T as $T } from '@/i18n/index'
import { reactive, ref, onBeforeUnmount, onBeforeMount } from 'vue'
import { IResult } from '@picgo/store/dist/types'
import { OPEN_WINDOW } from '#/events/constants'
import { IPasteStyle, IWindowList } from '#/types/enum'
import { T as $T } from '@/i18n/index'
import { getConfig, sendToMain } from '@/utils/dataSender'
import $$db from '@/utils/db'
import { IPasteStyle, IWindowList } from '#/types/enum'
import { OPEN_WINDOW } from '#/events/constants'
import { handleUrlEncode } from '#/utils/common'
import { configPaths } from '~/universal/utils/configPaths'
import { configPaths } from '#/utils/configPaths'
const files = ref<IResult<ImgInfo>[]>([])
const notification = reactive({

View File

@@ -154,27 +154,29 @@
</template>
<script lang="ts" setup>
import { UploadFilled, CaretBottom } from '@element-plus/icons-vue'
import { ipcRenderer, IpcRendererEvent } from 'electron'
import { ElMessage as $message } from 'element-plus'
import { UploadFilled, CaretBottom } from '@element-plus/icons-vue'
import { ref, onBeforeMount, onBeforeUnmount, watch } from 'vue'
import { useRouter } from 'vue-router'
import ImageProcessSetting from '@/components/ImageProcessSetting.vue'
import { T as $T } from '@/i18n'
import { PICBEDS_PAGE } from '@/router/config'
import $bus from '@/utils/bus'
import { getConfig, saveConfig, sendToMain, triggerRPC } from '@/utils/dataSender'
import {
SHOW_INPUT_BOX,
SHOW_INPUT_BOX_RESPONSE,
SHOW_UPLOAD_PAGE_MENU,
GET_PICBEDS
} from '~/universal/events/constants'
} from '#/events/constants'
import { IPasteStyle, IRPCActionType } from '#/types/enum'
import {
isUrl
} from '~/universal/utils/common'
import { ElMessage as $message } from 'element-plus'
import { getConfig, saveConfig, sendToMain, triggerRPC } from '@/utils/dataSender'
import { useRouter } from 'vue-router'
import { PICBEDS_PAGE } from '@/router/config'
import { IPasteStyle, IRPCActionType } from '~/universal/types/enum'
import { configPaths } from '~/universal/utils/configPaths'
import ImageProcessSetting from '@/components/ImageProcessSetting.vue'
} from '#/utils/common'
import { configPaths } from '#/utils/configPaths'
const $router = useRouter()

View File

@@ -91,35 +91,21 @@
</el-row>
</div>
</template>
<script lang="ts" setup>
// Element Plus 图标
import { Edit, Delete, Plus } from '@element-plus/icons-vue'
// 数据发送工具函数
<script lang="ts" setup>
import dayjs from 'dayjs'
import { ipcRenderer } from 'electron'
import { Edit, Delete, Plus } from '@element-plus/icons-vue'
import { onBeforeMount, ref } from 'vue'
import { useRouter, useRoute, onBeforeRouteUpdate } from 'vue-router'
import { saveConfig, triggerRPC } from '@/utils/dataSender'
// 时间处理库
import dayjs from 'dayjs'
// 枚举类型声明
import { IRPCActionType } from '~/universal/types/enum'
// 国际化函数
import { T as $T } from '@/i18n/index'
// Vue Router 相关
import { useRouter, useRoute, onBeforeRouteUpdate } from 'vue-router'
// Vue 生命周期钩子
import { onBeforeMount, ref } from 'vue'
// 路由配置常量
import { useStore } from '@/hooks/useStore'
import { PICBEDS_PAGE, UPLOADER_CONFIG_PAGE } from '@/router/config'
// 状态管理
import { useStore } from '@/hooks/useStore'
import { configPaths } from '~/universal/utils/configPaths'
import { ipcRenderer } from 'electron'
import { IRPCActionType } from '#/types/enum'
import { configPaths } from '#/utils/configPaths'
const $router = useRouter()
const $route = useRoute()

View File

@@ -97,24 +97,25 @@
</template>
<script lang="ts" setup>
import { II18nLanguage, IRPCActionType } from '~/universal/types/enum'
import { ref, onBeforeUnmount, onBeforeMount } from 'vue'
import { T as $T } from '@/i18n/index'
import { getConfig, sendToMain, triggerRPC } from '@/utils/dataSender'
import { useRoute, useRouter } from 'vue-router'
import ConfigForm from '@/components/ConfigForm.vue'
import dayjs from 'dayjs'
import {
clipboard,
ipcRenderer,
IpcRendererEvent
} from 'electron'
import { OPEN_URL } from '~/universal/events/constants'
import { Link } from '@element-plus/icons-vue'
import dayjs from 'dayjs'
import { ElDropdown, ElMessage } from 'element-plus'
import { configPaths } from '~/universal/utils/configPaths'
import { picBedManualUrlList } from '~/universal/utils/static'
import { Link } from '@element-plus/icons-vue'
import { ref, onBeforeUnmount, onBeforeMount } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import ConfigForm from '@/components/ConfigForm.vue'
import { T as $T } from '@/i18n/index'
import { getConfig, sendToMain, triggerRPC } from '@/utils/dataSender'
import { OPEN_URL } from '#/events/constants'
import { II18nLanguage, IRPCActionType } from '#/types/enum'
import { configPaths } from '#/utils/configPaths'
import { picBedManualUrlList } from '#/utils/static'
const type = ref('')
const config = ref<IPicGoPluginConfig[]>([])

View File

@@ -1,3 +1,4 @@
export const DocumentPage = 'DocumentPage'
export const GALLERY_PAGE = 'GalleryPage'
export const MANAGE_BUCKET_PAGE = 'ManageBucketPage'
export const MANAGE_EMPTY_PAGE = 'ManageEmptyPage'
@@ -15,4 +16,3 @@ export const TOOLBOX_CONFIG_PAGE = 'ToolBoxPage'
export const TRAY_PAGE = 'TrayPage'
export const UPLOAD_PAGE = 'UploadPage'
export const UPLOADER_CONFIG_PAGE = 'UploaderConfigPage'
export const DocumentPage = 'DocumentPage'

View File

@@ -1,5 +1,5 @@
import { createRouter, createWebHashHistory } from 'vue-router'
import * as config from './config'
import * as config from '@/router/config'
export default createRouter({
history: createWebHashHistory(),

View File

@@ -1,6 +1,6 @@
import { reactive, InjectionKey, readonly, App, UnwrapRef, ref } from 'vue'
import { saveConfig } from '@/utils/dataSender'
import { configPaths } from '~/universal/utils/configPaths'
import { configPaths } from '#/utils/configPaths'
export interface IState {
defaultPicBed: string

View File

@@ -1,10 +1,13 @@
/* eslint-disable camelcase */
import { ipcRenderer } from 'electron'
import {
TALKING_DATA_APPID, TALKING_DATA_EVENT
} from '~/universal/events/constants'
} from '#/events/constants'
import { handleTalkingDataEvent } from '@/utils/common'
import pkg from 'root/package.json'
import { ipcRenderer } from 'electron'
import { handleTalkingDataEvent } from './common'
const { version } = pkg
export const initTalkingData = () => {

View File

@@ -3,7 +3,7 @@ import {
SHOW_INPUT_BOX,
SHOW_INPUT_BOX_RESPONSE,
FORCE_UPDATE
} from '~/universal/events/constants'
} from '#/events/constants'
type IEvent ={
[SHOW_INPUT_BOX_RESPONSE]: string

View File

@@ -1,7 +1,8 @@
import { isReactive, isRef, toRaw, unref } from 'vue'
import { ipcRenderer } from 'electron'
import { OPEN_URL } from '~/universal/events/constants'
import { ILogType } from '~/universal/types/enum'
import { isReactive, isRef, toRaw, unref } from 'vue'
import { OPEN_URL } from '#/events/constants'
import { ILogType } from '#/types/enum'
const isDevelopment = process.env.NODE_ENV !== 'production'
export const handleTalkingDataEvent = (data: ITalkingDataOptions) => {

View File

@@ -1,17 +1,10 @@
// Electron 相关
import { ipcRenderer, IpcRendererEvent } from 'electron'
// 事件常量
import { PICGO_SAVE_CONFIG, PICGO_GET_CONFIG, RPC_ACTIONS } from '#/events/constants'
// UUID
import { v4 as uuid } from 'uuid'
// 枚举类型声明
import { IRPCActionType } from '~/universal/types/enum'
import { getRawData } from '@/utils/common'
// 公共工具函数
import { getRawData } from './common'
import { PICGO_SAVE_CONFIG, PICGO_GET_CONFIG, RPC_ACTIONS } from '#/events/constants'
import { IRPCActionType } from '#/types/enum'
export function saveConfig (config: IObj | string, value?: any) {
const configObject = typeof config === 'string' ? { [config]: value } : getRawData(config)

View File

@@ -1,13 +1,9 @@
// Picgo Store 相关类型
import { ipcRenderer, IpcRendererEvent } from 'electron'
import { v4 as uuid } from 'uuid'
import { IObject, IResult, IGetResult, IFilter } from '@picgo/store/dist/types'
// Electron 相关
import { ipcRenderer, IpcRendererEvent } from 'electron'
import { getRawData } from '@/utils/common'
// UUID
import { v4 as uuid } from 'uuid'
// 数据库操作常量
import {
PICGO_GET_DB,
PICGO_INSERT_DB,
@@ -16,13 +12,8 @@ import {
PICGO_GET_BY_ID_DB,
PICGO_REMOVE_BY_ID_DB
} from '#/events/constants'
// 数据库类型声明
import { IGalleryDB } from '#/types/extra-vue'
// 公共工具函数
import { getRawData } from './common'
export class GalleryDB implements IGalleryDB {
async get<T> (filter?: IFilter): Promise<IGetResult<T>> {
const res = await this.#msgHandler<IGetResult<T>>(PICGO_GET_DB, filter)

View File

@@ -1,7 +1,9 @@
import { ComponentOptions } from 'vue'
import { FORCE_UPDATE, GET_PICBEDS } from '~/universal/events/constants'
import bus from '~/renderer/utils/bus'
import { ipcRenderer } from 'electron'
import { ComponentOptions } from 'vue'
import bus from '@/utils/bus'
import { FORCE_UPDATE, GET_PICBEDS } from '#/events/constants'
export const mainMixin: ComponentOptions = {
inject: ['forceUpdateTime'],