Commit 1cecdbaf authored by chenfenglei's avatar chenfenglei

添加下拉菜单,清除缓存项

parent 482f9c69
......@@ -65,8 +65,7 @@ export default {
menuList.push(i)
}
});
this.$router.addRoutes([this.$router.options.routes[0]]);//调用add
this.$router.addRoutes([this.$router.options.routes[0]]);//调用add;
this.$store.dispatch('setMenu',menuList)
}
......
<template>
<div class="head-index">
<img class="logo" :src="iconUrl" @click="toHome"/>{{$store.state.userName}}
<el-button round size="mini" class="edit-password" @click="dialogVisible=true">修改密码</el-button>
<div class="fl-r">
<el-button round size="mini" @click="logOut">退出登录</el-button>
<el-dropdown>
<el-button round size="mini" class="edit-password" >账号管理 <i class="el-icon-arrow-down el-icon--right"></i></el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="dialogVisible=true">修改密码</el-dropdown-item>
<el-dropdown-item @click.native="logOut">退出登录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!-- <el-button round size="mini" style="clear:both" @click="logOut">退出登录</el-button> -->
</div>
<el-dialog
title="修改密码"
......@@ -84,6 +91,9 @@
}
},
methods:{
a(){
console.log("aa")
},
logOut(){
this.$confirm('确定退出系统?', '提示', {
confirmButtonText: '确定',
......@@ -152,4 +162,13 @@
.edit-password{
margin-left: 10px;
}
.el-dropdown {
vertical-align: top;
}
.el-dropdown + .el-dropdown {
margin-left: 15px;
}
.el-icon-arrow-down {
font-size: 12px;
}
</style>
<template>
<div class="clearCache">
<el-table
:data="cacheList"
style="width: 100%;">
<el-table-column
prop="name"
label="缓存列表" style="padding-left:30px">
</el-table-column>
<el-table-column
label="操作">
<template slot-scope="scope">
<el-button size="mini" plain type="primary" @click="cache(scope.row.key)">
清除缓存
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import {clearCacheListApi} from "../../service/api"
export default {
data(){
return{
cacheList:[{name:"主题列表",key:"course_relation_list"},{name:"课包列表",key:"course_category_list "},{name:"课包内容",key:"element_detail"}]
}
},
methods:{
cache(data){
this.$confirm('此操作将清除该缓存记录?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
clearCacheListApi(data).then(res=>{
this.$message({
type: 'success',
message: '清除成功!'
});
});
});
}
}
}
</script>
<style scoped lang="less">
</style>
......@@ -16,7 +16,7 @@
<template slot-scope="props">
<el-form label-position="top" class="demo-table-expand">
<el-form-item label="回复内容">
<div v-for="(item, index) in JSON.parse(props.row.desc)">
<div v-for="(item, index) in props.row.desc">
回复{{index+1}}({{item.type | type}}):
<span v-if="item.content && item.type==='text'">
<span v-html="item.content.replace(/\/[\u4E00-\u9FA5]{1,3}/gi, emotion)"></span>
......@@ -169,7 +169,11 @@
},
getList(){
getConfigListApi({key: this.activeName}).then(res => {
console.log(res.list)
for(var i=0;i<res.list.length;i++){
if(res.list[i].desc){
res.list[i].desc= JSON.parse(res.list[i].desc)
}
}
this.list = res.list
})
},
......
......@@ -492,6 +492,11 @@ const getAdminLogListUrl = `${_baseUrl}api/admin/user/log`;
export const getAdminLogLisApi = function (json) {
return Vue.prototype.$fetch(`${getAdminLogListUrl}`,json)
};
// 清除缓存
const clearCacheListUrl = `/api/admin/redis/key`;
export const clearCacheListApi = function (json) {
return Vue.prototype.$del(`${clearCacheListUrl}/${json}`)
};
// 绑定其他商品
const bindOtherUrl = `${_baseUrl}api/admin/goods/bind/`;
......
......@@ -339,6 +339,7 @@ export function put(url,data = {}){
}
export function del(url,data = {}){
console.log(url,data)
return new Promise((resolve,reject) => {
axios.delete(url,data)
.then(response => {
......
......@@ -396,6 +396,16 @@ export default [
component: e=>require(['@/components/system/sysConfig'],e),
}
},{
value:'清除缓存',
routerName:'clearCache',
path:'/clearCache',
cover:'8-5',
router:{
path: '/clearCache',
name:'clearCache',
component: e=>require(['@/components/system/clearCache'],e),
}
},
{
value:'操作日志',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment