在旧数据迁移时备份ck文件

This commit is contained in:
Kokomi 2023-05-11 06:23:55 +08:00
parent d2649e88fd
commit 289fc7a3e6
2 changed files with 5 additions and 7 deletions

View File

@ -283,8 +283,8 @@ export default class NoteUser extends BaseModel {
setMainUid (uid = '', game = 'gs') { setMainUid (uid = '', game = 'gs') {
let gameKey = this.gameKey(game) let gameKey = this.gameKey(game)
// 兼容传入index // 兼容传入index
if (uid < 100 && this.uidList[gameKey][uid]) { if (uid < 100 && this.uidMap[gameKey][uid]) {
uid = this.uidList[gameKey][uid]?.uid uid = this.uidMap[gameKey][uid]?.uid
} }
if (this.uidMap[gameKey][uid]) { if (this.uidMap[gameKey][uid]) {
this.mainUid[gameKey] = uid this.mainUid[gameKey] = uid

View File

@ -318,11 +318,9 @@ export default class User extends base {
} }
await user.save() await user.save()
if (fs.existsSync(`./data/MysCookie/${qq}.yaml`)) { if (fs.existsSync(`./data/MysCookie/${qq}.yaml`)) {
/* fs.rename(`./data/MysCookie/${qq}.yaml`, `./data/MysCookieBak/${qq}.yaml`, (err) => { fs.rename(`./data/MysCookie/${qq}.yaml`, `./data/MysCookieBak/${qq}.yaml`, (err) => {
if (err) { if (err) console.log(err)
console.log(err) })
}
}) */
} }
count++ count++
} }