|
|
@@ -9,7 +9,7 @@
|
|
|
</div>
|
|
|
<div class="text item">
|
|
|
<el-table
|
|
|
- :data="notifyConfigList"
|
|
|
+ :data="emailAccountList"
|
|
|
border
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
@@ -61,7 +61,7 @@
|
|
|
</div>
|
|
|
<div class="text item">
|
|
|
<el-table
|
|
|
- :data="notifyConfigList"
|
|
|
+ :data="webhookList"
|
|
|
border
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
@@ -123,6 +123,37 @@
|
|
|
</div>
|
|
|
</el-card>
|
|
|
</el-col>
|
|
|
+ <el-col :md="12" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <span>注册管理</span>
|
|
|
+ </div>
|
|
|
+ <div class="text item">
|
|
|
+ <el-form ref="form" :model="accountRegistry" label-width="100px">
|
|
|
+ <el-form-item label="开放注册">
|
|
|
+ <el-input v-model="accountRegistry.enabled" style="width: 50%; padding-right: 10px" readonly />
|
|
|
+ <el-button size="mini" type="info" @click="onSetRegistry()">
|
|
|
+ <span v-if="!accountRegistry.enabled">启用</span>
|
|
|
+ <span v-else>禁用</span>
|
|
|
+ </el-button>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="图形验证码">
|
|
|
+ <el-input v-model="accountRegistry.captchaCode" style="width: 50%; padding-right: 10px" readonly />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="短信验证码">
|
|
|
+ <el-input v-model="accountRegistry.verifyCode" style="width: 50%; padding-right: 10px" readonly />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="启用验证码">
|
|
|
+ <el-input v-model="accountRegistry.enableCode" style="width: 50%; padding-right: 10px" readonly />
|
|
|
+ <el-button size="mini" type="info" @click="onSetCode()">
|
|
|
+ <span v-if="!accountRegistry.enableCode">启用</span>
|
|
|
+ <span v-else>禁用</span>
|
|
|
+ </el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
|
|
|
<el-dialog
|
|
|
@@ -160,16 +191,15 @@
|
|
|
|
|
|
<script>
|
|
|
import { userMixin } from 'assets/js/mixin'
|
|
|
-import {
|
|
|
- getNotifyConfig
|
|
|
-} from '@/api/admin'
|
|
|
+import { getAccountRegistry, getNotifyConfig, setAccountCode, setAccountRegistry } from '@/api/admin'
|
|
|
|
|
|
export default {
|
|
|
name: 'AdminNotifyConfig',
|
|
|
mixins: [userMixin],
|
|
|
data() {
|
|
|
return {
|
|
|
- notifyConfigList: [],
|
|
|
+ emailAccountList: [],
|
|
|
+ webhookList: [],
|
|
|
updateDialog: false,
|
|
|
updateMobileForm: {
|
|
|
principal: null,
|
|
|
@@ -182,20 +212,21 @@ export default {
|
|
|
notifyConfig: {
|
|
|
email: '163mail',
|
|
|
webhook: 'dingWebhook'
|
|
|
- }
|
|
|
+ },
|
|
|
+ accountRegistry: null
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
document.title = '站点配置'
|
|
|
this.getData()
|
|
|
},
|
|
|
- mounted() {
|
|
|
- },
|
|
|
methods: {
|
|
|
getData() {
|
|
|
+ this.getAccountRegistryWrapper()
|
|
|
+
|
|
|
getNotifyConfig().then(resp => {
|
|
|
if (resp.code === 0) {
|
|
|
- this.notifyConfigList = resp.data
|
|
|
+ this.emailAccountList = resp.data
|
|
|
} else {
|
|
|
this.$message.error(resp.msg)
|
|
|
}
|
|
|
@@ -219,6 +250,43 @@ export default {
|
|
|
},
|
|
|
showUpdateDialog() {
|
|
|
this.$message.info('update notify')
|
|
|
+ },
|
|
|
+ getAccountRegistryWrapper() {
|
|
|
+ getAccountRegistry().then(resp => {
|
|
|
+ if (resp.code === 0) {
|
|
|
+ this.accountRegistry = resp.data
|
|
|
+ } else {
|
|
|
+ this.$message.error(resp.msg)
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ this.$message.error(error.message)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onSetRegistry() {
|
|
|
+ const payload = {}
|
|
|
+ payload.enabled = !this.accountRegistry.enabled
|
|
|
+ setAccountRegistry(payload).then(resp => {
|
|
|
+ if (resp.code === 0) {
|
|
|
+ this.getAccountRegistryWrapper()
|
|
|
+ } else {
|
|
|
+ this.$message.error(resp.msg)
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ this.$message.error(error.message)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onSetCode() {
|
|
|
+ const payload = {}
|
|
|
+ payload.enabled = !this.accountRegistry.enableCode
|
|
|
+ setAccountCode(payload).then(resp => {
|
|
|
+ if (resp.code === 0) {
|
|
|
+ this.getAccountRegistryWrapper()
|
|
|
+ } else {
|
|
|
+ this.$message.error(resp.msg)
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ this.$message.error(error.message)
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|