1. opendb-verify-codes 添加device_uuid索引
2. opendb-id-log 去除 user_id 的required,添加 device_uuid 和 user_id索引
This commit is contained in:
DCloud_LXH 2021-01-27 18:07:52 +08:00
parent 421dfcc14f
commit 0188fba9eb
2 changed files with 49 additions and 9 deletions

View File

@ -68,5 +68,17 @@
}],
"MgoIsUnique": false
}
}, {
"IndexName": "device_uuid_code_",
"MgoKeySchema": {
"MgoIndexKeys": [{
"Name": "device_uuid",
"Direction": "1"
}, {
"Name": "code",
"Direction": "1"
}],
"MgoIsUnique": false
}
}]
}

View File

@ -1,7 +1,7 @@
{
"schema": {
"bsonType": "object",
"required": ["user_id"],
"required": [],
"properties": {
"_id": {
"description": "ID系统自动生成"
@ -16,17 +16,20 @@
},
"device_uuid": {
"bsonType": "string",
"description": "设备唯一标识(需要加密存储)"
"description": "设备唯一标识"
},
"type": {
"bsonType": "string",
"enum": ["login", "logout"],
"enum": [
"login",
"logout"
],
"description": "登录类型"
},
"state": {
"bsonType": "int",
"description": "结果0 失败、1 成功"
},
"state": {
"bsonType": "int",
"description": "结果0 失败、1 成功"
},
"ip": {
"bsonType": "string",
"description": "ip地址"
@ -40,5 +43,30 @@
}
}
},
"index": []
}
"index": [
{
"IndexName": "user_id",
"MgoKeySchema": {
"MgoIndexKeys": [
{
"Name": "user_id",
"Direction": "1"
}
],
"MgoIsUnique": true
}
},
{
"IndexName": "device_uuid",
"MgoKeySchema": {
"MgoIndexKeys": [
{
"Name": "device_uuid",
"Direction": "1"
}
],
"MgoIsUnique": true
}
}
]
}