自己写一套权限控制,去掉spring security
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
</template>
|
||||
<el-container v-else>
|
||||
<el-aside width="200px">
|
||||
<div style="padding: 10px;" v-show="leftCollapse">
|
||||
<div style="padding: 10px;height: 100%;box-sizing: border-box;background: #fafafa;" v-show="leftCollapse">
|
||||
<div style="margin-bottom: 10px;">
|
||||
<el-select v-model="choiceSpace" @change="spaceChangeEvents" filterable placeholder="选择空间" style="width: 100%;">
|
||||
<el-option-group label="">
|
||||
@@ -32,14 +32,30 @@
|
||||
</el-tree>
|
||||
</div>
|
||||
</el-aside>
|
||||
<el-main>
|
||||
<router-view></router-view>
|
||||
</el-main>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<!--<el-switch v-model="isCollapse" ></el-switch>-->
|
||||
<i class="el-icon-menu icon-collapse" @click="leftCollapse = !leftCollapse;"></i>
|
||||
<!--<div class="logo" @click="aboutDialogVisible = true">zyplayer-doc-wiki</div>-->
|
||||
<el-dropdown @command="userSettingDropdown" trigger="click">
|
||||
<i class="el-icon-setting" style="margin-right: 15px; font-size: 16px;cursor: pointer;color: #fff;"> </i>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="aboutDoc">关于</el-dropdown-item>
|
||||
<el-dropdown-item command="" divided>我的资料</el-dropdown-item>
|
||||
<el-dropdown-item command="userSignOut">退出登录</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</el-header>
|
||||
<el-main style="padding: 0;">
|
||||
<router-view></router-view>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import global from './common/config/global'
|
||||
var app;
|
||||
export default {
|
||||
data() {
|
||||
@@ -101,13 +117,18 @@
|
||||
},
|
||||
mounted: function () {
|
||||
app = this;
|
||||
global.vue.$app = this;
|
||||
this.loadSpaceList();
|
||||
},
|
||||
methods: {
|
||||
sendMsgToParent: function (msg) {
|
||||
alert(msg)
|
||||
},
|
||||
createWiki() {
|
||||
|
||||
},
|
||||
searchByKeywords() {
|
||||
this.sendMsgToParent();
|
||||
this.$refs.wikiPageTree.filter(app.searchKeywords);
|
||||
},
|
||||
handleNodeClick(data) {
|
||||
@@ -226,6 +247,16 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
userSettingDropdown(command) {
|
||||
console.log("command:" + command);
|
||||
if (command == 'userSignOut') {
|
||||
// this.userSignOut();
|
||||
} else if (command == 'aboutDoc') {
|
||||
app.aboutDialogVisible = true;
|
||||
} else {
|
||||
// Toast.notOpen();
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -240,4 +271,7 @@
|
||||
#app, .el-container, .el-menu {
|
||||
height: 100%;
|
||||
}
|
||||
.el-header {background-color: #409EFF; color: #333; line-height: 40px; text-align: right;height: 40px !important;}
|
||||
.icon-collapse{float: left;font-size: 25px;color: #aaa;margin-top: 8px;cursor: pointer;}
|
||||
.icon-collapse:hover{color: #eee;}
|
||||
</style>
|
||||
|
||||
@@ -30,8 +30,8 @@ var _evt = function () {
|
||||
|
||||
var _fn = {
|
||||
href: href,
|
||||
HOST: EVT + 'local.zyplayer.com:8083/zyplayer-doc-manage', //这里设置接口域名
|
||||
HOST1: EVT + 'local.zyplayer.com:8083', //设置多个接口域名
|
||||
HOST: EVT + 'local.zyplayer.com:8084', //这里设置接口域名
|
||||
HOST1: EVT + 'local.zyplayer.com:8084', //设置多个接口域名
|
||||
mixUrl: function (host, url) {
|
||||
var p;
|
||||
if (!host || !url || _fn.isEmptyObject(url)) {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
const user = {
|
||||
isLogin: true,
|
||||
};
|
||||
const app = {};
|
||||
const vue = {};
|
||||
const fullscreen = false;
|
||||
|
||||
export default {
|
||||
app,
|
||||
vue,
|
||||
user,
|
||||
fullscreen,
|
||||
}
|
||||
|
||||
@@ -19,12 +19,12 @@ export default {
|
||||
},
|
||||
validateResult: function (res, callback) {
|
||||
if (res.data.errCode == 400) {
|
||||
global.app.$message('请先登录');
|
||||
global.app.$router.push("/user/login");
|
||||
global.vue.$message('请先登录');
|
||||
global.vue.$router.push("/user/login");
|
||||
} else if (res.data.errCode == 402) {
|
||||
global.app.$router.push("/common/noAuth");
|
||||
global.vue.$router.push("/common/noAuth");
|
||||
} else if (res.data.errCode !== 200) {
|
||||
global.app.$message(res.data.errMsg || "未知错误");
|
||||
global.vue.$message(res.data.errMsg || "未知错误");
|
||||
} else {
|
||||
if (typeof callback == 'function') {
|
||||
callback(res.data);
|
||||
@@ -34,7 +34,7 @@ export default {
|
||||
post: function (url, param, callback) {
|
||||
param = param || {};
|
||||
param.accessToken = this.getAccessToken();
|
||||
global.app.axios({
|
||||
global.vue.axios({
|
||||
method: "post",
|
||||
url: url,
|
||||
headers: {'Content-type': 'application/x-www-form-urlencoded'},
|
||||
|
||||
@@ -7,14 +7,14 @@ import global from '../../config/global'
|
||||
*/
|
||||
export default {
|
||||
notOpen: function () {
|
||||
global.app.$message({
|
||||
global.vue.$message({
|
||||
message: '该功能暂未开放,敬请期待!',
|
||||
type: 'warning',
|
||||
showClose: true
|
||||
});
|
||||
},
|
||||
success: function (msg, time) {
|
||||
global.app.$message({
|
||||
global.vue.$message({
|
||||
message: msg,
|
||||
duration: time || 3000,
|
||||
type: 'success',
|
||||
@@ -22,7 +22,7 @@ export default {
|
||||
});
|
||||
},
|
||||
warn: function (msg, time) {
|
||||
global.app.$message({
|
||||
global.vue.$message({
|
||||
message: msg,
|
||||
duration: time || 3000,
|
||||
type: 'warning',
|
||||
@@ -30,7 +30,7 @@ export default {
|
||||
});
|
||||
},
|
||||
error: function (msg, time) {
|
||||
global.app.$message({
|
||||
global.vue.$message({
|
||||
message: msg,
|
||||
duration: time || 3000,
|
||||
type: 'error',
|
||||
|
||||
@@ -50,7 +50,7 @@ new Vue({
|
||||
router,
|
||||
render(h) {
|
||||
var app = h(App);
|
||||
global.app = app.context;
|
||||
global.vue = app.context;
|
||||
return app;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,18 +1,34 @@
|
||||
<template>
|
||||
<div>欢迎使用wiki文档管理工具</div>
|
||||
<div v-on:click="sendMsgToParent">
|
||||
<div style="margin-top: 30px;color: #666; text-align: center; font-size: 30px;">欢迎使用在线文档</div>
|
||||
<div style="margin-top: 30px;color: #666; text-align: center;">
|
||||
{{nowSpaceShow.name}}
|
||||
<span v-show="nowSpaceShow.spaceExplain && nowSpaceShow.spaceExplain.length > 0"> · {{nowSpaceShow.spaceExplain}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import global from '../../common/config/global'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
return {
|
||||
nowSpaceShow: {
|
||||
name: '',
|
||||
spaceExplain: '',
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
// this.getUserInfo();
|
||||
},
|
||||
methods: {
|
||||
getUserInfo: function () {
|
||||
this.common.post(this.apilist1.getUserInfo, {}, function (json) {});
|
||||
// this.common.post(this.apilist1.getUserInfo, {}, function (json) {});
|
||||
},
|
||||
sendMsgToParent: function () {
|
||||
global.vue.$app.sendMsgToParent("xxx");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user