手机号脱敏显示
This commit is contained in:
parent
2ee58cefb0
commit
5691d366f9
|
|
@ -92,6 +92,12 @@ export function getLogSize(data) {
|
|||
})
|
||||
}
|
||||
|
||||
export function handleNoWarningLog(data) {
|
||||
return request({
|
||||
url: '/system/sys/sysLog/logWarn',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -25,10 +25,6 @@
|
|||
<el-form-item label="确认密码" prop="confirmPassword">
|
||||
<el-input v-model="user.confirmPassword" placeholder="请确认新密码" type="password" show-password/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item>
|
||||
<el-button type="primary" size="mini" @click="submit">保存</el-button>
|
||||
<el-button type="danger" size="mini" @click="close">关闭</el-button>
|
||||
</el-form-item>-->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
|
|
@ -46,6 +42,7 @@ import { mapState } from 'vuex'
|
|||
import variables from '@/assets/styles/variables.scss'
|
||||
import { validateNewPassword } from '@/utils/validate'
|
||||
import { updateUserPwd, checkPasswordStatus } from '@/api/system/user'
|
||||
import { handleNoWarningLog } from '@/api/system/log'
|
||||
import {MessageBox} from "element-ui";
|
||||
|
||||
export default {
|
||||
|
|
@ -120,11 +117,10 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.checkPasswordStatus()
|
||||
console.log("*******************")
|
||||
console.log(this.roles)
|
||||
if (this.roles.includes("audit") || this.roles.includes("systemAdmin")|| this.roles.includes("admin")) {
|
||||
if (this.roles.includes("audit") || this.roles.includes("systemAdmin")) {
|
||||
this.connectWebSocket();
|
||||
}
|
||||
this.handleNoWarningLog()
|
||||
},
|
||||
methods: {
|
||||
checkPasswordStatus() {
|
||||
|
|
@ -135,6 +131,13 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
|
||||
handleNoWarningLog(){
|
||||
handleNoWarningLog().then(response => {
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
handleClickOutside() {
|
||||
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
|
||||
},
|
||||
|
|
@ -206,24 +209,39 @@ export default {
|
|||
// 处理告警信息并显示弹窗
|
||||
handleWarning(warning) {
|
||||
console.log(warning)
|
||||
// const formattedTime = new Date(warning.warningTime).toLocaleString();
|
||||
// 弹出告警信息
|
||||
let warningContent = '';
|
||||
|
||||
if (warning.operaUserName) {
|
||||
warningContent += `<p><strong>操作人:</strong>${warning.operaUserName}</p>`;
|
||||
}
|
||||
|
||||
if (warning.warningEvent) {
|
||||
warningContent += `<p><strong>事件:</strong>${warning.warningEvent}</p>`;
|
||||
}
|
||||
|
||||
if (warning.warningIp) {
|
||||
warningContent += `<p><strong>IP:</strong>${warning.warningIp}</p>`;
|
||||
}
|
||||
|
||||
if (warning.operaTime) {
|
||||
warningContent += `<p><strong>时间:</strong>${warning.operaTime}</p>`;
|
||||
}
|
||||
|
||||
if (warningContent) {
|
||||
MessageBox.alert(
|
||||
`
|
||||
<p><strong>操作人:</strong>${warning.operaUserName}</p>
|
||||
<p><strong>事件:</strong>${warning.warningEvent}</p>
|
||||
<p><strong>IP:</strong>${warning.warningIp}</p>
|
||||
<p><strong>时间:</strong>${warning.warningTime}</p>
|
||||
`,
|
||||
warningContent,
|
||||
'告警通知',
|
||||
{
|
||||
dangerouslyUseHTMLString: true,
|
||||
confirmButtonText: '确认',
|
||||
customClass: 'custom-message-box',
|
||||
callback: () => {
|
||||
this.notifyBackend(warning.warningId);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// 通知后端告警已处理
|
||||
|
|
|
|||
|
|
@ -97,7 +97,11 @@
|
|||
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber"
|
||||
v-if="columns[4].visible"
|
||||
width="120"
|
||||
/>
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ hidePhone(scope.row.phonenumber) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.status" active-value="0" inactive-value="1"
|
||||
|
|
@ -470,6 +474,11 @@ export default {
|
|||
})
|
||||
},
|
||||
methods: {
|
||||
/* 手机号码脱敏 */
|
||||
hidePhone(phone) {
|
||||
if (!phone) return '';
|
||||
return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
|
||||
},
|
||||
/* 表单登录权限自定义校验 */
|
||||
validateLoginType(rule, value, callback) {
|
||||
if (this.loginTypeArr.length > 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue