Browse Source

增加缓存清除

master
sj 2 years ago
parent
commit
e257c559f7
  1. 14
      src/api/system/menu.js
  2. 17
      src/layout/components/Navbar.vue

14
src/api/system/menu.js

@ -17,6 +17,20 @@ export function listSimpleMenus() {
}) })
} }
export function delRedis(data) {
return request({
url: '/bxg/api/redis',
method: 'delete',
data: data
})
}
export function del() {
return request({
url: '/bxg/api/del',
method: 'get'
})
}
// 查询菜单详细 // 查询菜单详细
export function getMenu(id) { export function getMenu(id) {
return request({ return request({

17
src/layout/components/Navbar.vue

@ -37,6 +37,9 @@
<el-dropdown-item @click.native="setting = true"> <el-dropdown-item @click.native="setting = true">
<span>布局设置</span> <span>布局设置</span>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item @click.native="delIndexRedis">
<span>清除缓存</span>
</el-dropdown-item>
<el-dropdown-item divided @click.native="logout"> <el-dropdown-item divided @click.native="logout">
<span>退出登录</span> <span>退出登录</span>
</el-dropdown-item> </el-dropdown-item>
@ -56,7 +59,7 @@ import SizeSelect from '@/components/SizeSelect'
import Search from '@/components/HeaderSearch' import Search from '@/components/HeaderSearch'
import RuoYiGit from '@/components/RuoYi/Git' import RuoYiGit from '@/components/RuoYi/Git'
import RuoYiDoc from '@/components/RuoYi/Doc' import RuoYiDoc from '@/components/RuoYi/Doc'
import {delRedis,del} from "@/api/system/menu";
export default { export default {
components: { components: {
Breadcrumb, Breadcrumb,
@ -92,6 +95,18 @@ export default {
} }
}, },
methods: { methods: {
delIndexRedis(){
let data={
key:"zsw:index_data",
value:""
}
// delRedis(data).then(res=>{
del().then(res=>{
// console.log('res',res)
this.$message.success("清除成功")
}
)
},
toggleSideBar() { toggleSideBar() {
this.$store.dispatch('app/toggleSideBar') this.$store.dispatch('app/toggleSideBar')
}, },

Loading…
Cancel
Save