develop
mengqiang 4 years ago
parent 6bfd6b2530
commit e7fc077a49
  1. 3
      sso-auth-center-service/sso-auth-center-admin/src/main/resources/config/application-dev.properties
  2. 15
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/mapper/SsoLoginLogMapper.java
  3. 7
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/platform/SystemUpdateSecretBO.java
  4. 13
      sso-auth-center-service/sso-business/src/main/java/com/sso/service/admin/impl/SystemServiceImpl.java
  5. 5
      sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoLoginLogMapper.xml
  6. 1
      sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoMenuMapper.xml
  7. 4
      sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoUserMapper.xml
  8. 6
      sso-auth-center-service/sso-common/src/main/java/com/sso/common/utils/ip/IpAddressUtils.java
  9. 1
      sso-auth-center-vue/README.md
  10. 3
      sso-auth-center-vue/src/layout/index.vue
  11. 5
      sso-auth-center-vue/src/main.js
  12. 1
      sso-auth-center-vue/src/views/sso/platform/platformDetail.vue
  13. 3
      sso-auth-center-vue/src/views/sso/platform/platformMgmt.vue
  14. 17
      sso-auth-center-vue/src/views/sso/role/index.vue
  15. 4
      sso-auth-center-vue/src/views/sso/user/index.vue

@ -2,7 +2,8 @@ server.port=9901
#日志配置
logging.level.root=info
logging.level.com.sso=DEBUG
#认证中心日志配置
logging.level.com.sso=info
logging.level.org.springframework=warn
#日志文件路径
log.root.path=${user.home}/logs/sso-auth-center

