|
@@ -98,8 +98,14 @@
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<div slot="footer">
|
|
|
+ <el-button v-if="action === 'update'" type="primary" @click="resetSecret">重置密钥</el-button>
|
|
|
<el-button @click="close">取消</el-button>
|
|
|
<el-button v-if="!isView" type="primary" @click="save">确定</el-button>
|
|
|
+ <div v-if="action === 'add'" style="margin-top: 10px;">
|
|
|
+ <span>点击【<strong>确定</strong>】按钮新增应用成功后,会在对话框内显示应用密钥,</span>
|
|
|
+ <br>
|
|
|
+ <span style="color: red;">该值仅显示这一次,请妥善保存。</span><span>如遗失请点击修改页面中的【重置密钥】按钮重新生成。</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -107,7 +113,7 @@
|
|
|
<script>
|
|
|
import { isNull, isObject, formatDictData } from '@/utils/convert'
|
|
|
|
|
|
-import { pushSaveSystem } from '@/api/system'
|
|
|
+import { pushSaveSystem, pushResetSecret } from '@/api/system'
|
|
|
import { getDeptRootData, getDeptChildren, getDeptTreeData } from '@/api/dept'
|
|
|
|
|
|
import UploadFile from '@/components/Upload/UploadFile'
|
|
@@ -223,6 +229,7 @@ export default {
|
|
|
} else {
|
|
|
this.title = '详情'
|
|
|
this.isView = true
|
|
|
+ this.action = 'view'
|
|
|
}
|
|
|
this.viewType = viewType
|
|
|
if (isObject(data)) {
|
|
@@ -252,10 +259,19 @@ export default {
|
|
|
this.visible = false
|
|
|
this.loading = false
|
|
|
this.$emit('refreshData')
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '保存成功!'
|
|
|
- })
|
|
|
+ if (this.action === 'add') {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ duration: 0,
|
|
|
+ showClose: true,
|
|
|
+ message: '保存成功!请保存应用密钥: ' + res.data
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '保存成功!'
|
|
|
+ })
|
|
|
+ }
|
|
|
}).catch(error => {
|
|
|
console.log(error)
|
|
|
this.loading = false
|
|
@@ -269,6 +285,34 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ resetSecret() {
|
|
|
+ this.$confirm('确定重置密钥吗??', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.loading = true
|
|
|
+ pushResetSecret(this.formData.id).then(res => {
|
|
|
+ this.visible = false
|
|
|
+ this.loading = false
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ duration: 0,
|
|
|
+ showClose: true,
|
|
|
+ message: '重置密钥成功!请保存应用密钥: ' + res.data
|
|
|
+ })
|
|
|
+ }).catch(error => {
|
|
|
+ console.log(error)
|
|
|
+ this.loading = false
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ duration: 0,
|
|
|
+ showClose: true,
|
|
|
+ message: '重置密钥出错:' + error.message
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }).catch(() => {})
|
|
|
+ },
|
|
|
getDeptData() {
|
|
|
const params = { fromRoot: 0 }
|
|
|
getDeptTreeData(params).then(res => {
|