1.7版本发布,详情查看版本说明
This commit is contained in:
54
src/views/system/user/center/log.vue
Normal file
54
src/views/system/user/center/log.vue
Normal file
@@ -0,0 +1,54 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||
<el-table-column prop="description" label="行为"/>
|
||||
<el-table-column prop="requestIp" label="IP"/>
|
||||
<el-table-column prop="time" label="请求耗时" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.time <= 300">{{ scope.row.time }}ms</el-tag>
|
||||
<el-tag v-else-if="scope.row.time <= 1000" type="warning">{{ scope.row.time }}ms</el-tag>
|
||||
<el-tag v-else type="danger">{{ scope.row.time }}ms</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建日期" width="180px">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<el-pagination
|
||||
:total="total"
|
||||
style="margin-top: 8px;"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import initData from '@/mixins/initData'
|
||||
import { parseTime } from '@/utils/index'
|
||||
export default {
|
||||
mixins: [initData],
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
parseTime,
|
||||
beforeInit() {
|
||||
this.url = 'api/logs/user'
|
||||
const sort = 'id,desc'
|
||||
this.params = { page: this.page, size: this.size, sort: sort }
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<div style="display: inline-block">
|
||||
<el-button size="mini" class="button" type="info" @click="dialog = true">修改</el-button>
|
||||
<div style="display: inline-block;">
|
||||
<el-dialog :visible.sync="dialog" :title="title" append-to-body width="475px" @close="cancel">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="88px">
|
||||
<el-form-item label="新邮箱" prop="email">
|
||||
@@ -24,7 +23,6 @@
|
||||
|
||||
<script>
|
||||
import store from '@/store'
|
||||
import { md5 } from '@/utils/md5'
|
||||
import { validatEmail } from '@/utils/validate'
|
||||
import { validPass, updateEmail } from '@/api/user'
|
||||
import { resetEmail } from '@/api/code'
|
||||
@@ -37,7 +35,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
const validatePass = (rule, value, callback) => {
|
||||
validPass(md5(value)).then(res => {
|
||||
validPass(value).then(res => {
|
||||
if (res.status === 200) {
|
||||
callback()
|
||||
} else {
|
||||
@@ -114,7 +112,7 @@ export default {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
this.user = { email: this.form.email, password: md5(this.form.pass) }
|
||||
this.user = { email: this.form.email, password: this.form.pass }
|
||||
updateEmail(this.form.code, this.user).then(res => {
|
||||
this.loading = false
|
||||
this.resetForm()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<div style="display: inline-block">
|
||||
<el-button size="mini" class="button" type="info" @click="dialog = true">修改</el-button>
|
||||
<el-dialog :visible.sync="dialog" :title="title" append-to-body width="500px" @close="cancel">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="88px">
|
||||
<el-form-item label="旧密码" prop="oldPass">
|
||||
@@ -23,12 +22,11 @@
|
||||
|
||||
<script>
|
||||
import store from '@/store'
|
||||
import { md5 } from '@/utils/md5'
|
||||
import { validPass, updatePass } from '@/api/user'
|
||||
export default {
|
||||
data() {
|
||||
const validatePass = (rule, value, callback) => {
|
||||
validPass(md5(value)).then(res => {
|
||||
validPass(value).then(res => {
|
||||
if (res.status === 200) {
|
||||
callback()
|
||||
} else {
|
||||
@@ -67,7 +65,7 @@ export default {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
updatePass(md5(this.form.confirmPass)).then(res => {
|
||||
updatePass(this.form.confirmPass).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '密码修改成功,请重新登录',
|
||||
|
||||
Reference in New Issue
Block a user