tplus-api
Version:
tplus api invoke
21 lines (19 loc) • 686 B
text/typescript
import {aliyunLog} from 'mutants-log';
import User from '../model/User';
import tools from '../util/tools';
import {stores} from 'mutants-microfx';
interface LogParam{
eventId:string
}
export default function serverLog<T extends LogParam>(logstore:string,param:T){
const user = User.restore();
if(!tools.isNull(user.userId)){
//如果缓存中有登录信息 将登录参数附加
const {orgList,channel,...usermsg} = user;
usermsg.channel = channel.targetURL;
const concatParam = {...param,...usermsg,...stores.logStore.logParam.appParam};
aliyunLog(logstore,concatParam);
}else{
aliyunLog(logstore,param);
}
}