1.运营后台统一增加token过期自动跳转登录页
2.H端和运营平台同账户可根据权限自由登录.
| | |
| | | package com.kidgrow.usercenter.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.kidgrow.common.constant.CommonConstant; |
| | | import com.kidgrow.common.context.ClientContextHolder; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.model.SysMenu; |
| | |
| | | |
| | | @Override |
| | | public List<SysMenu> findByRoleCodes(Set<String> roleCodes, Integer type) { |
| | | return roleMenuService.findMenusByRoleCodes(roleCodes, type, ClientContextHolder.getClient()); |
| | | String tentid=ClientContextHolder.getClient(); |
| | | if (roleCodes.contains(CommonConstant.SYSTEM_ADMIN_ROLE_CODE)) { |
| | | tentid=""; |
| | | } |
| | | return roleMenuService.findMenusByRoleCodes(roleCodes, type,tentid); |
| | | } |
| | | |
| | | /** |
| | |
| | | public SysUser selectByUsername(String username) { |
| | | String clientId = ClientContextHolder.getClient(); |
| | | List<SysUser> users = baseMapper.selectList( |
| | | new QueryWrapper<SysUser>().eq("username", username).eq("tenant_id", clientId) |
| | | //new QueryWrapper<SysUser>().eq("username", username).eq("tenant_id", clientId) |
| | | new QueryWrapper<SysUser>().eq("username", username) |
| | | ); |
| | | return getUser(users); |
| | | } |
| | |
| | | <if test="type != null"> |
| | | and t.type = #{type} |
| | | </if> |
| | | <if test="tenantId != null and tenantId !=''"> |
| | | and t.tenant_id = #{tenantId} |
| | | </if> |
| | | and t.hidden = 0 |
| | | and t.enabled = 1 |
| | | ORDER BY sort ASC |
| | |
| | | second: 1800 |
| | | #多租户配置 |
| | | tenant: |
| | | enable: true |
| | | enable: false |
| | | #多租户隔离字段 |
| | | tenantid: tenant_id |
| | | ignoreTables: |
| | |
| | | * 自主注册的创建人名称 |
| | | */ |
| | | public static final String CREATE_USER_NAME= "自动创建"; |
| | | /** |
| | | * 管理员医生角色code标识 |
| | | */ |
| | | public static final String SYSTEM_ADMIN_ROLE_CODE="ADMIN"; |
| | | } |
| | |
| | | return theRequest; |
| | | } |
| | | /** |
| | | * 自动将没权限的按钮隐藏 |
| | | * 1.判断用户是否在登录状态 |
| | | * 2.自动将没权限的按钮隐藏 |
| | | * 如果页面有列表,则在列表的 done事件内调用 |
| | | * 如果页面没有列表,则在页面所有js执行的最后调用此函数 |
| | | * |
| | |
| | | * 同时在控件上增加permissions="user-btn-import"这样的自定义属性 |
| | | * 其中引号内是菜单管理--里面对应的资源的菜单path |
| | | */ |
| | | function permissionsInput() { |
| | | function permissionsInput(res,config) { |
| | | if(!strUtil.isEmpty(res)&&res.code==401){ |
| | | config.removeToken(); |
| | | layer.msg('登录过期', {icon: 2, time: 1500}, function () { |
| | | location.replace('/login.html'); |
| | | }, 1000); |
| | | return; |
| | | } |
| | | var needpPermissions = $(".permissions"); |
| | | var permissions = layui.sessionData('tempData')['permissions']; |
| | | needpPermissions.each(function () { |
| | |
| | | {field: 'authorizedGrantTypes',width:250, sort: true, title: 'oauth授权方式'}, |
| | | {align: 'center',width:150, toolbar: '#app-table-bar', title: '操作'} |
| | | ]], |
| | | done:function(){ |
| | | permissionsInput(); |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | |
| | | { field: 'recordTitle', width: 300, sort: true, title: '标题' }, |
| | | { field: 'id', width: 250, align: 'center', toolbar: '#businessRecords-table-bar', sort: true, title: '查看详情' },// 0就诊数据 1筛查 |
| | | { field: 'createTime', width: 250, sort: true, title: '时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" } |
| | | ]] |
| | | ]], |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | | // 工具条点击事件 |
| | |
| | | { field: 'createTime', width: 250, title: '时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy-MM-dd HH:mm')}}</div>" }, |
| | | { field: 'id', width: 250, align: 'center', toolbar: '#company-table-bar', title: '操作' }, |
| | | ]], |
| | | done:function(){ |
| | | permissionsInput(); |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | |
| | | }}, |
| | | { align: 'center', width: 150, toolbar: '#contract-table-bar', title: '操作' } |
| | | ]], |
| | | done:function(){ |
| | | permissionsInput(); |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | } |
| | |
| | | { field: 'needTags', width: 100, align: 'center', toolbar: '#app-table-bar', title: '需求标签' }, |
| | | { field: 'enabled', width: 200, toolbar: '#app-table-bar1', title: '处理状态', }, |
| | | { field: 'downTime', width: 250, title: '下载时间', templet: "<div>{{layui.util.toDateString(d.downTime, 'yyyy-MM-dd HH:mm')}}</div>" } |
| | | ]],done:function(){ |
| | | permissionsInput(); |
| | | ]],done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | |
| | | }, |
| | | { field: 'enabled', width: 100, templet: '#diagnostic-table-bar', title: '查看' } |
| | | ]], |
| | | done:function(){ |
| | | permissionsInput(); |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | // 搜索按钮点击事件 |
| | |
| | | { width: 300, align: 'center', toolbar: '#doctor-table-bar', title: '操作' }, |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | permissionsInput(); |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | |
| | | { field: 'enabled', width: 100, sort: true, templet: '#doctor-templete-tpl-state', title: '状态' }, |
| | | { field: 'recordTitle', width: 300, toolbar: '#doctor-templete-table-bar', sort: true, title: '操作' }, |
| | | ]], |
| | | done:function(){ |
| | | permissionsInput(); |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | |
| | | return new Date(d.createTime).dateFormat("yyyy-MM-dd hh:mm"); |
| | | } }, |
| | | { align: 'center', width: 200, toolbar: '#feeedback-table-bar', title: '操作' } |
| | | ]],done:function(){ |
| | | permissionsInput(); |
| | | ]],done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | |
| | | { field: 'enabled', width: 100, templet: '#hospital-tpl-state', title: '状态' }, |
| | | { field: 'hospitalId', width: 300, align: 'center', toolbar: '#businessRecords-table-bar', title: '操作', fixed: 'right' } |
| | | ]], |
| | | done:function(){ |
| | | permissionsInput(); |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | //省份数据加载 |
| | |
| | | var tree = parent.layui.tree; |
| | | var $ = parent.layui.jquery; |
| | | |
| | | permissionsInput(); |
| | | permissionsInput(res,config); |
| | | //组织结构树 |
| | | var getData = function () { |
| | | admin.req('api-user/sysorganization/getTree', { is_del: 0, enabled: 1 }, function (data) { |
| | |
| | | }, |
| | | { align: 'center', width: 100, toolbar: '#product-table-bar', title: '操作' } |
| | | ]], |
| | | done: function () { |
| | | permissionsInput(); |
| | | done: function (res) { |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | } |
| | |
| | | |
| | | }); |
| | | |
| | | permissionsInput(); |
| | | permissionsInput(res,config); |
| | | </script> |
| | |
| | | }, |
| | | { field: 'isShare', fixed: 'right', align: 'center', width: 100, templet: '#product-tpl-isShare', title: '共享' }, |
| | | { field: 'id', fixed: 'right', align: 'center', width: 100, toolbar: '#product-tpl-bar', title: '操作' } |
| | | ]] |
| | | ]], |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | //待充值列表功能操作 |
| | | table.on('tool(product-table-temp)', function (obj) { |
| | |
| | | return false; |
| | | }); |
| | | }); |
| | | permissionsInput(); |
| | | </script> |
| | |
| | | { field: 'enabled', align: 'right', sort: true, templet: '#organization-tpl-state', title: '状态' }, |
| | | { toolbar: '#organization-table-bar', align: 'right', align: 'center', title: '操作' } |
| | | ]], |
| | | done: function () { |
| | | permissionsInput(); |
| | | done: function (res) { |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | }; |
| | |
| | | { field: 'createTime', width: 250, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy-MM-dd HH:mm')}}</div>" }, |
| | | { field: 'id', width: 250, align: 'center', toolbar: '#dictionaries-table-bar', title: '操作' },// 0就诊数据 1筛查 |
| | | ]], |
| | | done:function(){ |
| | | permissionsInput(); |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | |
| | | }, |
| | | { field: 'enabled', width: 100, templet: '#product-tpl-state', sort: true, title: '审核' } |
| | | ]], |
| | | done:function(){ |
| | | permissionsInput(); |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | } |
| | |
| | | { field: 'enabled', width: 100, sort: true, templet: '#menu-tpl-state', title: '状态' }, |
| | | { templet: '#menus-state', width: 120, align: 'center', title: '操作' } |
| | | ]], |
| | | done: function () { |
| | | permissionsInput(); |
| | | done: function (res) { |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | }; |
| | |
| | | { field: 'enabled', width: 100, sort: true, templet: '#role-tpl-state', title: '状态' }, |
| | | { align: 'center', toolbar: '#role-table-bar', title: '操作', width: 320 } |
| | | ]], |
| | | done:function(){ |
| | | permissionsInput(); |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | |
| | | { field: 'enabled', width: 100, sort: true, templet: '#area-tpl-state', title: '状态' }, |
| | | { templet: '#area-table-bar', width: 120, align: 'center', title: '操作' } |
| | | ]], |
| | | done: function () { |
| | | done: function (res) { |
| | | layer.closeAll('loading'); |
| | | permissionsInput(); |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | }; |
| | |
| | | {field: 'clientId',width:180, sort: true, title: '所属应用'}, |
| | | {align: 'center',width:100, toolbar: '#tokens-table-bar', title: '操作'} |
| | | ]], |
| | | done:function(){ |
| | | permissionsInput(); |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | |
| | | elem: '#user-table', |
| | | url: config.base_server + 'api-user/users', |
| | | method: 'GET', |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token }, |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token}, |
| | | page: true, |
| | | cols: [[ |
| | | { field: 'id', sort: true, width: 200, title: '标识' }, |
| | |
| | | { fixed: 'right', align: 'center', toolbar: '#user-table-bar', title: '操作', width: 300 } |
| | | ]], |
| | | done:function(res){ |
| | | if(res.code==401){ |
| | | config.removeToken(); |
| | | layer.msg('登录过期', {icon: 2, time: 1500}, function () { |
| | | location.replace('/login.html'); |
| | | }, 1000); |
| | | return; |
| | | } |
| | | permissionsInput(); |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |