diff --git a/src/api_s2c/user/ApiChangeInfo.ts b/src/api_s2c/user/ApiChangeInfo.ts index 012bb9f..fdb78f5 100644 --- a/src/api_s2c/user/ApiChangeInfo.ts +++ b/src/api_s2c/user/ApiChangeInfo.ts @@ -6,13 +6,13 @@ import {UserShared} from '../../shared/public/user'; export default async function (call: ApiCall) { - if (call.req.type == 'model' && !call.req.pos) return call.error(globalThis.lng.shiwu_6); + // if (call.req.type == 'model' && !call.req.pos) return call.error(globalThis.lng.shiwu_6); const active = (await G.mongodb.collection('playerInfo', 'playerInfo').findOne({ uid: call.uid, type: 'playerInfo' }))?.active || {}; - const fmtId = UserShared.getInfoId(call.req.type, call.req.id, call.req.pos || ''); + const fmtId = UserShared.getInfoId(call.req.type, call.req.id); const isMeet = UserShared.chechIsActive(fmtId, { lv: call.conn.gud.lv, vip: call.conn.gud.vip, @@ -27,7 +27,7 @@ export default async function (call: ApiCall) { if (call.req.type == 'model') { let d = JSON.parse(JSON.stringify(call.conn.gud.model)); - d[call.req.pos] = { + d[call.req.id] = { id: call.req.id, time: active[fmtId] || -1 }; diff --git a/src/shared/public/user.ts b/src/shared/public/user.ts index 55361c3..26b3bc5 100644 --- a/src/shared/public/user.ts +++ b/src/shared/public/user.ts @@ -10,10 +10,10 @@ export class UserShared { */ static chechIsActive(fmtId: string, collection: Partial<{ lv: number, vip: number, lsyx: k_v, model: k_v, active: k_v; }>) { - const [type, id, pos] = fmtId.split('_'); + const [type, id] = fmtId.split('_'); const jsonName = 'player' + type.slice(0, 1).toLocaleUpperCase() + type.slice(1); const json = G.gc[jsonName] as any; - const conf: _gcType['playerHead'][''] = pos ? json[pos][id] : json[id]; + const conf: _gcType['playerHead'] = json[id]; if (conf.cond[0] == 'lv') return collection.lv >= conf.cond[1]; else if (conf.cond[0] == 'vip') return collection.vip >= conf.cond[1];