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