mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 06:02:38 +08:00
优化
This commit is contained in:
parent
3fecc4f64b
commit
8fbe09c133
@ -11,7 +11,7 @@
|
||||
"dependencies": {
|
||||
"@vue/composition-api": "^1.0.0-rc.5",
|
||||
"axios": "^0.21.1",
|
||||
"cl-admin": "^1.5.1",
|
||||
"cl-admin": "^1.5.3",
|
||||
"cl-admin-crud": "^1.6.4",
|
||||
"cl-admin-theme": "^0.0.5",
|
||||
"clipboard": "^2.0.7",
|
||||
|
@ -15,8 +15,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapMutations, mapGetters } from "vuex";
|
||||
import { firstMenu } from "@/cool/modules/base/utils";
|
||||
import { mapMutations } from "vuex";
|
||||
import { firstMenu } from "../../utils";
|
||||
|
||||
export default {
|
||||
name: "cl-menu-topbar",
|
||||
@ -28,10 +28,8 @@ export default {
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapGetters(["menuGroup"]),
|
||||
|
||||
list() {
|
||||
return this.menuGroup.filter(e => e.isShow);
|
||||
return this.$store.getters.menuGroup.filter(e => e.isShow);
|
||||
}
|
||||
},
|
||||
|
||||
@ -56,7 +54,7 @@ export default {
|
||||
}
|
||||
};
|
||||
|
||||
this.menuGroup.forEach((e, i) => {
|
||||
this.list.forEach((e, i) => {
|
||||
deep(e, i);
|
||||
});
|
||||
},
|
||||
@ -67,7 +65,8 @@ export default {
|
||||
onSelect(index) {
|
||||
this.SET_MENU_LIST(index);
|
||||
|
||||
const url = firstMenu(this.menuGroup[index].children);
|
||||
// 获取第一个菜单地址
|
||||
const url = firstMenu(this.list[index].children);
|
||||
this.$router.push(url);
|
||||
}
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ export default {
|
||||
// 监听消息
|
||||
onMessage(msg) {
|
||||
// 回调
|
||||
this.$emit("message", this.visible);
|
||||
this.$emit("message", msg);
|
||||
|
||||
// 消息通知
|
||||
this.notification(msg);
|
||||
|
@ -134,7 +134,6 @@ export default {
|
||||
size: 20,
|
||||
total: 0
|
||||
},
|
||||
player: {},
|
||||
voice: {
|
||||
url: "",
|
||||
timer: null
|
||||
|
@ -98,7 +98,8 @@
|
||||
title="图片预览"
|
||||
:visible.sync="preview.visible"
|
||||
:props="{
|
||||
width: previewWidth
|
||||
width: previewWidth,
|
||||
'append-to-body': true
|
||||
}"
|
||||
>
|
||||
<img width="100%" :src="preview.url" alt="" />
|
||||
|
@ -1,4 +1,5 @@
|
||||
import axios from "axios";
|
||||
import { Message } from "element-ui";
|
||||
import store from "@/store";
|
||||
import { isDev } from "@/config/env";
|
||||
import { href, storage } from "cl-admin/utils";
|
||||
@ -120,8 +121,11 @@ axios.interceptors.response.use(
|
||||
break;
|
||||
|
||||
case 403:
|
||||
console.error(`${config.url} 无权限访问!!`);
|
||||
href("/403");
|
||||
if (isDev) {
|
||||
Message.error(`${config.url} 无权限访问!!`);
|
||||
} else {
|
||||
href("/403");
|
||||
}
|
||||
break;
|
||||
|
||||
case 404:
|
||||
@ -135,7 +139,7 @@ axios.interceptors.response.use(
|
||||
|
||||
case 502:
|
||||
if (isDev) {
|
||||
return Promise.reject("服务异常!!");
|
||||
Message.error(`${config.url} 服务异常!!`);
|
||||
} else {
|
||||
href("/502");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user