mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-06-04 11:13:59 +08:00
fix: 修复重置后端数据后无默认字段的问题
This commit is contained in:
parent
c5d8aff73c
commit
943edc696d
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.19.1",
|
"version": "2.19.2",
|
||||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
|
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -4,6 +4,8 @@ import {
|
|||||||
SCHEMA_VERSION_KEY,
|
SCHEMA_VERSION_KEY,
|
||||||
ARTIFACTS_KEY,
|
ARTIFACTS_KEY,
|
||||||
RULES_KEY,
|
RULES_KEY,
|
||||||
|
FILES_KEY,
|
||||||
|
TOKENS_KEY,
|
||||||
} from '@/constants';
|
} from '@/constants';
|
||||||
import $ from '@/core/app';
|
import $ from '@/core/app';
|
||||||
|
|
||||||
@ -55,7 +57,17 @@ function doMigrationV2() {
|
|||||||
const newRules = Object.values(rules);
|
const newRules = Object.values(rules);
|
||||||
$.write(newRules, RULES_KEY);
|
$.write(newRules, RULES_KEY);
|
||||||
|
|
||||||
// 5. delete builtin rules
|
// 5. migrate files
|
||||||
|
const files = $.read(FILES_KEY) || {};
|
||||||
|
const newFiles = Object.values(files);
|
||||||
|
$.write(newFiles, FILES_KEY);
|
||||||
|
|
||||||
|
// 6. migrate tokens
|
||||||
|
const tokens = $.read(TOKENS_KEY) || {};
|
||||||
|
const newTokens = Object.values(tokens);
|
||||||
|
$.write(newTokens, TOKENS_KEY);
|
||||||
|
|
||||||
|
// 6. delete builtin rules
|
||||||
delete $.cache.builtin;
|
delete $.cache.builtin;
|
||||||
$.info('Migration complete!');
|
$.info('Migration complete!');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user