Commit 343d2f72 by lixinming

打开首页埋点

parent d2195869
......@@ -25,7 +25,7 @@ export async function addPoint(pointType:number, uid:string, pointId:number, p1,
} else if (pointId == ENTERPRISENODEENUM.政策速递) {
pointInfo.p1 = p1;
post(url, {pointInfo, pointId}, {sign});
} else if (pointId == ENTERPRISENODEENUM.登录) {
} else if (pointId == ENTERPRISENODEENUM.进入首页) {
post(url, {pointInfo, pointId}, {sign});
} else {
/**数组类型 or 对象类型 */
......@@ -54,7 +54,7 @@ export async function addPoint(pointType:number, uid:string, pointId:number, p1,
if (pointId == FUHUAQINODEENUM.政策速递 ) {
pointInfo.p1 = p1;
post(url, {pointInfo, pointId}, {sign});
} else if (pointId == FUHUAQINODEENUM.登录) {
} else if (pointId == FUHUAQINODEENUM.进入首页) {
post(url, {pointInfo, pointId}, {sign});
} else {
pointInfo.pid = pointId;
......
......@@ -17,7 +17,7 @@ export enum FUHUAQINODEENUM {
我的企业_孵化状态,
我的企业_占孵面积,
我的企业_补录企业 = 15,
登录
进入首页
}
......@@ -40,7 +40,7 @@ export enum ENTERPRISENODEENUM {
经营数据补录_营业收入,
经营数据补录_研发投入,
经营数据补录_纳税 = 15,
登录
进入首页
}
......
/**
* 用作前端埋点的接口
* 埋点中的登录埋点为 模拟登录埋点 埋点的规则是 进入首页并且不是二级页面返回 (这里要前端判断用户行为)
*/
import * as asyncHandler from 'express-async-handler';
import { checkEnterpriseToken, checkFuHuaQiToken} from '../middleware/user';
import { addPoint } from '../biz/point';
import { FUHUAQINODEENUM, POINTTYPEENUM } from '../config/pointConfig';
export function setRouter(httpServer) {
/** 孵化器端 */
httpServer.post('/point/fuhuaqi/open', checkFuHuaQiToken, asyncHandler(fuHuaQiLoginPoint) );
/**企业端 */
httpServer.post('/point/enterprise/open', checkEnterpriseToken, asyncHandler(enterpriseLoginPoint) );
}
/**
* 孵化器登录埋点
* @param req
* @param res
*/
async function fuHuaQiLoginPoint(req, res) {
const Uscc = req.headers.uscc;
addPoint(POINTTYPEENUM.孵化器, Uscc, FUHUAQINODEENUM.进入首页, null);
res.success({isSuccess:true});
}
/**
* 企业登录埋点
* @param req
* @param res
*/
async function enterpriseLoginPoint(req, res) {
const Uscc = req.headers.uscc;
addPoint(POINTTYPEENUM.孵化器, Uscc, FUHUAQINODEENUM.进入首页, null);
res.success({isSuccess:true});
}
......@@ -31,7 +31,9 @@ import * as enterpriseMobileDatadeclarationRouters from './enterpriseMobileClien
import * as enterpriseMobileUserRouters from './enterpriseMobileClient/user';
import * as enterpriseMobileFinancingRouters from './enterpriseMobileClient/financing';
import * as testABIRouters from "./mobileClient/testAbi"
import * as testABIRouters from "./mobileClient/testAbi";
import * as pointRouters from "./point";
export function setRouter(httpServer){
......@@ -69,4 +71,6 @@ export function setRouter(httpServer){
enterpriseMobileFinancingRouters.setRouter(httpServer);
/**abi接口 */
testABIRouters.setRouter(httpServer);
/**埋点接口 */
pointRouters.setRouter(httpServer);
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment