1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
| <template>
| <div class="app-container">
| <el-form :model="form" status-icon :rules="rules" ref="form" label-width="150px">
| <el-form-item label="密码过期时间(天)" prop="passwordExpireTime">
| <el-input v-model="form.passwordExpireTime" type="number" autocomplete="off" placeholder="比如:30天密码过期"></el-input>
| </el-form-item>
| <el-form-item>
| <el-button type="primary" @click="edit()">保存</el-button>
| </el-form-item>
| </el-form>
| </div>
| </template>
|
| <script>
| import { getSysConfig, editSysConfig } from '@/api/sysConfig'
|
| export default {
| name: 'SysSetting',
| data () {
| return {
| form: {
| id: null,
| passwordExpireTime: null
| },
| rules: {
| passwordExpireTime: [
| { required: true, message: '请输入密码过期时间', trigger: 'blur' }
| ]
| }
| }
| },
| mounted () {
| this.getConfig()
| },
| methods: {
| getConfig () {
| getSysConfig().then(res => {
| this.form = res.data.data
| })
| },
| edit () {
| this.$refs['form'].validate((valid) => {
| if (valid) {
| editSysConfig(this.form).then(res => {
| this.$message.success('修改成功')
| })
| }
| })
| }
| }
| }
| </script>
|
| <style scoped>
|
| </style>
|
|