V 3.0.1 LaiTool V3.0.1-preview.3
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user