在旧数据迁移时备份ck文件
This commit is contained in:
		
							parent
							
								
									d2649e88fd
								
							
						
					
					
						commit
						289fc7a3e6
					
				| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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++
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue