新增:菜单重置功能

This commit is contained in:
jmal 2021-01-24 17:19:02 +08:00
parent a381678f2e
commit 4129ccefbf
3 changed files with 23 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "jmal-cloud-view",
"version": "2.0.4",
"version": "2.0.6",
"description": "jmal cloud",
"author": "Jmal <zhushilun084@163.com>",
"license": "MIT",

View File

@ -43,6 +43,12 @@ export default {
params
})
},
resetMenuAndRole() {
return request({
url: '/user/setting/resetMenuAndRole',
method: 'put',
})
}
}
export function getSetting(params) {

View File

@ -26,6 +26,10 @@
<el-button class="sync-button" size="mini" :loading="syncLoading" type="primary" @click="sync()"><i class="el-icon-refresh"></i></el-button>
</div>
<span class="instruction">一般用于初始化操作, 将文件数据同步到数据库</span>
<div class="config-itme-label">重置角色、菜单:
<el-button class="sync-button" size="mini" :loading="syncLoading" type="danger" @click="resetMenuAndRole()"><i class="el-icon-refresh-left"></i></el-button>
</div>
<span class="instruction">一般用于初始化角色、菜单数据</span>
</div>
</el-card>
</div>
@ -60,6 +64,18 @@ export default {
this.syncLoading = false
})
},
// 重置角色菜单
resetMenuAndRole(){
this.$confirm('您确定要删除此角色、菜单吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
settingApi.resetMenuAndRole().then(() => {
this.$message.success("重置完成")
})
})
},
webpChange(webpEnabled) {
settingApi.disabledWebp({userId: this.$store.state.user.userId, disabled: !webpEnabled}).then(() => {
webpEnabled ? this.$message.success('webp 以启用') : this.$message.warning('webp 以禁用')