添加登录日志

master
wuzuowei 4 months ago
parent bc65c43626
commit f1bb8c12ad

@ -6,6 +6,7 @@ import { SystemData } from "@/microhost/models/system"
import MicroApps from "../apps" import MicroApps from "../apps"
import { Log } from "./logger" import { Log } from "./logger"
import { history } from "umi" import { history } from "umi"
import requestaxios from 'axios';
/** /**
* *
@ -158,7 +159,11 @@ export default class RuntimeUser {
, userData?.Name , userData?.Name
, userData?.OrganName) , userData?.OrganName)
await MicroApps.GetRuntimeLogger().success(Log.Login, loginId) await MicroApps.GetRuntimeLogger().success(Log.Login, loginId)
let obj = {
OperateUser: loginId || "未登录",
Operate: `${loginId}登陆了工艺数据管理子系统`
}
await requestaxios.post('/Personnel/Personnelapi/LogRecording', obj)
return true return true
} }
} }

@ -25,9 +25,7 @@ const TechLoginView = () => {
current(paramValue); current(paramValue);
}, []) }, [])
const getLog = async (obj: any) => {
await request.post('/Personnel/Personnelapi/LogRecording', obj)
}
const current = (date: string) => { const current = (date: string) => {
// console.log("date", date) // console.log("date", date)
@ -52,11 +50,7 @@ const TechLoginView = () => {
utils.saveCookie('CZtoken', paramValue, month) utils.saveCookie('CZtoken', paramValue, month)
utils.saveCookie('loginName', data.loginName, month) utils.saveCookie('loginName', data.loginName, month)
doLogin(data.loginName); doLogin(data.loginName);
let obj = {
OperateUser: data.loginName || "未登录",
Operate: `${data.loginName}登陆了工艺数据管理子系统`
}
getLog(obj)
} else { } else {
message.error('获取财智系统用户信息报错!'); message.error('获取财智系统用户信息报错!');

Loading…
Cancel
Save