服务日志:增加区域信息

This commit is contained in:
刘祥超
2021-01-13 17:00:09 +08:00
parent e57aeb8b82
commit dffc806fcc
11 changed files with 131 additions and 48 deletions

View File

@@ -15,6 +15,16 @@ Tea.context(function () {
})
.success(function (resp) {
this.accessLogs = resp.data.accessLogs.concat(this.accessLogs)
// 添加区域信息
this.accessLogs.forEach(function (accessLog) {
if (typeof (resp.data.regions[accessLog.remoteAddr]) == "string") {
accessLog.region = resp.data.regions[accessLog.remoteAddr]
} else {
accessLog.region = ""
}
})
let max = 100
if (this.accessLogs.length > max) {
this.accessLogs = this.accessLogs.slice(0, max)