@ -13,7 +13,6 @@ import java.util.List;
* 登录日志基础mapper接口
*
* @author 程序员小强
* @date 2021-01-23 10:45:22
*/
public interface SsoLoginLogMapper {
@ -22,7 +21,6 @@ public interface SsoLoginLogMapper {
*
* @param requestId 自增主键
* @return 登录日志实体
* @date 20-01-19 10:45:22
*/
SsoLoginLog getByRequestId(String requestId);
@ -47,7 +45,6 @@ public interface SsoLoginLogMapper {
*
* @param ssoLoginLog 登录日志实体
* @return 新增的行数
* @date 2021-01-23 10:45:22
*/
int insert(SsoLoginLog ssoLoginLog);
@ -56,25 +53,14 @@ public interface SsoLoginLogMapper {
*
* @param ssoLoginLog 登录日志实体
* @return 新增的行数
* @date 2021-01-23 10:45:22
*/
int insertSelective(SsoLoginLog ssoLoginLog);
/**
* 根据自增主键删除接口
*
* @param id 自增主键主键
* @return 删除的行数
* @date 2021-01-23 10:45:22
*/
int deleteByPrimaryKey(Long id);
/**
* 根据自增主键编辑接口
*
* @param ssoLoginLog 登录日志实体
* @return 编辑的行数
* @date 2021-01-23 10:45:22
*/
int updateByPrimaryKey(SsoLoginLog ssoLoginLog);
@ -83,7 +69,6 @@ public interface SsoLoginLogMapper {
*
* @param ssoLoginLog 登录日志实体
* @return 编辑的行数
* @date 2021-01-23 10:45:22
*/
int updateByPrimaryKeySelective(SsoLoginLog ssoLoginLog);

@ -3,6 +3,7 @@ package com.sso.model.bo.platform;
import com.sso.common.model.BaseOperateBO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
@ -21,6 +22,12 @@ public class SystemUpdateSecretBO extends BaseOperateBO {
@NotNull(message = "系统平台ID不为空")
private Long sysId;
/**
* 系统编码
*/
@NotBlank(message = "系统编码不为空")
private String sysCode;
/**
* 签名类型 0-;1-MD5;2-RSA;
*/

@ -25,7 +25,9 @@ import com.sso.model.vo.platform.SystemListVO;
import com.sso.service.admin.SystemService;
import com.sso.service.admin.login.PermissionService;
import com.sso.service.base.SysConfigService;
import com.sso.service.base.SystemCacheService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
@ -63,6 +65,8 @@ public class SystemServiceImpl implements SystemService {
private SysConfigProperty sysConfigProperty;
@Resource
private SysConfigService sysConfigService;
@Resource
private SystemCacheService systemCacheService;
/**
* 我的平台列表
@ -245,6 +249,10 @@ public class SystemServiceImpl implements SystemService {
//修改平台
ssoSystemMapper.updateBySysId(ssoSystem);
//移除缓存
systemCacheService.removeSystemCache(updateBO.getSysCode());
log.info("[ 平台修改完成 ] >> {}", updateBO.getLogValue());
}
@ -264,6 +272,8 @@ public class SystemServiceImpl implements SystemService {
ssoSystem.setUpdateBy(updateBO.getOperateBy());
//修改平台
ssoSystemMapper.updateSecretBySysId(ssoSystem);
//移除缓存
systemCacheService.removeSystemCache(updateBO.getSysCode());
log.info("[ 平台修改秘钥完成 ] >> {} ", updateBO.getLogValue());
}
@ -294,6 +304,9 @@ public class SystemServiceImpl implements SystemService {
deleteSystem.setDelFlag(DelFlagEnum.DELETED.getStatus());
deleteSystem.setUpdateBy(deleteBO.getOperateBy());
ssoSystemMapper.updateBySysIdSelective(deleteSystem);
//移除缓存
systemCacheService.removeSystemCache(deleteSystem.getSysCode());
log.info("[ 平台删除完成 ] >> sysId:{} , operateBy:{}", deleteBO.getSysId(), deleteBO.getOperateBy());
}

@ -195,11 +195,6 @@
</trim>
</insert>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
DELETE FROM sso_login_log
WHERE id = #{id,jdbcType=BIGINT}
</delete>
<update id="updateByPrimaryKey" parameterType="com.sso.dao.entity.SsoLoginLog">
UPDATE sso_login_log
SET

@ -83,6 +83,7 @@
WHERE del_flag=0
AND sys_code = #{sysCode,jdbcType=VARCHAR}
AND menu_name = #{menuName,jdbcType=VARCHAR}
LIMIT 1
</select>
<select id="getEnableMenuListBySysCode" resultMap="BaseResultMap">

@ -141,7 +141,7 @@
AND a.status = #{status,jdbcType=INTEGER}
</if>
<if test="delFlag != null">
AND del_flag = #{delFlag,jdbcType=INTEGER}
AND a.del_flag = #{delFlag,jdbcType=INTEGER}
</if>
</where>
</select>
@ -174,7 +174,7 @@
AND a.status = #{status,jdbcType=INTEGER}
</if>
<if test="delFlag != null">
AND del_flag = #{delFlag,jdbcType=INTEGER}
AND a.del_flag = #{delFlag,jdbcType=INTEGER}
</if>
</where>
ORDER BY a.status,a.update_time desc

@ -65,15 +65,13 @@ public class IpAddressUtils {
//详细地址 示例:浙江省杭州市 电信
String addr = jsonObject.getString("addr");
if (StringUtils.isNoneBlank(addr)) {
addr = addr.replaceAll(province, "")
.replaceAll(city, "").trim();
return addr;
addr = addr.replaceAll(province, "").replaceAll(city, "").trim();
}
//示例:浙江省 杭州市 电信
return String.format("%s %s %s", province, city, addr);
} catch (Exception e) {
log.error("[ 根据IP-获取地理位置异常 ] >> {}", ip);
log.error("[ 根据IP-获取地理位置异常 ] >> {}", ip, e);
}
return UNKNOWN;
}

@ -24,5 +24,4 @@ npm run dev
npm run build-test
# 构建生产环境
npm run build-prod
```

@ -201,6 +201,9 @@ export default {
if (key === '' || key === null) {
return
}
if(this.$route.path === key){
return
}
//
if (isExternal(key)) {
const lastActiveIndex = sessionStorage.getItem('activeIndex')

@ -3,12 +3,15 @@ import Vue from 'vue'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '@/styles/index.scss'
import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n
import Pagination from '@/components/Pagination'
import { handleTree, resetForm } from '@/utils/admin-util'
import '@/styles/index.scss' // global css
// global css
import App from './App'
import store from './store'
import router from './router'

@ -334,6 +334,7 @@ export default {
this.reset()
this.getDetail()
this.updateSecretForm.sysId = this.detailData.sysId
this.updateSecretForm.sysCode = this.targetSysCode
this.updateSecretForm.sysName = this.detailData.sysName
this.updateSecretForm.signType = this.detailData.signType
this.updateSecretForm.publicKey = this.detailData.publicKey

@ -99,6 +99,9 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-row v-if="platformList.length<=0">
<p style="text-align: center"> 您还没有平台管理权限,联系管理员添加吧</p>
</el-row>
</div>
</template>
<style scoped>

@ -138,7 +138,7 @@
<el-form-item label="菜单权限">
<el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event)">展开/折叠</el-checkbox>
<el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event)">全选/全不选</el-checkbox>
<el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event)">父子联动
<el-checkbox v-model="menuCheckAll" @change="handleCheckedTreeConnect($event)">父子联动
</el-checkbox>
<el-tree
class="tree-border"
@ -199,16 +199,14 @@ export default {
openDataScope: false,
menuExpand: false,
menuNodeAll: false,
deptExpand: true,
deptNodeAll: false,
//
menuCheckAll: false,
//
dateRange: [],
//
statusOptions: [],
//
menuOptions: [],
//
deptOptions: [],
//
queryParams: {
page: 1,
@ -226,8 +224,6 @@ export default {
form: {},
// JSON
oldFormJson: '',
//
menuCheckAll: true,
defaultProps: {
children: 'children',
label: 'menuName'
@ -291,12 +287,13 @@ export default {
const roleId = row.roleId || this.ids
getRoleDetail(roleId).then(response => {
this.form = response.data
this.form.menuCheckStrictly = true
this.oldFormJson = JSON.stringify(this.form)
this.open = true
this.menuCheckAll=false;
//
this.$nextTick(() => {
this.$refs.menu.setCheckedKeys(response.data.menuIdList)
this.menuCheckAll=true;
})
this.title = '修改角色'
})
@ -387,8 +384,6 @@ export default {
}
this.menuExpand = false,
this.menuNodeAll = false,
this.deptExpand = true,
this.deptNodeAll = false,
this.form = {
sysCode: this.targetSysCode,
roleId: undefined,
@ -432,7 +427,7 @@ export default {
this.$refs.menu.setCheckedNodes(value ? this.menuOptions : [])
},
//
handleCheckedTreeConnect(value, type) {
handleCheckedTreeConnect(value) {
this.menuCheckAll = value ? true : false
}
}

@ -93,8 +93,8 @@
<el-table-column fixed type="selection" width="40" align="center" :selectable='selectInit'/>
<el-table-column fixed label="用户ID" align="center" prop="userId" min-width="100px" show-overflow-tooltip/>
<el-table-column fixed label="登录名" align="center" prop="username" min-width="120px" show-overflow-tooltip/>
<el-table-column label="用户昵称" align="center" prop="nickName" min-width="110px" show-overflow-tooltip/>
<el-table-column label="真实姓名" align="center" prop="realName" min-width="110px" show-overflow-tooltip/>
<el-table-column label="用户昵称" align="center" prop="nickName" min-width="120px" show-overflow-tooltip/>
<el-table-column label="真实姓名" align="center" prop="realName" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="status" label="状态" align="center" width="58" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.status === 0"> <el-tag type="success" size="mini">启用</el-tag></span>

Loading…
Cancel
Save