mirror of
https://github.com/rubickCenter/rubick
synced 2025-06-18 01:26:57 +08:00
🐛 修复系统插件无法打开ui界面问题
This commit is contained in:
parent
8107d74537
commit
240175c571
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "rubick",
|
"name": "rubick",
|
||||||
"version": "2.0.1-beta.16",
|
"version": "2.0.1-beta.17",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve",
|
"serve": "vue-cli-service serve",
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import path from "path";
|
import path from "path";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import getLocalDataFile from "./getLocalDataFile";
|
import getLocalDataFile from "./getLocalDataFile";
|
||||||
import commonConst from "./commonConst";
|
|
||||||
import defaultConfigForAnyPlatform from "../constans/defaultConfig";
|
import defaultConfigForAnyPlatform from "../constans/defaultConfig";
|
||||||
|
|
||||||
const configPath = path.join(getLocalDataFile(), "./rubick-config.json");
|
const configPath = path.join(getLocalDataFile(), "./rubick-config.json");
|
||||||
@ -10,34 +9,34 @@ global.OP_CONFIG = {
|
|||||||
config: null,
|
config: null,
|
||||||
get() {
|
get() {
|
||||||
try {
|
try {
|
||||||
if (!global.config) {
|
if (!global.OP_CONFIG.config) {
|
||||||
global.config = JSON.parse(
|
global.OP_CONFIG.config = JSON.parse(
|
||||||
fs.readFileSync(configPath, "utf8") ||
|
fs.readFileSync(configPath, "utf8") ||
|
||||||
JSON.stringify(defaultConfigForAnyPlatform)
|
JSON.stringify(defaultConfigForAnyPlatform)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// 重置
|
// 重置
|
||||||
if (
|
if (
|
||||||
!global.config.version ||
|
!global.OP_CONFIG.config.version ||
|
||||||
global.config.version < defaultConfigForAnyPlatform.version
|
global.OP_CONFIG.config.version < defaultConfigForAnyPlatform.version
|
||||||
) {
|
) {
|
||||||
global.config = defaultConfigForAnyPlatform;
|
global.OP_CONFIG.config = defaultConfigForAnyPlatform;
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
configPath,
|
configPath,
|
||||||
JSON.stringify(defaultConfigForAnyPlatform)
|
JSON.stringify(defaultConfigForAnyPlatform)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return global.config;
|
return global.OP_CONFIG.config;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
global.config = defaultConfigForAnyPlatform;
|
global.OP_CONFIG.config = defaultConfigForAnyPlatform;
|
||||||
return global.config;
|
return global.OP_CONFIG.config;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
set(value) {
|
set(value) {
|
||||||
global.config = {
|
global.OP_CONFIG.config = {
|
||||||
...global.config,
|
...global.OP_CONFIG.config,
|
||||||
...value,
|
...value,
|
||||||
};
|
};
|
||||||
fs.writeFileSync(configPath, JSON.stringify(global.config));
|
fs.writeFileSync(configPath, JSON.stringify(global.OP_CONFIG.config));
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -28,7 +28,7 @@ const createPluginManager = (): any => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const openPlugin = (plugin) => {
|
const openPlugin = (plugin) => {
|
||||||
if (plugin.pluginType === "ui") {
|
if (plugin.pluginType === "ui" || plugin.pluginType === "system") {
|
||||||
if (state.currentPlugin && state.currentPlugin.name === plugin.name) {
|
if (state.currentPlugin && state.currentPlugin.name === plugin.name) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user