修正user初始化时ltuid记录错误的问题

This commit is contained in:
Kokomi 2023-05-09 11:32:39 +08:00
parent 7268865d15
commit 821c080d1f
2 changed files with 3 additions and 2 deletions

View File

@ -88,11 +88,12 @@ export default class NoteUser extends BaseModel {
/** /**
* 创建NoteUser实例 * 创建NoteUser实例
* @param qq NoterUser对应idqq * @param qq NoterUser对应idqq
* @param db
* * 若传入e对象则会识别e.user_id并将user对象添加至e.user * * 若传入e对象则会识别e.user_id并将user对象添加至e.user
* @param data 用户对应MysCookie数据为空则自动读取 * @param data 用户对应MysCookie数据为空则自动读取
* @returns {Promise<NoteUser|*>} * @returns {Promise<NoteUser|*>}
*/ */
static async create (qq, db) { static async create (qq, db = false) {
// 兼容处理传入e // 兼容处理传入e
if (qq && qq.user_id) { if (qq && qq.user_id) {
let e = qq let e = qq

View File

@ -302,12 +302,12 @@ export default class User extends base {
} }
async loadOldData (data) { async loadOldData (data) {
let ltuids = {}
let count = 0 let count = 0
if (!lodash.isPlainObject(data)) { if (!lodash.isPlainObject(data)) {
return return
} }
for (let u in data) { for (let u in data) {
let ltuids = {}
let v = data[u] let v = data[u]
let qq let qq
for (let k in v) { for (let k in v) {