|
@@ -55,11 +55,13 @@ class InterceptService extends CrudService {
|
|
|
if (arr.length <= 2) throw new BusinessError();
|
|
|
const _tenant = arr[1];
|
|
|
let project = await this.redis.get('project');
|
|
|
- if (!project) throw new BusinessError(ErrorCode.SERVICE_FAULT, '为设置中间层项目参数');
|
|
|
+ console.log(project);
|
|
|
+ if (!project) throw new BusinessError(ErrorCode.SERVICE_FAULT, '未设置中间层项目参数');
|
|
|
project = JSON.parse(project);
|
|
|
if (!project.includes(_tenant)) throw new BusinessError();
|
|
|
const obj = { ip: clientIp, create_time: moment().format('YYYY-MM-DD HH:mm:ss') };
|
|
|
// 访问量的添加
|
|
|
+ console.log('add visit');
|
|
|
let hitsList = await this.redis.get(`${_tenant}/hitsList`);
|
|
|
if (!hitsList) {
|
|
|
hitsList = [{ ...obj, route: url.pathname }];
|
|
@@ -73,6 +75,7 @@ class InterceptService extends CrudService {
|
|
|
}
|
|
|
}
|
|
|
// 用户(ip)访问添加
|
|
|
+ console.log('add ip');
|
|
|
let clientList = await this.redis.get(`${_tenant}/clientList`);
|
|
|
if (!clientList) {
|
|
|
clientList = [ obj ];
|