..
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
package com.budwk.app.base.utils;
|
||||
|
||||
import com.antherd.smcrypto.sm2.Sm2;
|
||||
import com.antherd.smcrypto.sm3.Sm3;
|
||||
import com.antherd.smcrypto.sm4.Sm4;
|
||||
import com.antherd.smcrypto.sm4.Sm4Options;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.lang.Lang;
|
||||
|
||||
@@ -17,15 +13,6 @@ import java.security.MessageDigest;
|
||||
@Slf4j
|
||||
public class PwdUtil {
|
||||
|
||||
/** 公钥 */
|
||||
private static final String PUBLIC_KEY = "04298364ec840088475eae92a591e01284d1abefcda348b47eb324bb521bb03b0b2a5bc393f6b71dabb8f15c99a0050818b56b23f31743b93df9cf8948f15ddb54";
|
||||
|
||||
/** 私钥 */
|
||||
private static final String PRIVATE_KEY = "3037723d47292171677ec8bd7dc9af696c7472bc5f251b2cec07e65fdef22e25";
|
||||
|
||||
/** SM4的对称秘钥(生产环境需要改成自己使用的) 16 进制字符串,要求为 128 比特 */
|
||||
private static final String KEY = "0123456789abcdeffedcba9876543210";
|
||||
|
||||
public static String getPassword(String passowrd, String salt) {
|
||||
byte[] bytes = hash(passowrd.getBytes(), salt.getBytes(), 1024);
|
||||
if (bytes != null) {
|
||||
@@ -56,78 +43,4 @@ public class PwdUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解密方法
|
||||
* 如果采用加密机的方法,用try catch 捕捉异常,返回原文值即可
|
||||
* @param str 密文
|
||||
* @return 解密后的明文
|
||||
*/
|
||||
public static String doSm2Decrypt(String str) {
|
||||
// 解密
|
||||
return Sm2.doDecrypt(str, PRIVATE_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加密方法
|
||||
* @param str 待加密数据
|
||||
* @return 加密后的密文
|
||||
*/
|
||||
public static String doSm4CbcEncrypt(String str) {
|
||||
// SM4 加密 cbc模式
|
||||
Sm4Options sm4Options4 = new Sm4Options();
|
||||
sm4Options4.setMode("cbc");
|
||||
sm4Options4.setIv("fedcba98765432100123456789abcdef");
|
||||
return Sm4.encrypt(str, KEY, sm4Options4);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解密方法
|
||||
* 如果采用加密机的方法,用try catch 捕捉异常,返回原文值即可
|
||||
* @param str 密文
|
||||
* @return 解密后的明文
|
||||
*/
|
||||
public static String doSm4CbcDecrypt(String str) {
|
||||
// 解密,cbc 模式,输出 utf8 字符串
|
||||
Sm4Options sm4Options8 = new Sm4Options();
|
||||
sm4Options8.setMode("cbc");
|
||||
sm4Options8.setIv("fedcba98765432100123456789abcdef");
|
||||
String docString = Sm4.decrypt(str, KEY, sm4Options8);
|
||||
if ("".equals(docString)) {
|
||||
log.warn(">>> 字段解密失败,返回原文值:{}", str);
|
||||
return str;
|
||||
} else {
|
||||
return docString;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 纯签名
|
||||
* @param str 待签名数据
|
||||
* @return 签名结果
|
||||
*/
|
||||
public static String doSignature(String str) {
|
||||
return Sm2.doSignature(str, PRIVATE_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过杂凑算法取得hash值,用于做数据完整性保护
|
||||
*
|
||||
* @param str 字符串
|
||||
* @return hash 值
|
||||
*/
|
||||
public static String doHashValue(String str) {
|
||||
return Sm3.sm3(str);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// String pwd = "123456";
|
||||
// String dbPwd = PwdUtil.doHashValue(pwd);
|
||||
// String s = PwdUtil.doHashValue(PwdUtil.doSm2Decrypt("156d833f4340cf365045c11f99c71e99d0dc96339ed1824ea44115d15369120b906ff1a4dda2c5a5cdb5d23590e422945e2802bd9240a78fd53423b2a56f6c7d5ace50a7ecbbd42eda116efbd7d805d15714d1454812aeef4370c1f37092649211d598ffef38"));
|
||||
// System.out.println(dbPwd);
|
||||
// System.out.println(s);
|
||||
|
||||
String pwd = "dd3s@#2022";
|
||||
String dbPwd = PwdUtil.doHashValue(pwd);
|
||||
System.out.println(dbPwd);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,10 +77,9 @@ public class SysUserController {
|
||||
return Result.error("密码必须包含大写字母、小写字母和数字,并且长度在8-20之间!");
|
||||
}
|
||||
|
||||
// String salt = R.UU32();
|
||||
// user.setSalt(salt);
|
||||
// user.setPassword(PwdUtil.getPassword(user.getPassword(), salt));
|
||||
user.setPassword(PwdUtil.doHashValue(user.getPassword()));
|
||||
String salt = R.UU32();
|
||||
user.setSalt(salt);
|
||||
user.setPassword(PwdUtil.getPassword(user.getPassword(), salt));
|
||||
user.setLoginCount(0);
|
||||
user.setUnitPath(sysUnitService.fetch(user.getUnitId()).getPath());
|
||||
sysUserService.insert(user);
|
||||
@@ -108,7 +107,7 @@ public class SysUserController {
|
||||
LEFT JOIN sys_unit n ON n.id = u.unitid
|
||||
WHERE u.id = @id
|
||||
""");
|
||||
sql.setParam("id",id);
|
||||
sql.setParam("id", id);
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
sysUserService.execute(sql);
|
||||
return Result.success().addData(sql.getResult());
|
||||
@@ -124,7 +123,7 @@ public class SysUserController {
|
||||
public Object editDo(@Param("..") Sys_user user, HttpServletRequest req) {
|
||||
try {
|
||||
// sysUserService.updateIgnoreNull(user);
|
||||
sysUserService.dao().update(user,"username");
|
||||
sysUserService.dao().update(user, "username");
|
||||
sysUserService.deleteCache(user.getId());
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
@@ -140,9 +139,9 @@ public class SysUserController {
|
||||
try {
|
||||
Sys_user user = sysUserService.fetch(id);
|
||||
String pwd = R.captchaNumber(6);
|
||||
String hashedPasswordBase64 = PwdUtil.doHashValue(user.getPassword());
|
||||
// String hashedPasswordBase64 = PwdUtil.getPassword(pwd, salt);
|
||||
sysUserService.update(Chain.make("password", hashedPasswordBase64), Cnd.where("id", "=", id));
|
||||
String salt = R.UU32();
|
||||
String encryptPwd = PwdUtil.getPassword(pwd, salt);
|
||||
sysUserService.update(Chain.make("password", encryptPwd).add("salt", salt), Cnd.where("id", "=", id));
|
||||
sysUserService.deleteCache(user.getId());
|
||||
req.setAttribute("loginname", user.getLoginname());
|
||||
return Result.success().addData(pwd);
|
||||
@@ -295,45 +294,6 @@ public class SysUserController {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("beetl:/platform/sys/user/info.html")
|
||||
@SaCheckLogin
|
||||
public void info(HttpServletRequest req) {
|
||||
Sys_user user = sysUserService.fetch(SecurityUtil.getUserId());
|
||||
req.setAttribute("user", user);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("beetl:/platform/sys/user/custom.html")
|
||||
@SaCheckLogin
|
||||
public void custom() {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("beetl:/platform/sys/user/mode.html")
|
||||
@SaCheckLogin
|
||||
public void mode() {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
@SaCheckLogin
|
||||
public Object modeDo(@Param("mode") String mode, HttpServletRequest req) {
|
||||
try {
|
||||
if ("superadmin".equals(SecurityUtil.getUserUsername()) && Globals.MyConfig.getBoolean("AppDemoEnv")) {
|
||||
return Result.error("演示环境,不予操作");
|
||||
}
|
||||
sysUserService.update(Chain.make("loginPjax", "true".equals(mode)), Cnd.where("id", "=", SecurityUtil.getUserId()));
|
||||
Sys_user user = sysUserService.getUserById(SecurityUtil.getUserId());
|
||||
sysUserService.deleteCache(user.getId());
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
@SaCheckLogin
|
||||
@@ -341,19 +301,20 @@ public class SysUserController {
|
||||
if ("superadmin".equals(SecurityUtil.getUserLoginname()) && Globals.MyConfig.getBoolean("AppDemoEnv")) {
|
||||
return Result.error("演示环境,不予操作");
|
||||
}
|
||||
Sys_user user = sysUserService.getUserById(SecurityUtil.getUserId());
|
||||
String old = PwdUtil.getPassword(oldPassword, user.getSalt());
|
||||
if (old.equals(user.getPassword())) {
|
||||
String salt = R.UU32();
|
||||
String hashedPasswordBase64 = PwdUtil.getPassword(newPassword, salt);
|
||||
user.setSalt(salt);
|
||||
user.setPassword(hashedPasswordBase64);
|
||||
sysUserService.update(Chain.make("salt", salt).add("password", hashedPasswordBase64), Cnd.where("id", "=", user.getId()));
|
||||
sysUserService.deleteCache(user.getId());
|
||||
return Result.success();
|
||||
} else {
|
||||
return Result.error();
|
||||
}
|
||||
// Sys_user user = sysUserService.getUserById(SecurityUtil.getUserId());
|
||||
// String old = PwdUtil.getPassword(oldPassword, user.getSalt());
|
||||
// if (old.equals(user.getPassword())) {
|
||||
// String salt = R.UU32();
|
||||
// String hashedPasswordBase64 = PwdUtil.getPassword(newPassword, salt);
|
||||
// user.setSalt(salt);
|
||||
// user.setPassword(hashedPasswordBase64);
|
||||
// sysUserService.update(Chain.make("salt", salt).add("password", hashedPasswordBase64), Cnd.where("id", "=", user.getId()));
|
||||
// sysUserService.deleteCache(user.getId());
|
||||
// return Result.success();
|
||||
// } else {
|
||||
// return Result.error();
|
||||
// }
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
|
||||
@@ -171,32 +171,6 @@ public interface SysUserService extends BaseService<Sys_user> {
|
||||
*/
|
||||
Sys_user getUserAndMenuById(String userId);
|
||||
|
||||
/**
|
||||
* 通过用户名重置密码
|
||||
*
|
||||
* @param loginname 用户名
|
||||
* @param password 新密码
|
||||
* @throws BaseException
|
||||
*/
|
||||
void setPwdByLoginname(String loginname, String password) throws BaseException;
|
||||
|
||||
/**
|
||||
* 通过用户ID重置密码
|
||||
*
|
||||
* @param id 用户ID
|
||||
* @param password 新密码
|
||||
* @throws BaseException
|
||||
*/
|
||||
void setPwdById(String id, String password) throws BaseException;
|
||||
|
||||
/**
|
||||
* 设置用户自定义样式
|
||||
*
|
||||
* @param id 用户ID
|
||||
* @param themeConfig 样式内容
|
||||
*/
|
||||
void setThemeConfig(String id, String themeConfig);
|
||||
|
||||
/**
|
||||
* 更新用户登录信息
|
||||
*
|
||||
|
||||
@@ -142,9 +142,11 @@ public class SysDataUserAllUpdateServiceImpl implements SysDataUserUpdateService
|
||||
// 新增教工,去初始化数据
|
||||
String salt = R.UU32();
|
||||
u.setSalt(salt);
|
||||
u.setPassword(PwdUtil.getPassword(R.UU32(), salt));
|
||||
// 随机密码
|
||||
String pwd = R.captchaNumber(6);
|
||||
u.setPassword(PwdUtil.getPassword(pwd, salt));
|
||||
u.setLoginCount(0);
|
||||
} else if (user != null){
|
||||
} else if (user != null) {
|
||||
// 修改数据
|
||||
u.setId(user.getId());
|
||||
needDoUpdateList.add(u);
|
||||
@@ -212,6 +214,7 @@ public class SysDataUserAllUpdateServiceImpl implements SysDataUserUpdateService
|
||||
|
||||
/**
|
||||
* 构建变更的历史数据
|
||||
*
|
||||
* @param source
|
||||
* @param user
|
||||
* @param dictMap
|
||||
@@ -259,11 +262,12 @@ public class SysDataUserAllUpdateServiceImpl implements SysDataUserUpdateService
|
||||
|
||||
/**
|
||||
* 比较变更类型公共方法
|
||||
*
|
||||
* @param source
|
||||
* @param user
|
||||
* @param changeTypes
|
||||
*/
|
||||
private void commonCompareChange(Sys_user_source source, Sys_user user, List<String> changeTypes){
|
||||
private void commonCompareChange(Sys_user_source source, Sys_user user, List<String> changeTypes) {
|
||||
changeTypes.add(MemberChangeType.BASIC_CHANGE.name());
|
||||
|
||||
// if (!ObjectUtil.equals(user.getUserState(), source.getUserState())) {
|
||||
@@ -274,7 +278,7 @@ public class SysDataUserAllUpdateServiceImpl implements SysDataUserUpdateService
|
||||
// }
|
||||
// }
|
||||
|
||||
if (!ObjectUtil.equals(user.getMember(), source.getMember())){
|
||||
if (!ObjectUtil.equals(user.getMember(), source.getMember())) {
|
||||
if (source.getMember()) {
|
||||
changeTypes.add(MemberChangeType.RESTORE.name());
|
||||
} else {
|
||||
@@ -290,10 +294,11 @@ public class SysDataUserAllUpdateServiceImpl implements SysDataUserUpdateService
|
||||
|
||||
/**
|
||||
* 判断是否是会员
|
||||
*
|
||||
* @param source
|
||||
* @param user
|
||||
*/
|
||||
private void judgeMember(Sys_user_source source, Sys_user user, List<String> addMemberUserIds, List<String> removeMemberUserIds, boolean isEligibleForMember){
|
||||
private void judgeMember(Sys_user_source source, Sys_user user, List<String> addMemberUserIds, List<String> removeMemberUserIds, boolean isEligibleForMember) {
|
||||
// 根据上面定义final常量 在职状态、编制类型去判断是不是会员
|
||||
if (user == null && isEligibleForMember) {
|
||||
addMemberUserIds.add(source.getId());
|
||||
@@ -339,6 +344,7 @@ public class SysDataUserAllUpdateServiceImpl implements SysDataUserUpdateService
|
||||
|
||||
/**
|
||||
* 数据大批量更新
|
||||
*
|
||||
* @param needDoUpdateList 需要更新的数据
|
||||
*/
|
||||
private void massUpdatesAsync(List<Sys_user> needDoUpdateList) {
|
||||
|
||||
@@ -54,11 +54,11 @@ public class SysDataUserIncrUpdateServiceImpl implements SysDataUserUpdateServic
|
||||
for (Sys_user sysUser : sysUsers) {
|
||||
//重新设置
|
||||
sysUser.setId(R.UU32());
|
||||
//密码设置 都走单点登录
|
||||
sysUser.setPassword(R.UU32());
|
||||
String salt = R.UU32();
|
||||
sysUser.setSalt(salt);
|
||||
sysUser.setPassword(PwdUtil.getPassword(sysUser.getPassword(), salt));
|
||||
// 随机密码
|
||||
String pwd = R.captchaNumber(6);
|
||||
sysUser.setPassword(PwdUtil.getPassword(pwd, salt));
|
||||
sysUser.setLoginCount(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.budwk.app.sys.services.impl;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.codec.Base64Decoder;
|
||||
import cn.hutool.core.codec.Base64Encoder;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.digest.DigestUtil;
|
||||
import com.budwk.app.base.constant.RedisConstant;
|
||||
import com.budwk.app.base.enums.LoginType;
|
||||
import com.budwk.app.base.exception.BaseException;
|
||||
@@ -297,9 +300,11 @@ public class SysUserServiceImpl extends BaseServiceImpl<Sys_user> implements Sys
|
||||
if (user == null) {
|
||||
throw new BaseException("用户不存在");
|
||||
}
|
||||
String hashedPassword = PwdUtil.doHashValue(PwdUtil.doSm2Decrypt(passowrd));
|
||||
// base64解码密码
|
||||
String decodePwd = Base64Decoder.decodeStr(passowrd);
|
||||
String hashedPassword = PwdUtil.getPassword(decodePwd, user.getSalt());
|
||||
if (!Strings.sNull(hashedPassword).equalsIgnoreCase(user.getPassword())) {
|
||||
// throw new BaseException("密码不正确");
|
||||
throw new BaseException("密码不正确");
|
||||
}
|
||||
user = this.fetchLinks(user, "unit");
|
||||
if (Lang.isNotEmpty(user.getUnit()) && StrUtil.isNotBlank(user.getUnit().getUnionId())) {
|
||||
@@ -368,36 +373,6 @@ public class SysUserServiceImpl extends BaseServiceImpl<Sys_user> implements Sys
|
||||
return user;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPwdByLoginname(String loginname, String password) throws BaseException {
|
||||
Sys_user user = this.fetch(Cnd.where("loginname", "=", loginname));
|
||||
if (user == null) {
|
||||
throw new BaseException("用户不存在");
|
||||
}
|
||||
String salt = R.UU32();
|
||||
this.update(Chain.make("salt", salt).add("password", PwdUtil.getPassword(password, salt)),
|
||||
Cnd.where("loginname", "=", loginname));
|
||||
this.deleteCache(user.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPwdById(String id, String password) throws BaseException {
|
||||
Sys_user user = this.fetch(id);
|
||||
if (user == null) {
|
||||
throw new BaseException("用户不存在");
|
||||
}
|
||||
String salt = R.UU32();
|
||||
this.update(Chain.make("salt", salt).add("password", PwdUtil.getPassword(password, salt)),
|
||||
Cnd.where("id", "=", id));
|
||||
this.deleteCache(user.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setThemeConfig(String id, String themeConfig) {
|
||||
this.update(Chain.make("themeConfig", themeConfig), Cnd.where("id", "=", id));
|
||||
this.deleteCache(id);// 清一下缓存
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLoginInfo(String userId, String ip) {
|
||||
this.update(Chain.make("loginIp", ip).add("loginAt", System.currentTimeMillis()).addSpecial("loginCount", "+1"), Cnd.where("id", "=", userId));
|
||||
@@ -415,7 +390,6 @@ public class SysUserServiceImpl extends BaseServiceImpl<Sys_user> implements Sys
|
||||
.set("unitId", Strings.sNull(user.getUnitId()))
|
||||
.set("unitPath", Strings.sNull(user.getUnitPath()))
|
||||
.set("unionId", ObjectUtil.isEmpty(user.getUnion()) ? "" : user.getUnion().getId());
|
||||
// setLoginInfo(user.getId(), Lang.getIP(request));
|
||||
Sys_log sysLog = new Sys_log();
|
||||
sysLog.setType("info");
|
||||
sysLog.setTag("用户登陆");
|
||||
@@ -435,7 +409,6 @@ public class SysUserServiceImpl extends BaseServiceImpl<Sys_user> implements Sys
|
||||
dao().update(Sys_user.class, Chain.make("wxOpenId", wxOpenId), Cnd.where("id", "=", user.getId()));
|
||||
}
|
||||
|
||||
|
||||
String redirect = request.getParameter("redirect");
|
||||
if (StrUtil.isNotBlank(redirect)) {
|
||||
return Globals.AppDomain + redirect;
|
||||
|
||||
+3
-3
@@ -329,8 +329,8 @@ public class MemberInfoServiceImpl extends BaseServiceImpl<Sys_user> implements
|
||||
user = new Sys_user();
|
||||
//重新设置
|
||||
user.setId(R.UU32());
|
||||
//密码设置 都走单点登录
|
||||
user.setPassword(PwdUtil.doHashValue(R.UU16()));
|
||||
user.setSalt(R.UU32());
|
||||
user.setPassword(PwdUtil.getPassword(R.captchaNumber(6),user.getSalt()));
|
||||
user.setLoginCount(0);
|
||||
needInsertUser.add(user.getLoginname());
|
||||
}
|
||||
@@ -349,7 +349,7 @@ public class MemberInfoServiceImpl extends BaseServiceImpl<Sys_user> implements
|
||||
user.setUserState(v.getUserState());
|
||||
}
|
||||
if (StrUtil.isNotBlank(v.getPersonType())) {
|
||||
// user.setPersonType(v.getPersonType());
|
||||
user.setPersonType(v.getPersonType());
|
||||
}
|
||||
user.setUnitId(unitId);
|
||||
// user.setThreeUnitId(threeUnitId);
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
@@ -420,26 +421,31 @@ public class WelfareListServiceImpl extends BaseServiceImpl<WelfareList> impleme
|
||||
public Pagination notWelfareUserPageData(WelfareFilterUserPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
id,
|
||||
loginname,
|
||||
username,
|
||||
sex,
|
||||
birthday,
|
||||
personType,
|
||||
preparedBy,
|
||||
userState,
|
||||
unitId,
|
||||
unitName,
|
||||
unionId,
|
||||
unionName,
|
||||
member
|
||||
u.id,
|
||||
u.loginname,
|
||||
u.username,
|
||||
u.sex,
|
||||
u.birthday,
|
||||
u.personType,
|
||||
u.preparedBy,
|
||||
u.userState,
|
||||
u.unitId,
|
||||
u.unitName,
|
||||
u.unionId,
|
||||
u.unionName,
|
||||
u.member
|
||||
FROM
|
||||
vw_user
|
||||
vw_user u
|
||||
LEFT JOIN welfare_list w ON u.id = w.userId AND w.projectId = @projectId
|
||||
$condition
|
||||
""");
|
||||
sql.setParam("projectId", pageForm.getProjectId());
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("w.userId", "is", null);
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getUserName())) {
|
||||
cnd.where().andLike("username", pageForm.getUserName());
|
||||
cnd.where().andLike("u.username", pageForm.getUserName());
|
||||
}
|
||||
if (StrUtil.isNotBlank(pageForm.getLoginName())) {
|
||||
cnd.where().andLike("loginname", pageForm.getLoginName());
|
||||
@@ -463,8 +469,6 @@ public class WelfareListServiceImpl extends BaseServiceImpl<WelfareList> impleme
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
|
||||
cnd.and("id", "not in", Sqls.create("select userId from `welfare_list` where projectId = @projectId").setParam("projectId", pageForm.getProjectId()));
|
||||
|
||||
sql.setCondition(cnd);
|
||||
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
}
|
||||
|
||||
@@ -129,12 +129,11 @@
|
||||
handleLogin() {
|
||||
this.$refs.loginForm.validate((valid) => {
|
||||
if (valid) {
|
||||
const password = commonUtil.smCrypto().doSm2Encrypt(this.loginForm.password)
|
||||
axios
|
||||
.post("/platform/login/doLogin", null, {
|
||||
params: {
|
||||
...this.loginForm,
|
||||
password
|
||||
password: window.btoa(this.loginForm.password)
|
||||
}
|
||||
})
|
||||
.then((resp) => {
|
||||
@@ -189,6 +188,7 @@
|
||||
grid-template-columns: 1fr !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.login-container .img {
|
||||
display: none !important;
|
||||
}
|
||||
@@ -274,6 +274,7 @@
|
||||
.login-container > div.img {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.login-container .login-box .login-form {
|
||||
width: 100vw !important;
|
||||
}
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
<div class="el-dialog__header">
|
||||
<button type="button" data-dismiss="modal" aria-hidden="true" aria-label="Close" class="el-dialog__headerbtn"><i
|
||||
class="el-dialog__close el-icon el-icon-close"></i></button>
|
||||
<h4 class="modal-title">${msg['index.custommenu']}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="list-group" style="text-align: center;">
|
||||
<table width="88%" id="menuTable">
|
||||
<!--#
|
||||
var firstMenus=@auth.getPrincipalProperty('firstMenus');
|
||||
var secondMenus=@auth.getPrincipalProperty('secondMenus');
|
||||
var customMenu=@auth.getPrincipalProperty('customMenu');
|
||||
#-->
|
||||
<!--#for(firstMenu in firstMenus){#-->
|
||||
<tr>
|
||||
<td width="20%" align="left"><strong><!--#if(lang=="zh_CN"){#-->${firstMenu.name}<!--#}else{#-->${firstMenu.aliasName}<!--#}#--></strong></td>
|
||||
<td width="80%" align="left">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!--# if(!isEmpty(@secondMenus.get(firstMenu.path))){
|
||||
for(secondMenu in @secondMenus.get(firstMenu.path)){
|
||||
#-->
|
||||
<tr>
|
||||
<td width="20%" align="left" style="padding-left: 20px;"><!--#if(lang=="zh_CN"){#-->${secondMenu.name}<!--#}else{#-->${secondMenu.aliasName}<!--#}#--></td>
|
||||
<td width="80%" align="left">
|
||||
<!--# if(!isEmpty(@secondMenus.get(secondMenu.path))){
|
||||
for(thMenu in @secondMenus.get(secondMenu.path)){ #-->
|
||||
<input type="checkbox" value="${thMenu.id}" onclick="chk()" <!--#if(customMenu!=null&&@customMenu.indexOf(thMenu.id)>-1){#-->checked<!--#}#-->>
|
||||
<!--#if(lang=="zh_CN"){#-->${thMenu.name}<!--#}else{#-->${thMenu.aliasName}<!--#}#-->
|
||||
<!--#}}#-->
|
||||
</td>
|
||||
</tr>
|
||||
<!--#}}#-->
|
||||
<!--#}#-->
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="el-dialog__footer">
|
||||
<span class="dialog-footer">
|
||||
<button type="button" class="el-button el-button--default" data-dismiss="modal">
|
||||
<span>${msg['system.cancel']}</span>
|
||||
</button>
|
||||
<button type="button" class="el-button el-button--primary" id="okCustom">
|
||||
<span>${msg['system.confirm']}</span>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function chk(){
|
||||
var ids=[];
|
||||
$("#menuTable").find("input[type=checkbox]").each(function(){
|
||||
if($(this).prop("checked")){
|
||||
ids.push($(this).val());
|
||||
}
|
||||
});
|
||||
if(ids.length>5){
|
||||
this.$message({
|
||||
message: "最多可选择5个菜单",
|
||||
type: 'error'
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
$(function () {
|
||||
$("#okCustom").on("click",function(){
|
||||
var ids =chk();
|
||||
if (ids.length<6) {
|
||||
$('#homeDetail').modal('hide');
|
||||
$.post("${base}/platform/sys/user/customDo", {ids: ids.toString()}, function (data) {
|
||||
if (data.code == 0) {
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
setTimeout(function () {
|
||||
window.location.reload();
|
||||
},520);
|
||||
} else {
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -1,87 +0,0 @@
|
||||
<div id="infoApp">
|
||||
<div class="el-dialog__header">
|
||||
<button type="button" data-dismiss="modal" aria-hidden="true" aria-label="Close" class="el-dialog__headerbtn">
|
||||
<i class="el-dialog__close el-icon el-icon-close"></i>
|
||||
</button>
|
||||
<h4 class="modal-title">个人资料</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<el-form :model="infoForm" ref="infoForm" :rules="infoRules" label-width="100px">
|
||||
<el-row style="padding-bottom: 2px">
|
||||
<el-alert title="请完善个人资料" type="warning"></el-alert>
|
||||
</el-row>
|
||||
<el-form-item label="姓名" prop="username">
|
||||
<el-input size="small" maxlength="20" placeholder="姓名" v-model="infoForm.username" auto-complete="off" tabindex="1"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码" prop="mobile">
|
||||
<el-input size="small" maxlength="11" placeholder="手机号码" v-model="infoForm.mobile" auto-complete="off" tabindex="2"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="电子邮箱" prop="email">
|
||||
<el-input size="small" maxlength="50" placeholder="Email" v-model="infoForm.email" auto-complete="off" tabindex="3"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="el-dialog__footer">
|
||||
<span class="dialog-footer">
|
||||
<button type="button" class="el-button el-button--default" data-dismiss="modal">
|
||||
<span>${msg['system.cancel']}</span>
|
||||
</button>
|
||||
<button type="button" class="el-button el-button--primary" @click="doInfo">
|
||||
<span>${msg['system.confirm']}</span>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
new Vue({
|
||||
el: "#infoApp",
|
||||
data: function () {
|
||||
return {
|
||||
infoForm: {
|
||||
username: "<!--#if(user.username!=user.mobile){#-->${user.username!}<!--#}#-->",
|
||||
mobile: "${user.mobile!}",
|
||||
email: "${user.email!}"
|
||||
},
|
||||
infoRules: {
|
||||
username: [{ required: true, message: "请输入姓名", trigger: ["blur", "change"] }],
|
||||
mobile: [
|
||||
{ required: true, message: "请输入手机号码", trigger: ["blur", "change"] },
|
||||
{ pattern: /^1[3456789]\d{9}$/, message: "请输入正确的手机号码" }
|
||||
],
|
||||
email: [
|
||||
{ required: true, message: "请输入Email", trigger: ["blur", "change"] },
|
||||
{ type: "email", message: "请输入正确的Email" }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doInfo: function () {
|
||||
var self = this
|
||||
self.$refs["infoForm"].validate(function (valid) {
|
||||
if (valid) {
|
||||
$.post(
|
||||
base + "/platform/sys/user/doChangeInfo",
|
||||
self.infoForm,
|
||||
function (data) {
|
||||
if (data.code == 0) {
|
||||
$("#homeDetail").modal("hide")
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: "success"
|
||||
})
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: "error"
|
||||
})
|
||||
}
|
||||
},
|
||||
"json"
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -1,60 +0,0 @@
|
||||
<div class="el-dialog__header">
|
||||
<button type="button" data-dismiss="modal" aria-hidden="true" aria-label="Close" class="el-dialog__headerbtn"><i
|
||||
class="el-dialog__close el-icon el-icon-close"></i></button>
|
||||
<h4 class="modal-title">${msg['index.user.mode']}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="modeForm" role="form" class="form-horizontal parsley-form" method="post">
|
||||
<div class="row" style="padding-top: 10px;">
|
||||
<div class="col-lg-12">
|
||||
<div class="form">
|
||||
<div class="col-sm-8">
|
||||
<input name="mode" value="true" type="radio"
|
||||
<!--#if(@auth.getPrincipalProperty('loginPjax')){#-->checked<!--#}#--> > PJAX加载方式<br>优点:占用带宽少,加载速度快;<br>缺点:不能使用前进、后退功能。
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="padding-top: 10px;">
|
||||
<div class="col-lg-12">
|
||||
<div class="form">
|
||||
<div class="col-sm-8">
|
||||
<input name="mode" value="false" type="radio"
|
||||
<!--#if(!@auth.getPrincipalProperty('loginPjax')){#-->checked<!--#}#--> > 传统加载方式<br>优点:可以使用前进、后退功能;<br>缺点:页面会重载、刷新,占用带宽大。
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="el-dialog__footer">
|
||||
<span class="dialog-footer">
|
||||
<button type="button" class="el-button el-button--default" data-dismiss="modal">
|
||||
<span>${msg['system.cancel']}</span>
|
||||
</button>
|
||||
<button type="button" class="el-button el-button--primary" id="okMode">
|
||||
<span>${msg['system.confirm']}</span>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$("#okMode").on("click", function () {
|
||||
$.post("${base}/platform/sys/user/modeDo", {mode: $("input[type='radio'][name='mode']:checked").val()}, function (data) {
|
||||
if (data.code == 0) {
|
||||
$('#homeDetail').modal('hide');
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -115,6 +115,7 @@ const filterUser = {
|
||||
@sort-change="pageOrder"
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
v-loading="tableLoading"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
:index="indexMethod"
|
||||
@@ -185,20 +186,21 @@ const filterUser = {
|
||||
},
|
||||
|
||||
resetPageForm() {
|
||||
this.pageForm.userName = null
|
||||
this.pageForm.loginName = null
|
||||
this.pageForm.sex = null
|
||||
this.pageForm.birthday = null
|
||||
this.pageForm.birthMonths = []
|
||||
this.pageForm.unionId = null
|
||||
this.pageForm.unitId = null
|
||||
this.pageForm.personTypes = []
|
||||
this.pageForm.preparedBys = []
|
||||
this.pageForm.userStates = []
|
||||
this.pageForm.isMember = null
|
||||
this.$set(this.pageForm, "userName", null)
|
||||
this.$set(this.pageForm, "loginName", null)
|
||||
this.$set(this.pageForm, "sex", null)
|
||||
this.$set(this.pageForm, "birthday", null)
|
||||
this.$set(this.pageForm, "birthMonths", [])
|
||||
this.$set(this.pageForm, "unionId", null)
|
||||
this.$set(this.pageForm, "unitId", null)
|
||||
this.$set(this.pageForm, "personTypes", [])
|
||||
this.$set(this.pageForm, "preparedBys", [])
|
||||
this.$set(this.pageForm, "userStates", [])
|
||||
this.$set(this.pageForm, "isMember", null)
|
||||
},
|
||||
|
||||
pageData() {
|
||||
this.tableLoading = true
|
||||
this.$axios
|
||||
.post("/platform/welfare/project/mange/filterUserPageData", {
|
||||
pageForm: JSON.stringify(this.pageForm)
|
||||
@@ -211,6 +213,9 @@ const filterUser = {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
onSubmit() {
|
||||
this.$confirm("当前筛选出" + this.pageForm.totalCount + "条数据,您确认添加到福利名单吗?", "提示", {
|
||||
|
||||
@@ -118,6 +118,7 @@ const addUser = {
|
||||
@sort-change="pageOrder"
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
v-loading="tableLoading"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
:index="indexMethod"
|
||||
@@ -192,17 +193,17 @@ const addUser = {
|
||||
},
|
||||
|
||||
resetPageForm() {
|
||||
this.pageForm.userName = null
|
||||
this.pageForm.loginName = null
|
||||
this.pageForm.sex = null
|
||||
this.pageForm.birthday = null
|
||||
this.pageForm.birthMonths = []
|
||||
this.pageForm.unionId = null
|
||||
this.pageForm.unitIds = []
|
||||
this.pageForm.personTypes = []
|
||||
this.pageForm.preparedBys = []
|
||||
this.pageForm.userStates = []
|
||||
this.pageForm.isMember = null
|
||||
this.$set(this.pageForm, "userName", null)
|
||||
this.$set(this.pageForm, "loginName", null)
|
||||
this.$set(this.pageForm, "sex", null)
|
||||
this.$set(this.pageForm, "birthday", null)
|
||||
this.$set(this.pageForm, "birthMonths", [])
|
||||
this.$set(this.pageForm, "unionId", null)
|
||||
this.$set(this.pageForm, "unitId", null)
|
||||
this.$set(this.pageForm, "personTypes", [])
|
||||
this.$set(this.pageForm, "preparedBys", [])
|
||||
this.$set(this.pageForm, "userStates", [])
|
||||
this.$set(this.pageForm, "isMember", null)
|
||||
},
|
||||
|
||||
async unionIdChange(val) {
|
||||
@@ -214,6 +215,7 @@ const addUser = {
|
||||
},
|
||||
|
||||
pageData() {
|
||||
this.tableLoading = true
|
||||
this.$axios
|
||||
.post("/platform/welfare/list/mange/notWelfareUserPageData", {
|
||||
pageForm: JSON.stringify(this.pageForm)
|
||||
@@ -226,6 +228,9 @@ const addUser = {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
onSubmit() {
|
||||
this.$confirm("当前筛选出" + this.pageForm.totalCount + "条数据,您确认添加到福利名单吗?", "提示", {
|
||||
|
||||
Reference in New Issue
Block a user