Conflicts:
	.gitignore
	ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java
	ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java
	ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml
	ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
	ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml
	ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml
	ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml
	ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml
	ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml
	ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
	ruoyi-ui/src/utils/request.js
	ruoyi-ui/src/utils/ruoyi.js
feature/model
疯狂的狮子li 4 years ago
commit a9f4a4e111

3
.gitignore vendored

@ -37,7 +37,8 @@ nbdist/
# Others # Others
*.log *.log
*.xml.versionsBackup *.xml.versionsBackup
*.swp
!*/build/*.java !*/build/*.java
!*/build/*.html !*/build/*.html
!*/build/*.xml !*/build/*.xml

@ -476,7 +476,7 @@ public class ExcelUtil<T>
{ {
if (ColumnType.STRING == attr.cellType()) if (ColumnType.STRING == attr.cellType())
{ {
cell.setCellType(CellType.NUMERIC); cell.setCellType(CellType.STRING);
cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : value + attr.suffix()); cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : value + attr.suffix());
} }
else if (ColumnType.NUMERIC == attr.cellType()) else if (ColumnType.NUMERIC == attr.cellType())

@ -5,7 +5,10 @@ import org.springframework.beans.BeansException;
import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor; import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.ruoyi.common.utils.StringUtils;
/** /**
* spring 便springbean * spring 便springbean
@ -13,17 +16,25 @@ import org.springframework.stereotype.Component;
* @author ruoyi * @author ruoyi
*/ */
@Component @Component
public final class SpringUtils implements BeanFactoryPostProcessor public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationContextAware
{ {
/** Spring应用上下文环境 */ /** Spring应用上下文环境 */
private static ConfigurableListableBeanFactory beanFactory; private static ConfigurableListableBeanFactory beanFactory;
private static ApplicationContext applicationContext;
@Override @Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
{ {
SpringUtils.beanFactory = beanFactory; SpringUtils.beanFactory = beanFactory;
} }
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
{
SpringUtils.applicationContext = applicationContext;
}
/** /**
* *
* *
@ -111,4 +122,25 @@ public final class SpringUtils implements BeanFactoryPostProcessor
{ {
return (T) AopContext.currentProxy(); return (T) AopContext.currentProxy();
} }
/**
* null
*
* @return
*/
public static String[] getActiveProfiles()
{
return applicationContext.getEnvironment().getActiveProfiles();
}
/**
*
*
* @return
*/
public static String getActiveProfile()
{
final String[] activeProfiles = getActiveProfiles();
return StringUtils.isNotEmpty(activeProfiles) ? activeProfiles[0] : null;
}
} }

