该系统完全免费、开源。
系统完美运行,无任何的bug,技术较多,可以当做面试的项目或者作为毕设的项目。
系统获取源码的方式见文章底部。
为防止刷着刷着找不到,大家点赞、收藏文章。
系统完美运行。具体的介绍如下所示。
1. 技术介绍
核心技术:SpringBoot+MyBatis-Plus;
前端:vue+layui+elementui;
开发工具:idea;
数据库:mysql5.7;
安全框架:Shiro;
日志框架:logback;
数据库连接池:druid;
富文本编辑器:Tinymce;
2.功能介绍
本项目分前台用户界面功能和后台管理功能;
前台用户界面功能:
展示评审条件,根据实际业务需求,展示评审条件推荐;
评审条件搜索,用户输入指定职称级别关键字,可以搜索查询,也可以根据评审专业,和省份进行搜索;
评审条件展示
用户登陆
职称申请,填写省份、评审专业、评审时间、注意事项、发布日期、资料清单等信息进行申请
系统公告
论坛信息
个人中心
后台管理功能:
管理员登录
用户管理
评审员管理
省份管理
评审条件管理
职称申请管理
结果公布管理
论坛管理
轮播图管理
系统公告
3. 前端
3.1 首页

3.2 评审条件
提供按照职称的级别,评审专业以及省份搜索框进行快速查询相关评审条件

点击任何一个评审条件,在评审条件页面可以填写省份、评审专业、评审时间、注意事项、发布日期、资料清单等信息进行申请

3.3 登入
申请职称的时候需要登录才能申请

登录、用户注册,通过用户注册填写用户名、密码、用户姓名、联系电话等信息进行登录、用户注册

登入后可以查看个人中心的相关功能

4. 后端
4.1 登录

4.2 个人中心
个人中心页面中可以通过填写原密码、新密码、确认密码等信息进行添加、修改。还可以根据需要对个人信息进行添加,修改或删除等详细操作。


4.3 用户管理
用户管理页面中可以查看用户名、密码、用户姓名、头像、性别、联系电话等信息,并可根据需要对用户管理进行详情、修改或删除等操作。

4.4 评审员管理
评审员管理页面中可以查看工号、密码、评审员姓名、性别、照片、手机、身份证等信息,并可根据需要对评审员管理进行详情、修改或删除等详细操作。

4.5 省份管理

4.6 评审条件管理

4.7 职称申请管理

4.8 结果公布管理

5. 系统的核心代码
/**
* 权限(Token)验证
*/
@Component
public class AuthorizationInterceptor implements HandlerInterceptor {
public static final String LOGIN_TOKEN_KEY = "Token";
@Autowired
private TokenService tokenService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//支持跨域请求
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Headers", "x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization");
response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));
// 跨域时会首先发送一个OPTIONS请求,这里我们给OPTIONS请求直接返回正常状态
if (request.getMethod().equals(RequestMethod.OPTIONS.name())) {
response.setStatus(HttpStatus.OK.value());
return false;
}
IgnoreAuth annotation;
if (handler instanceof HandlerMethod) {
annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class);
} else {
return true;
}
//从header中获取token
String token = request.getHeader(LOGIN_TOKEN_KEY);
/**
* 不需要验证权限的方法直接放过
*/
if(annotation!=null) {
return true;
}
TokenEntity tokenEntity = null;
if(StringUtils.isNotBlank(token)) {
tokenEntity = tokenService.getTokenEntity(token);
}
if(tokenEntity != null) {
request.getSession().setAttribute("userId", tokenEntity.getUserid());
request.getSession().setAttribute("role", tokenEntity.getRole());
request.getSession().setAttribute("tableName", tokenEntity.getTablename());
request.getSession().setAttribute("username", tokenEntity.getUsername());
return true;
}
PrintWriter writer = null;
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json; charset=utf-8");
try {
writer = response.getWriter();
writer.print(JSONObject.toJSONString(R.error(401, "请先登录")));
} finally {
if(writer != null){
writer.close();
}
}
return false;
}
}
/**
* 评审条件
* 后端接口
* @author
* @email
* @date 2021-01-11 11:06:06
*/
@RestController
@RequestMapping("/pingshentiaojian")
public class PingshentiaojianController {
@Autowired
private PingshentiaojianService pingshentiaojianService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,PingshentiaojianEntity pingshentiaojian, HttpServletRequest request){
EntityWrapper<PingshentiaojianEntity> ew = new EntityWrapper<PingshentiaojianEntity>();
PageUtils page = pingshentiaojianService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, pingshentiaojian), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,PingshentiaojianEntity pingshentiaojian, HttpServletRequest request){
EntityWrapper<PingshentiaojianEntity> ew = new EntityWrapper<PingshentiaojianEntity>();
PageUtils page = pingshentiaojianService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, pingshentiaojian), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( PingshentiaojianEntity pingshentiaojian){
EntityWrapper<PingshentiaojianEntity> ew = new EntityWrapper<PingshentiaojianEntity>();
ew.allEq(MPUtil.allEQMapPre( pingshentiaojian, "pingshentiaojian"));
return R.ok().put("data", pingshentiaojianService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(PingshentiaojianEntity pingshentiaojian){
EntityWrapper< PingshentiaojianEntity> ew = new EntityWrapper< PingshentiaojianEntity>();
ew.allEq(MPUtil.allEQMapPre( pingshentiaojian, "pingshentiaojian"));
PingshentiaojianView pingshentiaojianView = pingshentiaojianService.selectView(ew);
return R.ok("查询评审条件成功").put("data", pingshentiaojianView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
PingshentiaojianEntity pingshentiaojian = pingshentiaojianService.selectById(id);
pingshentiaojian.setClicknum(pingshentiaojian.getClicknum()+1);
pingshentiaojian.setClicktime(new Date());
pingshentiaojianService.updateById(pingshentiaojian);
return R.ok().put("data", pingshentiaojian);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") String id){
PingshentiaojianEntity pingshentiaojian = pingshentiaojianService.selectById(id);
pingshentiaojian.setClicknum(pingshentiaojian.getClicknum()+1);
pingshentiaojian.setClicktime(new Date());
pingshentiaojianService.updateById(pingshentiaojian);
return R.ok().put("data", pingshentiaojian);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody PingshentiaojianEntity pingshentiaojian, HttpServletRequest request){
pingshentiaojian.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(pingshentiaojian);
pingshentiaojianService.insert(pingshentiaojian);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody PingshentiaojianEntity pingshentiaojian, HttpServletRequest request){
pingshentiaojian.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(pingshentiaojian);
pingshentiaojianService.insert(pingshentiaojian);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody PingshentiaojianEntity pingshentiaojian, HttpServletRequest request){
//ValidatorUtils.validateEntity(pingshentiaojian);
pingshentiaojianService.updateById(pingshentiaojian);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
pingshentiaojianService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
**
* 登录相关
*/
@RequestMapping("users")
@RestController
public class UserController{
@Autowired
private UserService userService;
@Autowired
private TokenService tokenService;
/**
* 登录
*/
@IgnoreAuth
@PostMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
if(user==null || !user.getPassword().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
return R.ok().put("token", token);
}
/**
* 注册
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
userService.insert(user);
return R.ok();
}
/**
* 退出
*/
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
if(user==null) {
return R.error("账号不存在");
}
user.setPassword("");
userService.update(user,null);
return R.ok("密码已重置为:");
}
}
6. 源码获取
后端:https://gitee.com/morningstone/titlesystem-backend
前端:https://gitee.com/morningstone/titlesystem-frontend-admin