diff --git a/src/views/modules/oss/oss-config.vue b/src/views/modules/oss/oss-config.vue index 36ba02c8..1ea60e7b 100644 --- a/src/views/modules/oss/oss-config.vue +++ b/src/views/modules/oss/oss-config.vue @@ -1,6 +1,17 @@ @@ -131,8 +254,8 @@ export default { qcloudSecretKey: '', qcloudBucketName: '', qcloudRegion: '', - localDomain: '', fastdfsDomain: '', + localDomain: '', localPrefix: '', localPath: '' } @@ -142,58 +265,130 @@ export default { dataRule () { return { qiniuDomain: [ - { required: true, message: this.$t('validate.required'), trigger: 'blur' } + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } ], qiniuAccessKey: [ - { required: true, message: this.$t('validate.required'), trigger: 'blur' } + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } ], qiniuSecretKey: [ - { required: true, message: this.$t('validate.required'), trigger: 'blur' } + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } ], qiniuBucketName: [ - { required: true, message: this.$t('validate.required'), trigger: 'blur' } + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } ], aliyunDomain: [ - { required: true, message: this.$t('validate.required'), trigger: 'blur' } + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } ], aliyunEndPoint: [ - { required: true, message: this.$t('validate.required'), trigger: 'blur' } + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } ], aliyunAccessKeyId: [ - { required: true, message: this.$t('validate.required'), trigger: 'blur' } + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } ], aliyunAccessKeySecret: [ - { required: true, message: this.$t('validate.required'), trigger: 'blur' } + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } ], aliyunBucketName: [ - { required: true, message: this.$t('validate.required'), trigger: 'blur' } + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } ], qcloudDomain: [ - { required: true, message: this.$t('validate.required'), trigger: 'blur' } + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } ], qcloudAppId: [ - { required: true, message: this.$t('validate.required'), trigger: 'blur' } + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } ], qcloudSecretId: [ - { required: true, message: this.$t('validate.required'), trigger: 'blur' } + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } ], qcloudSecretKey: [ - { required: true, message: this.$t('validate.required'), trigger: 'blur' } + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } ], qcloudBucketName: [ - { required: true, message: this.$t('validate.required'), trigger: 'blur' } + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } ], qcloudRegion: [ - { required: true, message: this.$t('validate.required'), trigger: 'blur' } + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } ], localDomain: [ - { required: true, message: this.$t('validate.required'), trigger: 'blur' } + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } ], fastdfsDomain: [ - { required: true, message: this.$t('validate.required'), trigger: 'blur' } + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } ], localPath: [ - { required: true, message: this.$t('validate.required'), trigger: 'blur' } + { + required: true, + message: this.$t('validate.required'), + trigger: 'blur' + } ] } } @@ -213,35 +408,45 @@ export default { }, // 获取信息 getInfo () { - this.$http.get('/oss/file/info').then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.dataForm = res.data - }).catch(() => {}) - }, - // 表单提交 - dataFormSubmitHandle: debounce(function () { - this.$refs['dataForm'].validate((valid) => { - if (!valid) { - return false - } - this.$http.post('/oss/file', this.dataForm).then(({ data: res }) => { + this.$http + .get('/oss/file/info') + .then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } - this.$message({ - message: this.$t('prompt.success'), - type: 'success', - duration: 500, - onClose: () => { - this.visible = false - this.$emit('refreshDataList') - } - }) - }).catch(() => {}) - }) - }, 1000, { 'leading': true, 'trailing': false }) + this.dataForm = res.data + }) + .catch(() => {}) + }, + // 表单提交 + dataFormSubmitHandle: debounce( + function () { + this.$refs['dataForm'].validate(valid => { + if (!valid) { + return false + } + this.$http + .post('/oss/file', this.dataForm) + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.$message({ + message: this.$t('prompt.success'), + type: 'success', + duration: 500, + onClose: () => { + this.visible = false + this.$emit('refreshDataList') + } + }) + }) + .catch(() => {}) + }) + }, + 1000, + { leading: true, trailing: false } + ) } }