Commit b3f894c7 authored by “yiyousong”'s avatar “yiyousong”
parents dc485f79 0945abb5
<template>
<div class="view">
<a-result
status="404"
title="404"
sub-title="Sorry, the page you visited does not exist."
>
<a-result status="404" title="404" sub-title="暂无内容">
<template #extra>
<a-button type="primary" class="addclass" @click="$router.push('/home')">
<a-button type="primary" class="addclass" @click="$router.push(url)">
返回首页
</a-button>
</template>
......@@ -19,12 +15,18 @@ export default {
name: "PortalAdminVueNotFoundView",
data() {
return {};
return {
url: "/home",
};
},
created() {
this.$route.path.indexOf("/home/thePlatformIsSet") == 0
? (this.url = "/home/thePlatformIsSet")
: "";
},
mounted() {},
methods: {},
watch: {},
};
</script>
......
......@@ -90,11 +90,19 @@ export default {
title: "整体同比",
align: "center",
dataIndex: "整体同比",
customRender: (text, record, index) => {
console.log(text);
return text + "%";
},
},
{
title: "整体环比",
align: "center",
dataIndex: "整体环比",
customRender: (text, record, index) => {
console.log(text);
return text + "%";
},
},
],
};
......
......@@ -3,7 +3,13 @@
<div class="content">
<div class="top">
<h1 class="title_text">{{ detailsForm.interfaceName }}</h1>
<a-button type="primary" class="addclass" @click="$router.go(-1)" style="margin-bottom: 1rem">返回上一级</a-button>
<a-button
type="primary"
class="addclass"
@click="$router.go(-1)"
style="margin-bottom: 1rem"
>返回上一级</a-button
>
</div>
<a-card title="接口信息" :bordered="false" class="card_box">
<a-descriptions>
......@@ -22,12 +28,21 @@
<a-descriptions-item label="content-type">{{
detailsForm.contentType
}}</a-descriptions-item>
<a-descriptions-item label="超时时长">{{ detailsForm.timeoutValue }}</a-descriptions-item>
<a-descriptions-item label="超时时长"
>{{ detailsForm.timeoutValue }}</a-descriptions-item
>
<a-descriptions-item label="限流策略">{{
detailsForm.limitStrategy == 1 ? "分钟" : "小时"
}}</a-descriptions-item>
<a-descriptions-item label="访问网络" v-if="detailsForm && detailsForm.network">
<span v-for="(item, idx) of dict.network" v-show="detailsForm.network.indexOf(idx) != -1" :key="idx">
<a-descriptions-item
label="访问网络"
v-if="detailsForm && detailsForm.network"
>
<span
v-for="(item, idx) of dict.network"
v-show="detailsForm.network.indexOf(idx) != -1"
:key="idx"
>
{{ item }}
</span>
</a-descriptions-item>
......@@ -49,7 +64,7 @@
</a-card>
<a-card title="请求参数" :bordered="false" class="card_box">
<div class="flex aic jcb mb10">
<a-radio-group v-model="requestPam.type" button-style="solid" disabled>
<a-radio-group v-model="requestPam.type" button-style="solid">
<a-radio-button value="path"> 路径参数 </a-radio-button>
<a-radio-button value="headers"> headers </a-radio-button>
<a-radio-button value="query"> query </a-radio-button>
......@@ -60,8 +75,15 @@
<div>{{ detailsForm.inEncrypt == 1 ? "加密" : "不加密" }}</div>
</div>
</div>
<a-table size="middle" bordered :row-key="(record) => record.id" :locale="{ emptyText: '无' }" :pagination="false"
:columns="table_columns" :dataSource="requestPam.table">
<a-table
size="middle"
bordered
:row-key="(record) => record.id"
:locale="{ emptyText: '无' }"
:pagination="false"
:columns="table_columns"
:dataSource="requestPam.table"
>
</a-table>
</a-card>
......@@ -72,8 +94,15 @@
<div>{{ detailsForm.outEncrypt == 1 ? "加密" : "不加密" }}</div>
</div>
</div>
<a-table size="middle" bordered :row-key="(record) => record.id" :locale="{ emptyText: '无' }" :pagination="false"
:columns="table_columns" :dataSource="responsePam.table">
<a-table
size="middle"
bordered
:row-key="(record) => record.id"
:locale="{ emptyText: '无' }"
:pagination="false"
:columns="table_columns"
:dataSource="responsePam.table"
>
</a-table>
</a-card>
......@@ -92,8 +121,15 @@
</div>
</a-card>
<a-card title="变更记录" :bordered="false" class="card_box">
<a-table size="middle" bordered :row-key="(record) => record.id" :locale="{ emptyText: '无' }" :pagination="false"
:columns="table_columns_gb" :dataSource="[]">
<a-table
size="middle"
bordered
:row-key="(record) => record.id"
:locale="{ emptyText: '无' }"
:pagination="false"
:columns="table_columns_gb"
:dataSource="[]"
>
</a-table>
</a-card>
</div>
......@@ -276,7 +312,7 @@ export default {
margin-bottom: 1rem;
}
&+.card_box {
& + .card_box {
margin-top: 1rem;
}
}
......@@ -288,15 +324,21 @@ export default {
width: 100%;
height: @headerH;
background: rgb(59, 135, 255);
background: -moz-linear-gradient(174deg,
background: -moz-linear-gradient(
174deg,
rgba(59, 135, 255, 1) 24%,
rgba(108, 53, 247, 1) 85%);
background: -webkit-linear-gradient(174deg,
rgba(108, 53, 247, 1) 85%
);
background: -webkit-linear-gradient(
174deg,
rgba(59, 135, 255, 1) 24%,
rgba(108, 53, 247, 1) 85%);
background: linear-gradient(174deg,
rgba(108, 53, 247, 1) 85%
);
background: linear-gradient(
174deg,
rgba(59, 135, 255, 1) 24%,
rgba(108, 53, 247, 1) 85%);
rgba(108, 53, 247, 1) 85%
);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#3b87ff", endColorstr="#6c35f7", GradientType=1);
}
}
......
<template>
<div class="Container">
<div class="main">
<a-tabs v-model="tabsActive" @change="tabsChange" :forceRender="false">
<a-button
style="margin-right: 16px"
slot="tabBarExtraContent"
@click="$router.back()"
>返回上一级</a-button
>
<a-tab-pane :tab="tabsList['meta']['title']" :key="0"> </a-tab-pane>
</a-tabs>
<div class="my-card">
<div class="head-menu">
<div>属性字典</div>
</div>
<div class="pd20">
<div class="from-item">
<div class="name">排队机分辨率:</div>
<div>
<a-tag color="blue" closable v-for="item, index in fblList" :key="index">
<a-tag
color="blue"
closable
v-for="(item, index) in fblList"
:key="index"
>
{{ item.name }}
</a-tag>
</div>
<a-button icon="plus" size="small" @click="addZdShow('fblList', '排队机分辨率')">添加字典值</a-button>
<a-button
icon="plus"
size="small"
@click="addZdShow('fblList', '排队机分辨率')"
>添加字典值</a-button
>
</div>
<div class="from-item">
<div class="name">接口标签:</div>
<div>
<a-tag color="blue" closable v-for="item, index in bqList" :key="index">
<a-tag
color="blue"
closable
v-for="(item, index) in bqList"
:key="index"
>
{{ item.name }}
</a-tag>
</div>
<a-button icon="plus" size="small" @click="addZdShow('bqList', '接口标签')">添加字典值</a-button>
<a-button
icon="plus"
size="small"
@click="addZdShow('bqList', '接口标签')"
>添加字典值</a-button
>
</div>
</div>
</div>
</div>
<a-modal :title="VisibleTitle" :centered="true" :destroyOnClose="true" :visible="Visible" @cancel="Visible = false"
width="30%">
<a-form-model :label-col="{ span: 5 }" :wrapper-col="{ span: 19 }" layout="horizontal" ref="appInfoFome"
:model="appInfoFome" :rules="appInfoRules">
<a-modal
:title="VisibleTitle"
:centered="true"
:destroyOnClose="true"
:visible="Visible"
@cancel="Visible = false"
width="30%"
>
<a-form-model
:label-col="{ span: 5 }"
:wrapper-col="{ span: 19 }"
layout="horizontal"
ref="appInfoFome"
:model="appInfoFome"
:rules="appInfoRules"
>
<a-form-model-item label="字典值" prop="productName">
<a-input placeholder="请输入字典值" allowClear v-model="appInfoFome.productName" />
<a-input
placeholder="请输入字典值"
allowClear
v-model="appInfoFome.productName"
/>
</a-form-model-item>
</a-form-model>
<template slot="footer">
<a-button type="primary" class="addclass" @click="Modal_Ok">确定</a-button>
<a-button type="primary" class="addclass" @click="Modal_Ok"
>确定</a-button
>
<a-button @click="resetForm">重置</a-button>
</template>
</a-modal>
......@@ -43,19 +89,24 @@
</template>
<script>
import { getItemData } from "@/utils/js/common.js";
import common from "@/mixins/common";
export default {
name: "dictionary",
mixins: [common],
data() {
return {
fblList: [{
name: "1920*1080"
}, {
name: "1080*1920"
}, {
name: "1280*1280"
}],
fblList: [
{
name: "1920*1080",
},
{
name: "1080*1920",
},
{
name: "1280*1280",
},
],
bqList: [
{ name: "政务外网" },
{ name: "便民服务" },
......@@ -65,7 +116,7 @@ export default {
Visible: false,
appInfoFome: {
productName: undefined,
siteId: JSON.parse(localStorage.getItem("siteId"))
siteId: JSON.parse(localStorage.getItem("siteId")),
}, //页面表单信息
appInfoRules: {
productName: [
......@@ -74,31 +125,34 @@ export default {
whitespace: true, //必选时,空格是否会被视为错误
message: "请输入字典值",
trigger: "blur",
}
},
],
},
keyName: ""
keyName: "",
tabsActive: 0,
};
},
created() {
mounted() {},
computed: {
tabsList() {
return getItemData(this.$router.options.routes, "name", "dictionary");
},
mounted() {
},
methods: {
addZdShow(key, title) {
this.Visible = true
this.resetForm()
this.keyName = key
this.VisibleTitle = title
this.Visible = true;
this.resetForm();
this.keyName = key;
this.VisibleTitle = title;
},
Modal_Ok() {
this.$refs.appInfoFome.validate((valid) => {
if (valid) {
this[this.keyName].push({
name: this.appInfoFome.productName
})
this.Visible = false
this.resetForm()
name: this.appInfoFome.productName,
});
this.Visible = false;
this.resetForm();
} else {
this.$message.error(`请完善表单信息!`);
return false;
......@@ -107,7 +161,13 @@ export default {
},
resetForm() {
this.$nextTick(() => {
this.appInfoFome.productName = ''
this.appInfoFome.productName = "";
});
},
tabsChange(val) {
this.$router.push({
path: `/home/thePlatformIsSet/menuManagement/${val}`,
// query: { testoption: "test001" },
});
},
},
......@@ -115,6 +175,7 @@ export default {
</script>
<style lang="less" scoped>
@headerH: 4.5rem;
.from-item {
display: flex;
align-items: center;
......@@ -151,11 +212,40 @@ export default {
line-height: 52px;
font-size: 16px;
font-weight: bold;
color: #0595FD;
border-bottom: 2px solid #0595FD;
color: #0595fd;
border-bottom: 2px solid #0595fd;
padding: 0 30px;
margin-left: 20px;
}
}
}
.Container {
height: 100% !important;
// background: #fac;
background: #f5f5f5;
display: flex;
flex-direction: column;
.main {
// background: #afc;
background: #ffffff;
border-radius: 6px;
flex: 1;
overflow-y: auto;
overflow-x: hidden;
margin: 1.2rem 2rem;
}
.ant-tabs-nav {
.ant-tabs-tab {
margin: 0 !important;
}
}
.ant-tabs-tab {
font-size: 1rem !important;
& + .ant-tabs-tab {
margin: 0 !important;
margin-left: 0.7rem !important;
}
}
}
</style>
......@@ -2,7 +2,7 @@
<div class="logService">
<div class="header_box">
<a-space>
<a-input v-model="searchName" placeholder="请输入内容关键搜索">
<a-input v-model="searchName" placeholder="请输入内容关键搜索">
</a-input>
<a-range-picker
format="YYYY年MM月DD日"
......
......@@ -4,7 +4,10 @@
<!-- <button class="addRoles_btn" @click="showRoleEditModal(false)">
<span>新增角色</span>
</button> -->
<a-button type="primary" class="addclass" @click="showRoleEditModal(false)"
<a-button
type="primary"
class="addclass"
@click="showRoleEditModal(false)"
>新增角色</a-button
>
<span>
......@@ -40,8 +43,13 @@
>编辑</a-button
>
<a-button
style="color: #ff4420"
:style="
userInfo.id == record.id
? { color: '#3333' }
: { color: '#ff4420' }
"
type="link"
:disabled="userInfo.id === record.id"
@click="deleteRole(record, index)"
>删除</a-button
>
......@@ -66,6 +74,7 @@ export default {
name: "PortalAdminVueAuthorityMis",
data() {
return {
userInfo: {},
searchRoleName: undefined,
tableLoading: false,
tablePagination: {
......@@ -130,6 +139,10 @@ export default {
// remark: `该角色定义为省级权限${key + 1}`,
// });
// }
localStorage.getItem("userInfo")
? (this.userInfo = JSON.parse(localStorage.getItem("userInfo")))
: "";
console.log(this.userInfo);
this.getRoleList();
},
methods: {
......@@ -137,7 +150,7 @@ export default {
let res = await roleList({
page: this.tablePagination.current, //当前页
size: this.tablePagination.pageSize, //每页条数
name: this.searchRoleName,
name: this.searchRoleName ? "%" + this.searchRoleName + "%" : "",
});
let { code, data, dict } = res;
if (!data.data && this.tablePagination.current > 1) {
......
......@@ -2,7 +2,9 @@
<div class="user">
<div class="user_btn">
<div class="add_btn">
<a-button type="primary" class="addclass" @click="addUserModal">新增用户</a-button>
<a-button type="primary" class="addclass" @click="addUserModal"
>新增用户</a-button
>
</div>
<div class="search_btn">
<a-space>
......@@ -25,7 +27,9 @@
>{{ v.value }}</a-select-option
>
</a-select>
<a-button type="primary" class="addclass" @click="getUserList">搜索</a-button>
<a-button type="primary" class="addclass" @click="getUserList"
>搜索</a-button
>
<a-button @click="resetList">重置</a-button>
</a-space>
</div>
......@@ -195,11 +199,18 @@ export default {
async getUserList() {
let realName = "";
let mobile = "";
if (/^[\u4e00-\u9fa5]+$/.test(this.userform.searchVal)) {
realName = this.userform.searchVal;
} else if (/^[\d]+$/.test(this.userform.searchVal)) {
mobile = this.userform.searchVal;
if (this.userform.searchVal) {
if (/^[\d]+$/.test(this.userform.searchVal)) {
mobile = "%" + this.userform.searchVal + "%";
} else {
realName = "%" + this.userform.searchVal + "%";
}
}
// if (/^[\u4e00-\u9fa5]+$/.test(this.userform.searchVal)) {
// realName = "%" + this.userform.searchVal + "%";
// } else if (/^[\d]+$/.test(this.userform.searchVal)) {
// mobile = "%" + this.userform.searchVal + "%";
// }
let res = await userList({
page: this.tablePagination.current,
size: this.tablePagination.pageSize,
......
......@@ -628,9 +628,12 @@ export default {
//type
onReqType(type) {
let index = this.requestPam.type;
console.log(index);
if (index == "path") {
this.requestPam.table = [];
} else {
console.log(this.requestPam.table);
let obj = {
name: ``,
type: "String",
......@@ -639,10 +642,12 @@ export default {
describe: ``,
isType: true,
};
if (index == "body") {
obj.isType = false;
}
if (type == "new") {
console.log(333);
this.requestPam.table = [obj];
} else {
this.requestPam.table.push(obj);
......
......@@ -105,7 +105,7 @@ export default {
getProduct({
page: 1,
size: -1,
productName: this.searchVal,
productName: this.searchVal ? "%" + this.searchVal + "%" : "",
}).then((res) => {
this.listData = res.data.data;
});
......@@ -116,7 +116,7 @@ export default {
this.$refs.AddEditAppName.appInfoFome.id = item.id;
this.$refs.AddEditAppName.appInfoFome.productName = item.productName;
} else {
this.$refs.AddEditAppName.appInfoFome.id = '';
this.$refs.AddEditAppName.appInfoFome.id = "";
this.$refs.AddEditAppName.VisibleTitle = "新增产品";
}
this.$refs.AddEditAppName.Visible = true;
......
......@@ -18,3 +18,26 @@ CREATE TABLE mortals_xhx_product_interface_log(
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='产品接口';
ALTER TABLE `mortals_xhx_user`
ADD COLUMN `saltKey` varchar(32) DEFAULT NULL COMMENT '密码盐值',
ADD COLUMN `lastUpdatePwdTime` datetime DEFAULT NULL COMMENT '最后一次修改密码时间',
ADD COLUMN `errorCount` tinyint(2) DEFAULT '0' COMMENT '当日登录失败数',
ADD COLUMN `loginLock` tinyint(2) DEFAULT '0' COMMENT '登录锁定状态0未锁定1已锁定',
ADD COLUMN `lockTime` datetime DEFAULT NULL COMMENT '锁定时间';
-- ----------------------------
-- 用户密码修改记录表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_user_pwd_record`;
CREATE TABLE `mortals_xhx_user_pwd_record` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键,自增长',
`userId` bigint(20) DEFAULT NULL COMMENT '用户ID,主键,自增长',
`loginName` varchar(50) DEFAULT NULL COMMENT '登录名',
`loginPwd` varchar(128) DEFAULT NULL COMMENT '登录密码,使用md5双次加密',
`createTime` datetime DEFAULT NULL COMMENT '创建时间',
`createUserId` bigint(20) DEFAULT NULL COMMENT '创建用户',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户密码修改记录';
UPDATE mortals_xhx_user SET lastUpdatePwdTime=NOW();
\ No newline at end of file
......@@ -6,14 +6,12 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.IAuthTokenService;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.IUser;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.valid.service.ValidCodeService;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.common.pdu.SitePdu;
import com.mortals.xhx.feign.model.IApiModelFeign;
import com.mortals.xhx.feign.rsp.ApiResp;
......@@ -22,8 +20,6 @@ import com.mortals.xhx.module.menu.service.MenuService;
import com.mortals.xhx.module.user.model.UserEntity;
import com.mortals.xhx.module.user.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.ArrayStack;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -44,6 +40,8 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
private IAuthTokenService authTokenService;
@Autowired
private IApiModelFeign apiModelFeign;
@Autowired
private ValidCodeService validCodeService;
@RequestMapping("login")
public String login(@RequestBody LoginForm loginForm) throws Exception {
......@@ -60,7 +58,11 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
UserEntity userEntity = null;
try {
loginForm.validate();
userEntity = userService.doLogin(loginName, password, ip);
boolean validCode = validCodeService.doCheckImageValidCode(request.getSession().getId(),super.getRequestIP(request),loginForm.getCode());
if(!validCode){
throw new AppException("验证码错误");
}
userEntity = userService.userdoLogin(loginName, password, ip);
userEntity.setLastLoginAddress(ip);
userEntity.setLoginTime(System.currentTimeMillis());
String tmpToken = userEntity.getId() + ":" + IdUtil.fastSimpleUUID();
......
package com.mortals.xhx.base.login.web;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseForm;
import lombok.Data;
......@@ -11,6 +10,8 @@ public class LoginForm {
private String password;
private String code;
@Override
public String toString() {
......
package com.mortals.xhx.common.utils;
public class Solution {
//判断输入是否为数字
public static boolean isNumber(char s) {
return s >= '0' && s <= '9';
}
//判断输入是否为大写字母
public static boolean isUpper(char s) {
return s >= 'A' && s <= 'Z';
}
//判断输入是否为小写字母
public static boolean isLower(char s) {
return s >= 'a' && s <= 'z';
}
//判断输入是否为特殊字符
public static boolean isCharacter(char s) {
return (s < 'a' || s > 'z') && (s < 'A' || s > 'Z') && (s < '0' || s > '9');
}
//判断输入长度是否合法
public static boolean lengthOK(String s, int length) {
return s.length() >= length;
}
//判断是否有连续相同输入
public static boolean isSample(char[] arr) {
for (int i = 0; i < arr.length; i++) {
if (i < arr.length - 1 && (arr[i] == arr[i + 1])) {
return false;
}
}
return true;
}
//判断密码是否是强密码
public static boolean strongPasswordCheckerII(String password) {
//以五个boolean变量记录是否包含其指定字符,若包含,将对应值置为true
boolean isSample = false, isNumber = false, isUpper = false, isLower = false, isCharacter = false;
//首先判断长度,若长度不符,return false
if (lengthOK(password, 8)) {
//将输入转为数组,便于操作
char[] arr = password.toCharArray();
//判断是否有连续相同输入,若有则isSample=false
isSample = isSample(arr);
for (char c : arr) {
//判断是否包含数字,若有则isNumber=true
if (!isNumber) {
isNumber = isNumber(c);
}
//判断是否包含大写字母,若有则isUpper=true
if (!isUpper) {
isUpper = isUpper(c);
}
//判断是否包含小写字母,若有则isLower=true
if (!isLower) {
isLower = isLower(c);
}
//判断是否包含特殊字符,若有则isCharacter=true
if (!isCharacter) {
isCharacter = isCharacter(c);
}
}
}
//若满足强密码所有条件,则返回true
return isNumber && isUpper && isLower && isCharacter && isSample;
}
}
......@@ -170,7 +170,7 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
}
float a = (float)clickSum;
float b = (float)trendCensusVos.size();
float p = b/a;
float p = a/b;
DecimalFormat decimalFormat=new DecimalFormat(".00");
String s = decimalFormat.format(p);
dayAccessAvg = Float.valueOf(s);
......
package com.mortals.xhx.module.user.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.user.model.UserPwdRecordEntity;
import java.util.List;
/**
* 用户密码修改记录Dao
* 用户密码修改记录 DAO接口
*
* @author zxfei
* @date 2023-07-26
*/
public interface UserPwdRecordDao extends ICRUDDao<UserPwdRecordEntity,Long>{
}
package com.mortals.xhx.module.user.dao.ibatis;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import com.mortals.xhx.module.user.dao.UserPwdRecordDao;
import com.mortals.xhx.module.user.model.UserPwdRecordEntity;
import org.springframework.stereotype.Repository;
/**
* 用户密码修改记录DaoImpl DAO接口
*
* @author zxfei
* @date 2023-07-26
*/
@Repository("userPwdRecordDao")
public class UserPwdRecordDaoImpl extends BaseCRUDDaoMybatis<UserPwdRecordEntity,Long> implements UserPwdRecordDao {
}
package com.mortals.xhx.module.user.model;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.framework.service.IUser;
import com.mortals.xhx.module.user.model.vo.UserVo;
import java.util.Date;
/**
* 用户信息业务实体对象
*
......@@ -94,7 +90,26 @@ public class UserEntity extends UserVo implements IUser {
* 所属区域code,多个逗号分隔
*/
private String areaNames;
/**
* 密码盐值
*/
private String saltKey;
/**
* 最后一次修改密码时间
*/
private Date lastUpdatePwdTime;
/**
* 当日登录失败数
*/
private Integer errorCount;
/**
* 登录锁定状态0未锁定1已锁定
*/
private Integer loginLock;
/**
* 锁定时间
*/
private Date lockTime;
public UserEntity(){}
......@@ -379,6 +394,45 @@ public class UserEntity extends UserVo implements IUser {
this.areaNames = areaNames;
}
public String getSaltKey() {
return saltKey;
}
public void setSaltKey(String saltKey) {
this.saltKey = saltKey;
}
public Date getLastUpdatePwdTime() {
return lastUpdatePwdTime;
}
public void setLastUpdatePwdTime(Date lastUpdatePwdTime) {
this.lastUpdatePwdTime = lastUpdatePwdTime;
}
public Integer getErrorCount() {
return errorCount;
}
public void setErrorCount(Integer errorCount) {
this.errorCount = errorCount;
}
public Integer getLoginLock() {
return loginLock;
}
public void setLoginLock(Integer loginLock) {
this.loginLock = loginLock;
}
public Date getLockTime() {
return lockTime;
}
public void setLockTime(Date lockTime) {
this.lockTime = lockTime;
}
@Override
public int hashCode() {
......@@ -450,5 +504,15 @@ public class UserEntity extends UserVo implements IUser {
this.lastLoginAddress = "";
this.areaNames = "";
this.saltKey = "";
this.lastUpdatePwdTime = null;
this.errorCount = 0;
this.loginLock = 0;
this.lockTime = null;
}
}
\ No newline at end of file
package com.mortals.xhx.module.user.model;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.user.model.vo.UserPwdRecordVo;
import lombok.Data;
/**
* 用户密码修改记录实体对象
*
* @author zxfei
* @date 2023-07-26
*/
@Data
public class UserPwdRecordEntity extends UserPwdRecordVo {
private static final long serialVersionUID = 1L;
/**
* 用户ID,主键,自增长
*/
private Long userId;
/**
* 登录名
*/
private String loginName;
/**
* 登录密码,使用md5双次加密
*/
private String loginPwd;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof UserPwdRecordEntity) {
UserPwdRecordEntity tmp = (UserPwdRecordEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.userId = -1L;
this.loginName = "";
this.loginPwd = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.user.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.user.model.UserPwdRecordEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 用户密码修改记录视图对象
*
* @author zxfei
* @date 2023-07-26
*/
@Data
public class UserPwdRecordVo extends BaseEntityLong {
}
\ No newline at end of file
package com.mortals.xhx.module.user.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.user.model.UserPwdRecordEntity;
import com.mortals.xhx.module.user.dao.UserPwdRecordDao;
/**
* UserPwdRecordService
*
* 用户密码修改记录 service接口
*
* @author zxfei
* @date 2023-07-26
*/
public interface UserPwdRecordService extends ICRUDService<UserPwdRecordEntity,Long>{
UserPwdRecordDao getDao();
}
\ No newline at end of file
......@@ -5,14 +5,9 @@ import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICRUDService;
import com.mortals.framework.service.IUser;
import com.mortals.xhx.module.menu.model.MenuEntity;
import com.mortals.xhx.module.user.model.UserEntity;
import com.mortals.xhx.module.user.model.UserEntityExt;
import java.util.List;
import java.util.Set;
/**
* UserService
*
......@@ -31,7 +26,7 @@ public interface UserService extends ICRUDService<UserEntity,Long>{
* @return
* @throws AppException
*/
UserEntity doLogin(String loginName, String password, String loginIp) throws AppException;
UserEntity userdoLogin(String loginName, String password, String loginIp) throws AppException;
/**
* 校验用户名与密码是否正确
......
package com.mortals.xhx.module.user.service.impl;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.user.dao.UserPwdRecordDao;
import com.mortals.xhx.module.user.model.UserPwdRecordEntity;
import com.mortals.xhx.module.user.service.UserPwdRecordService;
import lombok.extern.slf4j.Slf4j;
/**
* UserPwdRecordService
* 用户密码修改记录 service实现
*
* @author zxfei
* @date 2023-07-26
*/
@Service("userPwdRecordService")
@Slf4j
public class UserPwdRecordServiceImpl extends AbstractCRUDServiceImpl<UserPwdRecordDao, UserPwdRecordEntity, Long> implements UserPwdRecordService {
}
\ No newline at end of file
package com.mortals.xhx.module.user.web;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.user.model.UserPwdRecordEntity;
import com.mortals.xhx.module.user.service.UserPwdRecordService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
*
* 用户密码修改记录
*
* @author zxfei
* @date 2023-07-26
*/
@RestController
@RequestMapping("user/pwd/record")
public class UserPwdRecordController extends BaseCRUDJsonBodyMappingController<UserPwdRecordService,UserPwdRecordEntity,Long> {
public UserPwdRecordController(){
super.setModuleDesc( "用户密码修改记录");
}
@Override
protected void init(Map<String, Object> model, Context context) {
super.init(model, context);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment