Signed-off-by: skyselang <215817969@qq.com>
This commit is contained in:
skyselang 2021-05-27 18:47:49 +08:00
parent 531cc8e2ca
commit 657d4d330c
5 changed files with 262 additions and 1 deletions

1
.gitignore vendored
View File

@ -22,4 +22,3 @@ selenium-debug.log
package-lock.json
yarn.lock
admin/

View File

@ -0,0 +1,86 @@
<template>
<el-card class="box-card">
<el-row :gutter="0">
<el-col :xs="24" :sm="12">
<el-form ref="ref" :model="model" :rules="rules" label-width="120px">
<el-form-item label="" prop="">
<span>次数/时间3/13次1秒次数设置为 0 则不限制</span>
</el-form-item>
<el-form-item label="接口速率">
<el-col :span="11">
<el-input v-model="model.api_rate_num" type="number" placeholder="次数" />
</el-col>
<el-col class="line" :span="2" style="text-align:center">/</el-col>
<el-col :span="11">
<el-input v-model="model.api_rate_time" type="number" placeholder="时间">
<template slot="append"></template>
</el-input>
</el-col>
</el-form-item>
<el-form-item>
<el-button :loading="loading" @click="refresh()">刷新</el-button>
<el-button :loading="loading" type="primary" @click="submit()">提交</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</el-card>
</template>
<script>
import { apiInfo, apiEdit } from '@/api/admin-setting'
export default {
name: 'Api',
components: {},
data() {
return {
loading: false,
model: {
api_rate_num: 3,
api_rate_time: 1
},
rules: {}
}
},
created() {
this.info()
},
methods: {
//
info() {
apiInfo().then(res => {
this.model = res.data
})
},
//
refresh() {
this.loading = true
apiInfo()
.then((res) => {
this.model = res.data
this.loading = false
this.$message.success(res.msg)
})
.catch(() => {
this.loading = false
})
},
//
submit() {
this.$refs['ref'].validate(valid => {
if (valid) {
this.loading = true
apiEdit(this.model).then(res => {
this.info()
this.loading = false
this.$message.success(res.msg)
}).catch(() => {
this.loading = false
})
}
})
}
}
}
</script>

View File

@ -0,0 +1,77 @@
<template>
<el-card class="box-card">
<el-row :gutter="0">
<el-col :xs="24" :sm="12">
<el-form ref="ref" :model="model" :rules="rules" label-width="120px">
<el-form-item label="" prop="">
<span>开启后后台登录需要输入验证码</span>
</el-form-item>
<el-form-item label="验证码" prop="captcha_switch">
<el-switch v-model="model.captcha_switch" :active-value="1" :inactive-value="0" />
</el-form-item>
<el-form-item>
<el-button :loading="loading" @click="refresh()">刷新</el-button>
<el-button :loading="loading" type="primary" @click="submit()">提交</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</el-card>
</template>
<script>
import { captchaInfo, captchaEdit } from '@/api/admin-setting'
export default {
name: 'Captcha',
components: {},
data() {
return {
loading: false,
model: {
captcha_switch: 0
},
rules: {}
}
},
created() {
this.info()
},
methods: {
//
info() {
captchaInfo().then(res => {
this.model = res.data
})
},
//
refresh() {
this.loading = true
captchaInfo()
.then((res) => {
this.model = res.data
this.loading = false
this.$message.success(res.msg)
})
.catch(() => {
this.loading = false
})
},
//
submit() {
this.$refs['ref'].validate(valid => {
if (valid) {
this.loading = true
captchaEdit(this.model).then(res => {
this.info()
this.loading = false
this.$message.success(res.msg)
}).catch(() => {
this.loading = false
})
}
})
}
}
}
</script>

View File

@ -0,0 +1,77 @@
<template>
<el-card class="box-card">
<el-row :gutter="0">
<el-col :xs="24" :sm="12">
<el-form ref="ref" :model="model" :rules="rules" label-width="120px">
<el-form-item label="" prop="">
<span>开启后会记录后台用户日志</span>
</el-form-item>
<el-form-item label="日志记录" prop="log_switch">
<el-switch v-model="model.log_switch" :active-value="1" :inactive-value="0" />
</el-form-item>
<el-form-item>
<el-button :loading="loading" @click="refresh()">刷新</el-button>
<el-button :loading="loading" type="primary" @click="submit()">提交</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</el-card>
</template>
<script>
import { logInfo, logEdit } from '@/api/admin-setting'
export default {
name: 'Log',
components: {},
data() {
return {
loading: false,
model: {
log_switch: 0
},
rules: {}
}
},
created() {
this.info()
},
methods: {
//
info() {
logInfo().then(res => {
this.model = res.data
})
},
//
refresh() {
this.loading = true
logInfo()
.then((res) => {
this.model = res.data
this.loading = false
this.$message.success(res.msg)
})
.catch(() => {
this.loading = false
})
},
//
submit() {
this.$refs['ref'].validate(valid => {
if (valid) {
this.loading = true
logEdit(this.model).then(res => {
this.info()
this.loading = false
this.$message.success(res.msg)
}).catch(() => {
this.loading = false
})
}
})
}
}
}
</script>

View File

@ -0,0 +1,22 @@
<template>
<iframe :src="src" frameborder="0" width="100%" :height="height" />
</template>
<script>
import screenHeight from '@/utils/screen-height'
export default {
name: 'Toollu',
components: {},
data() {
return {
src: 'https://tool.lu/',
height: 600
}
},
created() {
this.height = screenHeight(190)
},
methods: {}
}
</script>