添加ip归属地

This commit is contained in:
luying
2022-08-04 13:38:38 +08:00
parent b83d9db979
commit d656d12a74
9 changed files with 35 additions and 2 deletions

View File

@@ -57,7 +57,7 @@ export enum FRIEND_SHIP_SELECT {
GET_FRIEND_VALUE = 'friendValue friendLv'
}
export const ENTERY_ROLE_PICK = ['roleId', 'roleName', 'serverId', 'ce', 'topLineupCe', 'coin', 'lv', 'exp', 'vLv', 'gold', 'heros', 'jewels', 'consumeGoods', 'title', 'teraphs', 'showLineup', 'heads', 'head', 'frames', 'frame', 'spines', 'spine', 'hasGuild', 'guildCode', 'todayZeroPoint', 'apJson', 'skins', 'totalPay', 'guide', 'hasInit', 'renameCnt', 'totalCost', 'guildName', 'isVip', 'createTime'];
export const ENTERY_ROLE_PICK = ['roleId', 'roleName', 'serverId', 'ce', 'topLineupCe', 'coin', 'lv', 'exp', 'vLv', 'gold', 'heros', 'jewels', 'consumeGoods', 'title', 'teraphs', 'showLineup', 'heads', 'head', 'frames', 'frame', 'spines', 'spine', 'hasGuild', 'guildCode', 'todayZeroPoint', 'apJson', 'skins', 'totalPay', 'guide', 'hasInit', 'renameCnt', 'totalCost', 'guildName', 'isVip', 'createTime', 'ipLocation'];
export enum SURVEY_SELECT {
FIND = '-__v -_id -surveyName -roleIndex -reward -mailContent -receivedRole -createdAt -updatedAt'

View File

@@ -327,6 +327,13 @@ export default class Role extends BaseModel {
@prop({ required: false })
shushuMark: string; // 数数distinctId
// 最后登录 IP
@prop({ required: false })
ip: string;
@prop({ required: false })
ipLocation: string;
public static async findAllByUid(uid: number, getters = false, virtuals = true) {
const role: RoleType[] = await RoleModel.find({ 'userInfo.uid': uid }).select('roleId roleName serverId head frame spine heads frames spines lv updatedAt').lean({ getters, virtuals });
return role;

View File

@@ -88,6 +88,7 @@ export class PlayerDetail {
roleName: string;
lv: number;
title?: number = 1;
ipLocation: string = '';
head?: number = EXTERIOR.EXTERIOR_FACE;
frame?: number = EXTERIOR.EXTERIOR_FACECASE;
spine?: number = EXTERIOR.EXTERIOR_APPEARANCE;
@@ -126,6 +127,7 @@ export class PlayerDetail {
if(role.head) this.head = role.head;
if(role.frame) this.frame = role.frame;
if(role.spine) this.spine = role.spine;
if(role.ipLocation) this.ipLocation = role.ipLocation;
}
setCe(ce: number) {

View File

@@ -18,6 +18,7 @@ export class FriendParams {
serverName: string;
type: number = FRIEND_RELATION_TYPE.NORMAL;
guildName: string = '';
ipLocation: string = '';
constructor(role: RoleType) {
this.roleId = role.roleId;
@@ -29,6 +30,7 @@ export class FriendParams {
this.ce = role.ce;
this.title = role.title;
this.guildName = role.guildName||'';
this.ipLocation = role.ipLocation||'';
}
setServerName(serverId: number, serverName: string) {