From 6a9321c8497e607f08e4effcf7dec1f8cba868ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=99=8C?= Date: Fri, 8 Sep 2023 23:29:56 +0800 Subject: [PATCH] no message --- src/layout/components/sideM.vue | 2 +- src/layout/components/tags.vue | 2 +- src/layout/index.vue | 2 +- src/router/index.js | 7 +-- src/views/login/components/passwordForm.vue | 4 +- .../system/application/installedApplist.vue | 50 +++++++++++----- src/views/system/application/pluginMarket.vue | 7 ++- src/views/system/application/popInfo.vue | 60 ++++++++++++------- 8 files changed, 90 insertions(+), 44 deletions(-) diff --git a/src/layout/components/sideM.vue b/src/layout/components/sideM.vue index 077dc99..5551217 100644 --- a/src/layout/components/sideM.vue +++ b/src/layout/components/sideM.vue @@ -35,7 +35,7 @@ }, created() { - var menu = this.$router.sc_getMenu() + var menu = this.$router.x_getMenu() this.menu = this.filterUrl(menu) }, diff --git a/src/layout/components/tags.vue b/src/layout/components/tags.vue index 0187761..0bf5a02 100644 --- a/src/layout/components/tags.vue +++ b/src/layout/components/tags.vue @@ -79,7 +79,7 @@ } }, created() { - var menu = this.$router.sc_getMenu() + var menu = this.$router.x_getMenu() var dashboardRoute = this.treeFind(menu, node => node.path==this.$config.DASHBOARD_URL) if(dashboardRoute){ dashboardRoute.fullPath = dashboardRoute.path diff --git a/src/layout/index.vue b/src/layout/index.vue index ebae8d2..a0d3327 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -242,7 +242,7 @@ this.appLogo = this.$tool.data.get("appLogo") || (this.$config.APP_LOGO || logo); this.onLayoutResize(); window.addEventListener('resize', this.onLayoutResize); - var menu = this.$router.sc_getMenu(); + var menu = this.$router.x_getMenu(); this.menu = this.filterUrl(menu); this.showThis() }, diff --git a/src/router/index.js b/src/router/index.js index 5e770b4..59ad10d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -78,7 +78,7 @@ router.beforeEach(async (to, from, next) => { store.commit("SET_layout", response.data[key]) } } - var menu = router.sc_getMenu(); + var menu = router.x_getMenu(); var menuRouter = filterAsyncRouter(menu) menuRouter = flatAsyncRoutes(menuRouter) menuRouter.forEach(item => { @@ -109,7 +109,7 @@ router.onError((error) => { }); }); //入侵追加自定义方法、对象 -router.sc_getMenu = () => { +router.x_getMenu = () => { var apiMenu = tool.data.get("menu") || [] let userInfo = tool.data.get("user") || {} let userMenu = treeFilter(userRoutes, node => { @@ -155,8 +155,7 @@ function loadComponent(component) { function flatAsyncRoutes(routes, breadcrumb = []) { let res = [] routes.forEach(route => { - const tmp = { ...route - } + const tmp = { ...route } if (tmp.children) { let childrenBreadcrumb = [...breadcrumb] childrenBreadcrumb.push(route) diff --git a/src/views/login/components/passwordForm.vue b/src/views/login/components/passwordForm.vue index 8adc04b..361e88b 100644 --- a/src/views/login/components/passwordForm.vue +++ b/src/views/login/components/passwordForm.vue @@ -60,7 +60,9 @@ var data = { account: this.form.account, - password: this.$tool.crypto.BASE64.encrypt( this.$tool.crypto.BASE64.encrypt( this.form.password ) + this.$tool.crypto.BASE64.encrypt( this.form.account ) ) + password: this.$tool.crypto.BASE64.encrypt( + this.$tool.crypto.BASE64.encrypt( this.form.password ) + this.$tool.crypto.BASE64.encrypt( this.form.account ) + ) } //获取token diff --git a/src/views/system/application/installedApplist.vue b/src/views/system/application/installedApplist.vue index b49209b..bd476e5 100644 --- a/src/views/system/application/installedApplist.vue +++ b/src/views/system/application/installedApplist.vue @@ -4,7 +4,7 @@ - + - + @@ -51,7 +51,7 @@ -
+
@@ -80,9 +80,15 @@ export default { }, closePlugin(refresh = false){ this.info = {}; - this.popShow = false; + this.popShow = false; if (refresh===true) { this.loaddata(); + + // // 重新加载菜单 + // this.$api.system.index.get().then((response) => { + // this.$tool.data.set('menu', response.data.menu); + // }); + // this.$router.x_getMenu(); } }, loaddata(){ @@ -96,15 +102,22 @@ export default { }, changeStatus(o){ - // o.changeStatusloading = true; - console.log(o) - // this.$http.get('admin/application/installedApplist').then((res) => { - // this.changeStatusloading = false; - // if (res.code == 200) { - // this.data = res.data; - // } - // }); - + return ElMessageBox.confirm((o.status?'关闭应用会导致相关调用失效':'打开应用('+ o.name +')') + ', 确认执行?', '正在'+ (o.status?'关闭':'打开') + '应用', { + type: 'error', + closeOnClickModal: false, + confirmButtonText: '确认操作', + }).then(() => { + o.changeStatusloading = true; + return this.$http.post('admin/application/status', {app:o.app, status:o.status?0:1}).then((res) => { + o.changeStatusloading = false; + if (res.code == 200) { + this.$message.success(res.message || "操作成功") + return true; + } + this.$alert(res.message, "提示", {type: 'error'}); + return false; + }); + }).catch(() => {}) }, uninstall(item, index) { @@ -115,7 +128,14 @@ export default { }).then(() => { this.$http.post('admin/application/uninstall', {app:item.app}).then((res) => { if (res.code == 200) { + this.data.splice(index, 1) + // // 重新加载菜单 + // this.$api.system.index.get().then((response) => { + // this.$tool.data.set('menu', response.data.menu); + // }); + // this.$router.x_getMenu(); + this.$message.success(res.message || "操作成功") return true; } diff --git a/src/views/system/application/pluginMarket.vue b/src/views/system/application/pluginMarket.vue index 2fccfc5..b6e8f9c 100644 --- a/src/views/system/application/pluginMarket.vue +++ b/src/views/system/application/pluginMarket.vue @@ -1,6 +1,6 @@