在旧数据迁移时备份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') {
let gameKey = this.gameKey(game)
// 兼容传入index
if (uid < 100 && this.uidList[gameKey][uid]) {
uid = this.uidList[gameKey][uid]?.uid
if (uid < 100 && this.uidMap[gameKey][uid]) {
uid = this.uidMap[gameKey][uid]?.uid
}
if (this.uidMap[gameKey][uid]) {
this.mainUid[gameKey] = uid

View File

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