From ad07f3d113aba06c776fc5f1ee78fb106b5d9667 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 26 Sep 2022 21:28:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF):=20?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E4=BA=8C=E7=BB=B4=E7=A0=81=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/dataease/auth/service/impl/ShiroServiceImpl.java | 5 ++++- .../java/io/dataease/plugins/server/XDingtalkServer.java | 9 +++++++-- .../java/io/dataease/plugins/server/XLarkServer.java | 9 +++++++-- .../java/io/dataease/plugins/server/XWecomServer.java | 9 ++++++++- backend/src/main/resources/db/migration/V40__1.15.sql | 1 + frontend/src/layout/components/Topbar.vue | 2 +- frontend/src/router/index.js | 6 +++++- frontend/src/views/system/user/privateForm.vue | 2 +- 8 files changed, 34 insertions(+), 9 deletions(-) diff --git a/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java b/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java index 6a32dff31a..a1a55baffa 100644 --- a/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java +++ b/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java @@ -93,10 +93,13 @@ public class ShiroServiceImpl implements ShiroService { filterChainDefinitionMap.put("/sso/callBack*", ANON); filterChainDefinitionMap.put("/cas/callBack*", ANON); filterChainDefinitionMap.put("/plugin/wecom/callBack*", ANON); + filterChainDefinitionMap.put("/plugin/wecom/bind*", ANON); filterChainDefinitionMap.put("/plugin/wecom/getQrParam", ANON); filterChainDefinitionMap.put("/plugin/dingtalk/callBack*", ANON); + filterChainDefinitionMap.put("/plugin/dingtalk/bind*", ANON); filterChainDefinitionMap.put("/plugin/dingtalk/getQrParam", ANON); filterChainDefinitionMap.put("/plugin/lark/callBack*", ANON); + filterChainDefinitionMap.put("/plugin/lark/bind*", ANON); filterChainDefinitionMap.put("/plugin/lark/getQrParam", ANON); filterChainDefinitionMap.put("/cas/reset/**", ANON); @@ -122,7 +125,7 @@ public class ShiroServiceImpl implements ShiroService { @Override public void updatePermission(ShiroFilterFactoryBean shiroFilterFactoryBean, Integer roleId, - Boolean isRemoveSession) { + Boolean isRemoveSession) { } diff --git a/backend/src/main/java/io/dataease/plugins/server/XDingtalkServer.java b/backend/src/main/java/io/dataease/plugins/server/XDingtalkServer.java index b222deb611..169322eb8c 100644 --- a/backend/src/main/java/io/dataease/plugins/server/XDingtalkServer.java +++ b/backend/src/main/java/io/dataease/plugins/server/XDingtalkServer.java @@ -150,7 +150,7 @@ public class XDingtalkServer { public void bind(@RequestParam("code") String code, @RequestParam("state") String state) { HttpServletResponse response = ServletUtils.response(); - String url = "/#person-info/index/"; + String url = "/#personal"; DingtalkXpackService dingtalkXpackService = null; @@ -178,7 +178,12 @@ public class XDingtalkServer { if (null != sysUserEntity) { bindError(response, url, "当前钉钉账号已绑定其他DE用户"); } - + if (ObjectUtils.isEmpty(sysUserAssist)) { + sysUserAssist = new SysUserAssist(); + sysUserAssist.setUserId(Long.parseLong(state)); + } + sysUserAssist.setDingtalkId(userId); + sysUserService.saveAssist(sysUserAssist.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId()); response.sendRedirect(url); } catch (Exception e) { diff --git a/backend/src/main/java/io/dataease/plugins/server/XLarkServer.java b/backend/src/main/java/io/dataease/plugins/server/XLarkServer.java index 89d203ef05..58066af86c 100644 --- a/backend/src/main/java/io/dataease/plugins/server/XLarkServer.java +++ b/backend/src/main/java/io/dataease/plugins/server/XLarkServer.java @@ -151,7 +151,7 @@ public class XLarkServer { public void bind(@RequestParam("code") String code, @RequestParam("state") String state) { HttpServletResponse response = ServletUtils.response(); - String url = "/#person-info/index/"; + String url = "/#personal"; LarkXpackService larkXpackService = null; try { @@ -178,7 +178,12 @@ public class XLarkServer { bindError(response, url, "当前飞书账号已绑定其他DE用户"); } - + if (ObjectUtils.isEmpty(sysUserAssist)) { + sysUserAssist = new SysUserAssist(); + sysUserAssist.setUserId(Long.parseLong(state)); + } + sysUserAssist.setLarkId(userId); + sysUserService.saveAssist(sysUserAssist.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId()); response.sendRedirect(url); } catch (Exception e) { diff --git a/backend/src/main/java/io/dataease/plugins/server/XWecomServer.java b/backend/src/main/java/io/dataease/plugins/server/XWecomServer.java index 5ed48b1e86..afa1a47835 100644 --- a/backend/src/main/java/io/dataease/plugins/server/XWecomServer.java +++ b/backend/src/main/java/io/dataease/plugins/server/XWecomServer.java @@ -156,7 +156,7 @@ public class XWecomServer { @GetMapping("/bind") public void bind(@RequestParam("code") String code, @RequestParam("state") String state) { - String url = "/#person-info/index/"; + String url = "/#personal"; HttpServletResponse response = ServletUtils.response(); WecomXpackService wecomXpackService = null; @@ -184,6 +184,13 @@ public class XWecomServer { if (null != sysUserEntity) { bindError(response, url, "当前企业微信账号已绑定其他DE用户"); } + if (ObjectUtils.isEmpty(sysUserAssist)) { + sysUserAssist = new SysUserAssist(); + sysUserAssist.setUserId(Long.parseLong(state)); + } + sysUserAssist.setWecomId(userId); + sysUserService.saveAssist(sysUserAssist.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId()); + response.sendRedirect(url); } catch (Exception e) { diff --git a/backend/src/main/resources/db/migration/V40__1.15.sql b/backend/src/main/resources/db/migration/V40__1.15.sql index 49592eca7a..a6e5edda74 100644 --- a/backend/src/main/resources/db/migration/V40__1.15.sql +++ b/backend/src/main/resources/db/migration/V40__1.15.sql @@ -126,3 +126,4 @@ INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_typ INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`, `copy_from`, `copy_id`) VALUES ('d55c4d88-3b0a-11ed-8009-0242ac130005', '379c3124-7a30-4c1b-8ae4-de23eaf34b71', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1663915323000, NULL, NULL, NULL); INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`, `copy_from`, `copy_id`) VALUES ('379c3124-7a30-4c1b-8ae4-de23eaf34b71', 'bdfcc324-1181-46a6-b681-a453517c4ffa', 'dataset', '2', 'user', 1663915323123, NULL, 'admin', NULL, NULL, NULL); +DELETE from `sys_menu` where `menu_id` = 50; \ No newline at end of file diff --git a/frontend/src/layout/components/Topbar.vue b/frontend/src/layout/components/Topbar.vue index f580b1a2c3..40f32607a4 100644 --- a/frontend/src/layout/components/Topbar.vue +++ b/frontend/src/layout/components/Topbar.vue @@ -46,7 +46,7 @@ - + {{ $t('commons.personal_info') }} diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index 066503b320..1a8b862514 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -76,7 +76,11 @@ export const constantRoutes = [ component: () => import('@/views/link'), hidden: true }, - + { + path: '/personal', + component: () => import('@/views/system/user/privateForm'), + hidden: true + }, { path: '/preview/:reportId', component: () => import('@/components/canvas/components/Editor/PreviewEject'), diff --git a/frontend/src/views/system/user/privateForm.vue b/frontend/src/views/system/user/privateForm.vue index 9181ffa4af..a4ff64871f 100644 --- a/frontend/src/views/system/user/privateForm.vue +++ b/frontend/src/views/system/user/privateForm.vue @@ -57,7 +57,7 @@ - +