diff --git a/feature/src/assets/request/index.ts b/feature/src/assets/request/index.ts index c0d8cfb..2f255b3 100644 --- a/feature/src/assets/request/index.ts +++ b/feature/src/assets/request/index.ts @@ -1,10 +1,10 @@ -import axios from "axios"; +import axios from 'axios'; -let baseURL = "https://gitcode.net/rubickcenter/rubick-database/-/raw/master"; -let access_token = ""; +let baseURL = 'https://gitcode.net/rubickcenter/rubick-database/-/raw/master'; +let access_token = ''; try { - const dbdata = window.rubick.db.get("rubick-localhost-config"); + const dbdata = window.rubick.db.get('rubick-localhost-config'); baseURL = dbdata.data.database; access_token = dbdata.data.access_token; } catch (e) { @@ -12,40 +12,49 @@ try { } const instance = axios.create({ - baseURL: baseURL || "https://gitcode.net/rubickcenter/rubick-database/-/raw/master", + baseURL: + baseURL || 'https://gitcode.net/rubickcenter/rubick-database/-/raw/master', }); export default { async getTotalPlugins() { - let targetPath = "plugins/total-plugins.json"; + let targetPath = 'plugins/total-plugins.json'; if (access_token) { - targetPath = `${encodeURIComponent(targetPath)}/raw?access_token=${access_token}&ref=master` + targetPath = `${encodeURIComponent( + targetPath + )}/raw?access_token=${access_token}&ref=master`; } const res = await instance.get(targetPath); return res.data; }, async getFinderDetail() { - let targetPath = "plugins/finder.json"; + let targetPath = 'plugins/finder.json'; if (access_token) { - targetPath = `${encodeURIComponent(targetPath)}/raw?access_token=${access_token}&ref=master` + targetPath = `${encodeURIComponent( + targetPath + )}/raw?access_token=${access_token}&ref=master`; } const res = await instance.get(targetPath); return res.data; }, async getSystemDetail() { - let targetPath = "plugins/system.json"; + let targetPath = 'plugins/system.json'; if (access_token) { - targetPath = `${encodeURIComponent(targetPath)}/raw?access_token=${access_token}&ref=master` + targetPath = `${encodeURIComponent( + targetPath + )}/raw?access_token=${access_token}&ref=master`; } const res = await instance.get(targetPath); return res.data; }, async getWorkerDetail() { - let targetPath = "plugins/worker.json"; + let targetPath = 'plugins/worker.json'; if (access_token) { - targetPath = `${encodeURIComponent(targetPath)}/raw?access_token=${access_token}&ref=master` + targetPath = `${encodeURIComponent( + targetPath + )}/raw?access_token=${access_token}&ref=master`; } const res = await instance.get(targetPath); return res.data; @@ -57,17 +66,31 @@ export default { }, async getSearchDetail() { - let targetPath = "plugins/search.json"; + let targetPath = 'plugins/search.json'; if (access_token) { - targetPath = `${encodeURIComponent(targetPath)}/raw?access_token=${access_token}&ref=master` + targetPath = `${encodeURIComponent( + targetPath + )}/raw?access_token=${access_token}&ref=master`; } const res = await instance.get(targetPath); return res.data; }, async getDevDetail() { - let targetPath = "plugins/dev.json"; + let targetPath = 'plugins/dev.json'; if (access_token) { - targetPath = `${encodeURIComponent(targetPath)}/raw?access_token=${access_token}&ref=master` + targetPath = `${encodeURIComponent( + targetPath + )}/raw?access_token=${access_token}&ref=master`; + } + const res = await instance.get(targetPath); + return res.data; + }, + async getImageDetail() { + let targetPath = 'plugins/image.json'; + if (access_token) { + targetPath = `${encodeURIComponent( + targetPath + )}/raw?access_token=${access_token}&ref=master`; } const res = await instance.get(targetPath); return res.data; diff --git a/feature/src/views/market/components/image.vue b/feature/src/views/market/components/image.vue index 7420502..67f46c1 100644 --- a/feature/src/views/market/components/image.vue +++ b/feature/src/views/market/components/image.vue @@ -1,13 +1,49 @@ - - diff --git a/feature/src/views/market/index.vue b/feature/src/views/market/index.vue index f3cc69a..c2a12b3 100644 --- a/feature/src/views/market/index.vue +++ b/feature/src/views/market/index.vue @@ -71,11 +71,13 @@ import System from "./components/system.vue"; import Worker from "./components/worker.vue"; import Tools from "./components/tools.vue"; import Dev from "./components/devlopment.vue"; +import Image from "./components/image.vue"; const Components = { finder: Finder, system: System, worker: Worker, + image: Image, tools: Tools, dev: Dev, }; diff --git a/package.json b/package.json index a8f1a9a..a01ee78 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rubick", - "version": "2.1.6", + "version": "2.1.7", "author": "muwoo <2424880409@qq.com>", "private": true, "scripts": { @@ -21,7 +21,7 @@ "dependencies": { "@better-scroll/core": "^2.4.2", "ant-design-vue": "^2.2.8", - "axios": "^1.3.4", + "axios": q"^1.3.4", "core-js": "^3.6.5", "cross-spawn": "^7.0.3", "extract-file-icon": "^0.3.2", diff --git a/src/main/index.ts b/src/main/index.ts index 7b0f8a5..806aab6 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -1,22 +1,22 @@ -"use strict"; +'use strict'; import electron, { app, globalShortcut, protocol, - BrowserWindow -} from "electron"; -import { main } from "./browsers"; -import commonConst from "../common/utils/commonConst"; + BrowserWindow, +} from 'electron'; +import { main } from './browsers'; +import commonConst from '../common/utils/commonConst'; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore -import API from "./common/api"; -import createTray from "./common/tray"; -import registerHotKey from "./common/registerHotKey"; +import API from './common/api'; +import createTray from './common/tray'; +import registerHotKey from './common/registerHotKey'; -import "../common/utils/localPlugin"; -import "../common/utils/localConfig"; +import '../common/utils/localPlugin'; +import '../common/utils/localConfig'; -import registerySystemPlugin from "./common/registerySystemPlugin"; +import registerySystemPlugin from './common/registerySystemPlugin'; class App { public windowCreator: { init: () => void; getWindow: () => BrowserWindow }; @@ -24,7 +24,7 @@ class App { constructor() { protocol.registerSchemesAsPrivileged([ - { scheme: "app", privileges: { secure: true, standard: true } } + { scheme: 'app', privileges: { secure: true, standard: true } }, ]); this.windowCreator = main(); const gotTheLock = app.requestSingleInstanceLock(); @@ -66,14 +66,14 @@ class App { ); }; if (!app.isReady()) { - app.on("ready", readyFunction); + app.on('ready', readyFunction); } else { readyFunction(); } } onRunning() { - app.on("second-instance", () => { + app.on('second-instance', () => { // 当运行第二个实例时,将会聚焦到myWindow这个窗口 const win = this.windowCreator.getWindow(); if (win) { @@ -83,7 +83,7 @@ class App { win.focus(); } }); - app.on("activate", () => { + app.on('activate', () => { if (!this.windowCreator.getWindow()) { this.createWindow(); } @@ -94,25 +94,25 @@ class App { } onQuit() { - app.on("window-all-closed", () => { - if (process.platform !== "darwin") { + app.on('window-all-closed', () => { + if (process.platform !== 'darwin') { app.quit(); } }); - app.on("will-quit", () => { + app.on('will-quit', () => { globalShortcut.unregisterAll(); }); if (commonConst.dev()) { - if (process.platform === "win32") { - process.on("message", data => { - if (data === "graceful-exit") { + if (process.platform === 'win32') { + process.on('message', (data) => { + if (data === 'graceful-exit') { app.quit(); } }); } else { - process.on("SIGTERM", () => { + process.on('SIGTERM', () => { app.quit(); }); }