@ -75,7 +75,7 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService
@Override @Override
public SysUserOnline loginUserToUserOnline(LoginUser user) public SysUserOnline loginUserToUserOnline(LoginUser user)
{ {
if (StringUtils.isNull(user) && StringUtils.isNull(user.getUser())) if (StringUtils.isNull(user) || StringUtils.isNull(user.getUser()))
{ {
return null; return null;
} }

@ -61,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult"> <select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult">
<include refid="selectConfigVo"/> <include refid="selectConfigVo"/>
where config_key = #{configKey} where config_key = #{configKey} limit 1
</select> </select>
<insert id="insertConfig" parameterType="SysConfig"> <insert id="insertConfig" parameterType="SysConfig">

@ -64,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="hasChildByDeptId" parameterType="Long" resultType="int"> <select id="hasChildByDeptId" parameterType="Long" resultType="int">
select count(1) from sys_dept select count(1) from sys_dept
where del_flag = '0' and parent_id = #{deptId} where del_flag = '0' and parent_id = #{deptId} limit 1
</select> </select>
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult"> <select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">

@ -57,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult"> <select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/> <include refid="selectDictTypeVo"/>
where dict_type = #{dictType} where dict_type = #{dictType} limit 1
</select> </select>
<delete id="deleteDictTypeById" parameterType="Long"> <delete id="deleteDictTypeById" parameterType="Long">

@ -118,7 +118,7 @@
<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult"> <select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
<include refid="selectMenuVo"/> <include refid="selectMenuVo"/>
where menu_name=#{menuName} and parent_id = #{parentId} where menu_name=#{menuName} and parent_id = #{parentId} limit 1
</select> </select>
<update id="updateMenu" parameterType="SysMenu"> <update id="updateMenu" parameterType="SysMenu">

@ -64,12 +64,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult"> <select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
<include refid="selectPostVo"/> <include refid="selectPostVo"/>
where post_name=#{postName} where post_name=#{postName} limit 1
</select> </select>
<select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult"> <select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
<include refid="selectPostVo"/> <include refid="selectPostVo"/>
where post_code=#{postCode} where post_code=#{postCode} limit 1
</select> </select>
<update id="updatePost" parameterType="SysPost"> <update id="updatePost" parameterType="SysPost">

@ -80,12 +80,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult"> <select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
<include refid="selectRoleVo"/> <include refid="selectRoleVo"/>
where r.role_name=#{roleName} where r.role_name=#{roleName} limit 1
</select> </select>
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult"> <select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
<include refid="selectRoleVo"/> <include refid="selectRoleVo"/>
where r.role_key=#{roleKey} where r.role_key=#{roleKey} limit 1
</select> </select>
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId"> <insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">

@ -10,7 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<select id="checkMenuExistRole" resultType="Integer"> <select id="checkMenuExistRole" resultType="Integer">
select count(1) from sys_role_menu where menu_id = #{menuId} select count(1) from sys_role_menu where menu_id = #{menuId}
</select> </select>
<delete id="deleteRoleMenuByRoleId" parameterType="Long"> <delete id="deleteRoleMenuByRoleId" parameterType="Long">

@ -92,15 +92,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="checkUserNameUnique" parameterType="String" resultType="int"> <select id="checkUserNameUnique" parameterType="String" resultType="int">
select count(1) from sys_user where user_name = #{userName} select count(1) from sys_user where user_name = #{userName} limit 1
</select> </select>
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult"> <select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} limit 1
</select> </select>
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult"> <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
select user_id, email from sys_user where email = #{email} select user_id, email from sys_user where email = #{email} limit 1
</select> </select>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">

@ -32,17 +32,14 @@ service.interceptors.response.use(res => {
// 获取错误信息 // 获取错误信息
const msg = errorCode[code] || res.data.msg || errorCode['default'] const msg = errorCode[code] || res.data.msg || errorCode['default']
if (code === 401) { if (code === 401) {
MessageBox.confirm( MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
'登录状态已过期,您可以继续留在该页面,或者重新登录',
'系统提示',
{
confirmButtonText: '重新登录', confirmButtonText: '重新登录',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
} }
).then(() => { ).then(() => {
store.dispatch('LogOut').then(() => { store.dispatch('LogOut').then(() => {
location.reload() // 为了重新实例化vue-router对象 避免bug location.href = '/index';
}) })
}) })
} else if (code === 500) { } else if (code === 500) {

@ -54,15 +54,12 @@ export function resetForm(refName) {
} }
// 添加日期范围 // 添加日期范围
export function addDateRange(params, dateRange) { export function addDateRange (params = {}, dateRange) {
var search = params; if (dateRange != null && dateRange !== '') {
search.beginTime = ""; params.beginTime = this.dateRange[0]
search.endTime = ""; params.endTime = this.dateRange[1]
if (null != dateRange && '' != dateRange) {
search.beginTime = this.dateRange[0];
search.endTime = this.dateRange[1];
} }
return search; return params
} }
// 回显数据字典 // 回显数据字典
@ -83,8 +80,8 @@ export function selectDictLabels(datas, value, separator) {
var currentSeparator = undefined === separator ? "," : separator; var currentSeparator = undefined === separator ? "," : separator;
var temp = value.split(currentSeparator); var temp = value.split(currentSeparator);
Object.keys(value.split(currentSeparator)).some((val) => { Object.keys(value.split(currentSeparator)).some((val) => {
Object.keys(datas).some((key) => { Object.keys(datas).some((key) => {
if (datas[key].dictValue == ('' + temp[val])) { if (datas[key].dictValue == ('' + temp[val])) {
actions.push(datas[key].dictLabel + currentSeparator); actions.push(datas[key].dictLabel + currentSeparator);
} }
}) })
@ -146,4 +143,3 @@ export function handleTree(data, id, parentId, children, rootId) {
}); });
return treeData != '' ? treeData : data; return treeData != '' ? treeData : data;
} }

Loading…
Cancel
Save