最后如何让自己一步步成为技术专家
说句实话,如果一个打工人不想提升自己,那便没有工作的意义,毕竟大家也没有到养老的年龄。
当你的技术在一步步贴近阿里p7水平的时候,毫无疑问你的薪资肯定会涨,同时你能学到更多更深的技术,交结到更厉害的大牛。
推荐一份Java架构之路必备的学习笔记,内容相当全面!!!
成年人的世界没有容易二字,前段时间刷抖音看到一个程序员连着加班两星期到半夜2点的视频。在这个行业若想要拿高薪除了提高硬实力别无他法。
你知道吗?现在有的应届生实习薪资都已经赶超开发5年的程序员了,实习薪资26K,30K,你没有紧迫感吗?做了这么多年还不如一个应届生,真的非常尴尬!
进了这个行业就不要把没时间学习当借口,这个行业就是要不断学习,不然就只能被裁员。所以,抓紧时间投资自己,多学点技术,眼前困难,往后轻松!
【关注】+【转发】+【点赞】支持我!创作不易!
在线考试模块:
修改密码模块
主要代码实现:
用户登录验证
/**
* 登录相关
*
* @author lyy
*
*/
@RestController
public class SysLoginController extends AbstractController {
@Autowired
private SysUserService sysUserService;
@Autowired
private SysUserTokenService sysUserTokenService;
@Autowired
private SysCaptchaService sysCaptchaService;
/**
* 验证码
*/
@GetMapping("captcha.jpg")
public void captcha(HttpServletResponse response, String uuid)throws IOException {
response.setHeader("Cache-Control", "no-store, no-cache");
response.setContentType("image/jpeg");
//获取图片验证码
BufferedImage image = sysCaptchaService.getCaptcha(uuid);
ServletOutputStream out = response.getOutputStream();
ImageIO.write(image, "jpg", out);
IOUtils.closeQuietly(out);
}
/**
* 登录
*/
@PostMapping("/sys/login")
public Map<String, Object> login(@RequestBody SysLoginForm form)throws IOException {
boolean captcha = sysCaptchaService.validate(form.getUuid(), form.getCaptcha());
// if(!captcha){
// return R.error("验证码不正确");
// }
//用户信息
SysUserEntity user = sysUserService.queryByUserName(form.getUsername());
//账号不存在、密码错误
if(user == null || !user.getPassword().equals(new Sha256Hash(form.getPassword(), user.getSalt()).toHex())) {
return R.error("账号或密码不正确");
}
//账号锁定
if(user.getStatus() == 0){
return R.error("账号已被锁定,请联系管理员");
}
//生成token,并保存到数据库
R r = sysUserTokenService.createToken(user.getUserId());
return r;
}
/**
* 退出
*/
@PostMapping("/sys/logout")
public R logout() {
sysUserTokenService.logout(getUserId());
return R.ok();
}
shiro权限拦截放行:
/**
* Shiro配置
*
* @author lyy
*/
@Configuration
public class ShiroConfig {
@Bean("securityManager")
public SecurityManager securityManager(OAuth2Realm oAuth2Realm) {
DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
securityManager.setRealm(oAuth2Realm);
securityManager.setRememberMeManager(null);
return securityManager;
}
@Bean("shiroFilter")
public ShiroFilterFactoryBean shiroFilter(SecurityManager securityManager) {
ShiroFilterFactoryBean shiroFilter = new ShiroFilterFactoryBean();
shiroFilter.setSecurityManager(securityManager);
//oauth过滤
Map<String, Filter> filters = new HashMap<>();
filters.put("oauth2", new OAuth2Filter());
shiroFilter.setFilters(filters);
Map<String, String> filterMap = new LinkedHashMap<>();
filterMap.put("/webjars/**", "anon");
filterMap.put("/druid/**", "anon");
filterMap.put("/app/**", "anon");
filterMap.put("/sys/login", "anon");
filterMap.put("/swagger/**", "anon");
filterMap.put("/v2/api-docs", "anon");
filterMap.put("/swagger-ui.html", "anon");
filterMap.put("/swagger-resources/**", "anon");
filterMap.put("/captcha.jpg", "anon");
filterMap.put("/aaa.txt", "anon");
filterMap.put("/virtuel/**", "anon");
filterMap.put("/image/**", "anon");
filterMap.put("/**", "oauth2");
shiroFilter.setFilterChainDefinitionMap(filterMap);
return shiroFilter;
}
@Bean("lifecycleBeanPostProcessor")
public LifecycleBeanPostProcessor lifecycleBeanPostProcessor() {
return new LifecycleBeanPostProcessor();
}
@Bean
public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(SecurityManager securityManager) {
AuthorizationAttributeSourceAdvisor advisor = new AuthorizationAttributeSourceAdvisor();
advisor.setSecurityManager(securityManager);
return advisor;
}
前端vue element登录:
<template>
<div class="site-wrapper site-page--login">
<div class="site-content__wrapper">
<div class="site-content">
<div class="brand-info">
<h1 class="brand-info__text">信息管理系统</h1>
</div>
<div class="login-main">
<h3 class="login-title">系统登录</h3>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" status-icon>
<el-form-item prop="userName">
<el-input v-model="dataForm.userName" placeholder="帐号"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input v-model="dataForm.password" type="password" placeholder="密码"></el-input>
</el-form-item>
<el-form-item prop="captcha">
<el-row :gutter="20">
<el-col :span="14">
<el-input v-model="dataForm.captcha" placeholder="验证码">
</el-input>
</el-col>
<el-col :span="10" class="login-captcha">
<img :src="captchaPath" @click="getCaptcha()" alt="">
</el-col>
</el-row>
</el-form-item>
<el-form-item>
<el-button class="login-btn-submit" type="danger" @click="dataFormSubmit()">登录</el-button>
</el-form-item>
</el-form>
</div>
</div>
</div>
</div>
</template>
<script>
import { getUUID } from '@/utils'
export default {
data () {
return {
dataForm: {
userName: '',
password: '',
uuid: '',
captcha: ''
},
dataRule: {
userName: [
{ required: true, message: '帐号不能为空', trigger: 'blur' }
],
password: [
{ required: true, message: '密码不能为空', trigger: 'blur' }
],
captcha: [
{ required: true, message: '验证码不能为空', trigger: 'blur' }
]
},
captchaPath: ''
}
},
created () {
this.getCaptcha()
},
methods: {
// 提交表单
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl('/sys/login'),
method: 'post',
data: this.$http.adornData({
'username': this.dataForm.userName,
'password': this.dataForm.password,
'uuid': this.dataForm.uuid,
'captcha': this.dataForm.captcha
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$cookie.set('token', data.token)
this.$router.replace({ name: 'home' })
} else {
this.getCaptcha()
this.$message.error(data.msg)
}
})
}
})
},
// 获取验证码
getCaptcha () {
this.dataForm.uuid = getUUID()
this.captchaPath = this.$http.adornUrl(`/captcha.jpg?uuid=${this.dataForm.uuid}`)
}
}
}
</script>
<style lang="scss">
.site-wrapper.site-page--login {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
//background-color: rgba(38, 50, 56, .6);
overflow: hidden;
&:before {
position: fixed;
top: 0;
left: 0;
z-index: -1;
width: 100%;
height: 100%;
content: "";
background-image: url(~@/assets/img/login_bg.jpg);
background-size: cover;
}
.site-content__wrapper {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
padding: 0;
margin: 0;
overflow-x: hidden;
overflow-y: auto;
background-color: transparent;
}
.site-content {
min-height: 100%;
padding: 30px 500px 30px 30px;
}
.brand-info {
margin: 220px 100px 0 90px;
color: #fff;
}
.brand-info__text {
margin: 0 100px 220px 200px;
font-size: 100px;
font-weight: 400;
text-transform : uppercase;
}
.brand-info__intro {
margin: 10px 0;
font-size: 16px;
line-height: 1.58;
opacity: .6;
}
.login-main {
position: absolute;
top: 0;
right: 0;
padding: 150px 60px 180px;
width: 470px;
min-height: 100%;
background-color: #fff;
}
.login-title {
font-size: 16px;
}
.login-captcha {
overflow: hidden;
> img {
width: 100%;
cursor: pointer;
}
}
.login-btn-submit {
width: 100%;
margin-top: 38px;
}
}
</style>
主要数据表设计:
数据库表结构文档
****数据库名:****renren-dangyuan
****文档版本:****V1.0.0
****文档描述:****数据库表设计描述
表dj_news
编号 | 名称 | 数据类型 | 长度 | 小数位 | 允许空值 | 主键 | 说明 |
1 | id | int | 10 | 0 | N | Y | |
2 | title | varchar | 255 | 0 | Y | N | 标题 |
3 | ty | varchar | 255 | 0 | Y | N | 类型 |
4 | create_time | datetime | 19 | 0 | Y | N | 发布时间 |
5 | unit | varchar | 255 | 0 | Y | N | 发布单位 |
6 | num | varchar | 255 | 0 | Y | N | 发布编号 |
7 | content | mediumtext | 16777215 | 0 | Y | N | 主要内容 |
8 | create_by | varchar | 255 | 0 | Y | N | 发布人 |
9 | bz | varchar | 255 | 0 | Y | N | 备注信息 |
10 | kind | varchar | 255 | 0 | Y | N | 种类(党建要闻 组织风采 ) |
11 | img | varchar | 255 | 0 | Y | N |
表exam
编号 | 名称 | 数据类型 | 长度 | 小数位 | 允许空值 | 主键 |
1 | id | int | 10 | 0 | N | Y |
2 | title | varchar | 255 | 0 | Y | N |
3 | answ | varchar | 255 | 0 | Y | N |
4 | user_name | varchar | 255 | 0 | Y | N |
5 | exam_time | datetime | 19 | 0 | Y | N |
6 | user_score | varchar | 255 | 0 | Y | N |
7 | is_qualified | varchar | 255 | 0 | Y | N |
8 | ty | varchar | 255 | 0 | Y | N |
9 | p_name | varchar | 255 | 0 | Y | N |
10 | mobile | varchar | 255 | 0 | Y | N |
表file
编号 | 名称 | 数据类型 | 长度 | 小数位 | 允许空值 | 主键 |
1 | id | int | 10 | 0 | N | Y |
2 | path | varchar | 255 | 0 | Y | N |
3 | file_name | varchar | 255 | 0 | Y | N |
4 | file_type | varchar | 255 | 0 | Y | N |
5 | classify | varchar | 255 | 0 | Y | N |
6 | create_time | datetime | 19 | 0 | Y | N |
7 | create_by | varchar | 255 | 0 | Y | N |
表inform
编号 | 名称 | 数据类型 | 长度 | 小数位 | 允许空值 | 主键 | 默认值 |
1 | id | int | 10 | 0 | N | Y | |
2 | title | varchar | 255 | 0 | Y | N | |
3 | content | text | 65535 | 0 | Y | N | |
4 | create_time | timestamp | 19 | 0 | Y | N | CURRENT_TIMESTAMP |
5 | create_by | varchar | 255 | 0 | Y | N | |
6 | bz | varchar | 255 | 0 | Y | N |
表sys_captcha (系统验证码)
编号 | 名称 | 数据类型 | 长度 | 小数位 | 允许空值 | 主键 | 默认值 | 说明 |
1 | uuid | char | 36 | 0 | N | Y | uuid | |
2 | code | varchar | 6 | 0 | N | N | 验证码 | |
3 | expire_time | datetime | 19 | 0 | Y | N | 过期时间 |
表sys_config (系统配置信息表)
编号 | 名称 | 数据类型 | 长度 | 小数位 | 允许空值 | 主键 | 默认值 | 说明 |
1 | id | bigint | 20 | 0 | N | Y | ||
2 | param_key | varchar | 50 | 0 | Y | N | key | |
3 | param_value | varchar | 2000 | 0 | Y | N | value | |
4 | status | tinyint | 4 | 0 | Y | N | 1 | 状态 0:隐藏 1:显示 |
5 | remark | varchar | 500 | 0 | Y | N | 备注 |
表sys_dept (部门管理)
编号 | 名称 | 数据类型 | 长度 | 小数位 | 允许空值 | 主键 | 默认值 | 说明 |
1 | dept_id | bigint | 20 | 0 | N | Y | ||
2 | parent_id | bigint | 20 | 0 | Y | N | 上级部门ID,一级部门为0 | |
3 | name | varchar | 50 | 0 | Y | N | 部门名称 | |
4 | order_num | int | 10 | 0 | Y | N | 排序 | |
5 | del_flag | tinyint | 4 | 0 | Y | N | 0 | 是否删除 -1:已删除 0:正常 |
6 | remark | varchar | 255 | 0 | Y | N |
最后
针对以上面试题,小编已经把面试题+答案整理好了
面试专题
除了以上面试题+答案,小编同时还整理了微服务相关的实战文档也可以分享给大家学习
中…(img-AumwkZLO-1715517448963)]
[外链图片转存中…(img-4sgKCrAH-1715517448963)]
面试专题
[外链图片转存中…(img-cdUoGpqT-1715517448963)]
除了以上面试题+答案,小编同时还整理了微服务相关的实战文档也可以分享给大家学习
[外链图片转存中…(img-YoK2TOqF-1715517448963)]
[外链图片转存中…(img-RNJfIXqj-1715517448964)]
[外链图片转存中…(img-xl3venAi-1715517448964)]