修改登录日志

master
wuzuowei 2 months ago
parent 44a51b1f6f
commit 65ca323f1d

@ -37,6 +37,7 @@ export class SystemData extends RemoteRequest {
})
}
public setlog = async (obj: any) => {
// console.log("日志参数11111111111111", obj);
return request.post('/Personnel/Personnelapi/LogRecording', obj)
}

@ -164,7 +164,9 @@ export default class RuntimeUser {
OperateUser: loginId || "未登录",
Operate: `${loginId}登陆了工艺数据管理子系统`
}
await this.model.setlog(obj)
this.model.setlog(obj)
// console.log("日志参数", obj, loginId,);
return true
}
}

@ -5,7 +5,7 @@ import { useState, useLayoutEffect, useRef, useEffect } from 'react'
import styles from './index.less'
import { SystemData } from '@/microhost/models/system'
import Api from '@/config/Api'
import {defaultSetting as cfg} from "@/config/default"
import { defaultSetting as cfg } from "@/config/default"
import MicroApps from '@/microhost/system/apps'
import "./styles.less"
import { DesktopOutlined, KeyOutlined, MobileOutlined, UserOutlined } from '@ant-design/icons'
@ -18,12 +18,12 @@ const TechLoginView = () => {
const cookieLoginKey = "_defs_ln"
const [thisForm] = Form.useForm()
const defln = utils.loadCookie(cookieLoginKey)
const [cookieLoginName, setCookieLoginName] = useState<string|undefined>(!!defln && defln != "null" ? defln : undefined)
const [cookieLoginName, setCookieLoginName] = useState<string | undefined>(!!defln && defln != "null" ? defln : undefined)
const isRemembered = useRef<boolean>(!!defln && defln != "null")
useEffect(() => {
let def = !!defln && defln != "null" ? defln : undefined
if(def){
if (def) {
thisForm.setFieldsValue({
loginId: def
})
@ -41,35 +41,35 @@ const TechLoginView = () => {
return;
}
if(isRemembered.current){
if (isRemembered.current) {
let month = new Date().getTime() + 1000 * 24 * 3600 * 30 * 3
utils.saveCookie(cookieLoginKey, loginId, month)
}
let result = await MicroApps.GetRuntimeUser().doLogin(loginId, password)
if(isString(result)){
if (isString(result)) {
message.error(result)
return
}
let redirect: any = history.location.query?.redirect
let jumpTo: string | undefined = undefined
if(redirect){
if (redirect) {
let rd = decodeURIComponent(redirect)
jumpTo = isUrl(rd) ? rd : undefined
}
if(jumpTo){
if (jumpTo) {
}
else{
else {
let routes = await MicroApps.BuildRouteTree(loginId)
if(!routes || routes.length == 0){
if (!routes || routes.length == 0) {
history.push("/noauth")
return
}
else{
else {
jumpTo = "/" //routes[0].defaultPath && routes[0].defaultPath.length > 0 ? routes[0].defaultPath : "/welcome"
}
}
@ -94,33 +94,33 @@ const TechLoginView = () => {
doLogin(values)
}}>
<img style={{ width: '80%', marginTop: '40px', marginBottom: '40px', filter: "brightness(8)" }} className="UnitParseAnyway" src={Api.statics.login.topic} />
<div className='bk-login-qrcode' style={{display: loginType == "qrcode" ? "block" : "none"}}>
<img className="UnitParseAnyway" height={148} style={{marginTop: "36px"}} src="/statics/home/qrcode-wap.png" />
<div className='bk-login-qrcode' style={{ display: loginType == "qrcode" ? "block" : "none" }}>
<img className="UnitParseAnyway" height={148} style={{ marginTop: "36px" }} src="/statics/home/qrcode-wap.png" />
</div>
<div className={"bk-login-row"} style={{display: loginType == "account" ? "flex" : "none"}}>
<UserOutlined style={{marginLeft: "8px"}} />
<div className={"bk-login-row"} style={{ display: loginType == "account" ? "flex" : "none" }}>
<UserOutlined style={{ marginLeft: "8px" }} />
<span className="bk-row-tip"></span>
<Form.Item name="loginId" style={{marginBottom: 0}}>
<Form.Item name="loginId" style={{ marginBottom: 0 }}>
<input autoFocus={true} className={styles.input} defaultValue={cookieLoginName ? cookieLoginName : ""} placeholder="" autoComplete='off' />
</Form.Item>
</div>
<div className={"bk-login-row"} style={{display: loginType == "account" ? "flex" : "none"}}>
<KeyOutlined style={{marginLeft: "8px"}} />
<div className={"bk-login-row"} style={{ display: loginType == "account" ? "flex" : "none" }}>
<KeyOutlined style={{ marginLeft: "8px" }} />
<span className="bk-row-tip">&nbsp;&nbsp;&nbsp;&nbsp;</span>
<Form.Item name="password" style={{marginBottom: 0}}>
<Form.Item name="password" style={{ marginBottom: 0 }}>
<input type="password" className={styles.input} placeholder="" />
</Form.Item>
</div>
<div className={"bk-login-row"} style={{display: loginType == "account" ? "flex" : "none", border: 0, background: "transparent", justifyContent: "flex-end"}}>
<Checkbox defaultChecked={!!cookieLoginName} style={{color: "#fff"}} onChange={(event) => {
<div className={"bk-login-row"} style={{ display: loginType == "account" ? "flex" : "none", border: 0, background: "transparent", justifyContent: "flex-end" }}>
<Checkbox defaultChecked={!!cookieLoginName} style={{ color: "#fff" }} onChange={(event) => {
let checked = event.target.checked
isRemembered.current = checked
if(checked){
if (checked) {
let vals = thisForm.getFieldsValue()
let month = new Date().getTime() + 1000 * 24 * 3600 * 30 * 3
utils.saveCookie(cookieLoginKey, vals.loginId ? vals.loginId : "", month)
}
else{
else {
utils.removeCookie(cookieLoginKey)
}
}}></Checkbox>
@ -128,8 +128,8 @@ const TechLoginView = () => {
setLoginType("qrcode")
}}></Button> */}
</div>
<div className='bk-weblogin' style={{display: loginType == "account" ? "flex" : "none"}}>
<Form.Item style={{display: loginType == "account" ? "inherit" : "none"}}>
<div className='bk-weblogin' style={{ display: loginType == "account" ? "flex" : "none" }}>
<Form.Item style={{ display: loginType == "account" ? "inherit" : "none" }}>
<Button loading={isLoading} className={styles.loginButton} size="large" block type="primary" htmlType="submit">
{' '}&nbsp;&nbsp;{' '}
</Button>
@ -148,7 +148,7 @@ const TechLoginView = () => {
}} title='手机端'></div> */}
</div>
</div>
<div className='bk-weblogin' style={{display: loginType == "qrcode" ? "flex" : "none"}}>
<div className='bk-weblogin' style={{ display: loginType == "qrcode" ? "flex" : "none" }}>
<div className='login-type-nid'>
<div className='nid-line'></div>
<div className='nid-bat'>使</div>

Loading…
Cancel
Save