V 3.0.1 LaiTool V3.0.1-preview.3

This commit is contained in:
2024-08-08 16:24:47 +08:00
parent f3a25e9474
commit 36178fbe5d
40 changed files with 1545 additions and 581 deletions
+8 -1
View File
@@ -155,6 +155,13 @@ const migration = (oldRealm: Realm, newRealm: Realm) => {
newBookTask[i].subValue = '[]'
}
}
if (oldRealm.schemaVersion < 22) {
const oldBookTask = oldRealm.objects('Book')
const newBookTask = newRealm.objects('Book')
for (let i = 0; i < oldBookTask.length; i++) {
newBookTask[i].watermarkPosition = '[]'
}
}
}
export class BaseRealmService extends BaseService {
@@ -196,7 +203,7 @@ export class BaseRealmService extends BaseService {
BookTaskDetailModel
],
path: this.dbpath,
schemaVersion: 21,
schemaVersion: 22,
migration: migration
}
this.realm = await Realm.open(config)
+1 -1
View File
@@ -277,7 +277,7 @@ export class BookService extends BaseRealmService {
* @param bookId 小说的ID
* @param bookData 要修改的小说数据
*/
async UpdateBookData(bookId: string, bookData) {
async UpdateBookData(bookId: string, bookData: Book.SelectBook) {
try {
if (bookId == null) {
throw new Error('修改小说数据失败,缺少小说ID')