You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
891 B
30 lines
891 B
import store from '@/store'
|
|
import { diyApi } from '@/utils/queryByDiy';
|
|
import { setNodeId, getNodeId } from '@/utils/nodeId'
|
|
import { getLongRandom } from '@/utils/nineTool';
|
|
|
|
export function saveAccessLog(to, f) {
|
|
// 开发环境不保存日志
|
|
if(import.meta.env.VITE_APP_ENV == 'development'){
|
|
return;
|
|
}
|
|
// 生成一个nodeId,用于记录日志
|
|
let nodeId = getNodeId();
|
|
if(!nodeId){
|
|
nodeId = getLongRandom(24)
|
|
setNodeId(nodeId)
|
|
}
|
|
let flag = getApp().globalData.terminal + "_" + f;
|
|
let data = {
|
|
platform: getApp().globalData.appId,
|
|
terminal: getApp().globalData.terminal,
|
|
nodeId: nodeId,
|
|
flag: getApp().globalData.terminal + "_" + f,
|
|
fullPath: to.url.split("?")[0],
|
|
allPath: to.url,
|
|
menuName: to.tabBarText,
|
|
userId: store.state.user.userInfo.userId,
|
|
userName: store.state.user.userInfo.userName
|
|
}
|
|
diyApi("/system/log/insSysAccessLog", data);
|
|
}
|