Skip to content

Commit 8fbe09c

Browse files
committed
优化
1 parent 3fecc4f commit 8fbe09c

File tree

6 files changed

+17
-14
lines changed

6 files changed

+17
-14
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"dependencies": {
1212
"@vue/composition-api": "^1.0.0-rc.5",
1313
"axios": "^0.21.1",
14-
"cl-admin": "^1.5.1",
14+
"cl-admin": "^1.5.3",
1515
"cl-admin-crud": "^1.6.4",
1616
"cl-admin-theme": "^0.0.5",
1717
"clipboard": "^2.0.7",

src/cool/modules/base/components/menu/topbar.vue

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
</template>
1616

1717
<script>
18-
import { mapMutations, mapGetters } from "vuex";
19-
import { firstMenu } from "@/cool/modules/base/utils";
18+
import { mapMutations } from "vuex";
19+
import { firstMenu } from "../../utils";
2020
2121
export default {
2222
name: "cl-menu-topbar",
@@ -28,10 +28,8 @@ export default {
2828
},
2929
3030
computed: {
31-
...mapGetters(["menuGroup"]),
32-
3331
list() {
34-
return this.menuGroup.filter(e => e.isShow);
32+
return this.$store.getters.menuGroup.filter(e => e.isShow);
3533
}
3634
},
3735
@@ -56,7 +54,7 @@ export default {
5654
}
5755
};
5856
59-
this.menuGroup.forEach((e, i) => {
57+
this.list.forEach((e, i) => {
6058
deep(e, i);
6159
});
6260
},
@@ -67,7 +65,8 @@ export default {
6765
onSelect(index) {
6866
this.SET_MENU_LIST(index);
6967
70-
const url = firstMenu(this.menuGroup[index].children);
68+
// 获取第一个菜单地址
69+
const url = firstMenu(this.list[index].children);
7170
this.$router.push(url);
7271
}
7372
}

src/cool/modules/chat/components/chat.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export default {
137137
// 监听消息
138138
onMessage(msg) {
139139
// 回调
140-
this.$emit("message", this.visible);
140+
this.$emit("message", msg);
141141
142142
// 消息通知
143143
this.notification(msg);

src/cool/modules/chat/components/message.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ export default {
134134
size: 20,
135135
total: 0
136136
},
137-
player: {},
138137
voice: {
139138
url: "",
140139
timer: null

src/cool/modules/upload/components/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@
9898
title="图片预览"
9999
:visible.sync="preview.visible"
100100
:props="{
101-
width: previewWidth
101+
width: previewWidth,
102+
'append-to-body': true
102103
}"
103104
>
104105
<img width="100%" :src="preview.url" alt="" />

src/service/request.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import axios from "axios";
2+
import { Message } from "element-ui";
23
import store from "@/store";
34
import { isDev } from "@/config/env";
45
import { href, storage } from "cl-admin/utils";
@@ -120,8 +121,11 @@ axios.interceptors.response.use(
120121
break;
121122

122123
case 403:
123-
console.error(`${config.url} 无权限访问!!`);
124-
href("/403");
124+
if (isDev) {
125+
Message.error(`${config.url} 无权限访问!!`);
126+
} else {
127+
href("/403");
128+
}
125129
break;
126130

127131
case 404:
@@ -135,7 +139,7 @@ axios.interceptors.response.use(
135139

136140
case 502:
137141
if (isDev) {
138-
return Promise.reject("服务异常!!");
142+
Message.error(`${config.url} 服务异常!!`);
139143
} else {
140144
href("/502");
141145
}

0 commit comments

Comments
 (0)