|
@@ -14,7 +14,7 @@
|
|
|
<div class="row">
|
|
|
<div class="col-md-4 text-center">
|
|
|
<h1 class="jumbotron-heading">完善个人简历</h1>
|
|
|
- <img style="margin-top: 32px;" src="" alt="" th:src="${resume.getPhoto()}"/>
|
|
|
+ <img id="photo" style="margin-top: 32px;" src="" alt="" width="240" th:src="${resume.getPhoto()}"/>
|
|
|
<h5 style="margin-top: 16px;">照片</h5>
|
|
|
</div>
|
|
|
|
|
@@ -22,7 +22,7 @@
|
|
|
<form>
|
|
|
<div class="form-group">
|
|
|
<label for="input-name">姓名</label>
|
|
|
- <input class="form-control" id="input-name" type="text" placeholder="姓名" maxlength="16"
|
|
|
+ <input class="form-control" id="input-name" type="text" placeholder="" maxlength="16"
|
|
|
th:value="${resume.getName()}"/>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
@@ -31,52 +31,52 @@
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label for="input-job-planning">职业规划</label>
|
|
|
- <input class="form-control" id="input-job-planning" type="text" placeholder="职业规划" maxlength="32"
|
|
|
+ <input class="form-control" id="input-job-planning" type="text" placeholder="" maxlength="32"
|
|
|
th:value="${resume.getJobPlanning()}"/>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label for="input-phone">手机号码</label>
|
|
|
- <input class="form-control" id="input-phone" type="text" placeholder="手机号码" maxlength="32"
|
|
|
+ <input class="form-control" id="input-phone" type="text" placeholder="" maxlength="32"
|
|
|
th:value="${resume.getPhone()}"/>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label for="input-mail">电子邮箱</label>
|
|
|
- <input class="form-control" id="input-mail" type="text" placeholder="电子邮箱" maxlength="64"
|
|
|
+ <input class="form-control" id="input-mail" type="text" placeholder="" maxlength="64"
|
|
|
th:value="${resume.getMail()}"/>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label for="input-website">网站</label>
|
|
|
- <input class="form-control" id="input-website" type="text" placeholder="网站" maxlength="64"
|
|
|
+ <input class="form-control" id="input-website" type="text" placeholder="" maxlength="64"
|
|
|
th:value="${resume.getWebsite()}"/>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label for="input-home">家乡</label>
|
|
|
- <input class="form-control" id="input-home" type="text" placeholder="家乡" maxlength="32"
|
|
|
+ <input class="form-control" id="input-home" type="text" placeholder="" maxlength="32"
|
|
|
th:value="${resume.getHome()}"/>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label for="input-signature">签名</label>
|
|
|
- <input class="form-control" id="input-signature" type="text" placeholder="签名" maxlength="255"
|
|
|
+ <input class="form-control" id="input-signature" type="text" placeholder="" maxlength="255"
|
|
|
th:value="${resume.getSignature()}"/>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label for="input-place">当前所在地</label>
|
|
|
- <input class="form-control" id="input-place" type="text" placeholder="当前所在地" maxlength="255"
|
|
|
+ <input class="form-control" id="input-place" type="text" placeholder="" maxlength="32"
|
|
|
th:value="${resume.getPlace()}"/>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label for="input-edu-time">最高学历时间</label>
|
|
|
- <input class="form-control" id="input-edu-time" type="text" placeholder="最高学历时间" maxlength="255"
|
|
|
+ <input class="form-control" id="input-edu-time" type="text" placeholder="" maxlength="64"
|
|
|
th:value="${resume.getEduTime()}"/>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label for="input-edu-school">最高学历学校</label>
|
|
|
- <input class="form-control" id="input-edu-school" type="text" placeholder="最高学历学校" maxlength="255"
|
|
|
+ <input class="form-control" id="input-edu-school" type="text" placeholder="" maxlength="64"
|
|
|
th:value="${resume.getEduSchool()}"/>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label for="input-edu-profession">学习专业</label>
|
|
|
- <input class="form-control" id="input-edu-profession" type="text" placeholder="学习专业" maxlength="255"
|
|
|
+ <input class="form-control" id="input-edu-profession" type="text" placeholder="" maxlength="64"
|
|
|
th:value="${resume.getEduProfession()}"/>
|
|
|
</div>
|
|
|
</form>
|
|
@@ -85,48 +85,48 @@
|
|
|
<form>
|
|
|
<div class="form-group">
|
|
|
<label for="input-work-time">工作时间</label>
|
|
|
- <input class="form-control" id="input-work-time" type="text" placeholder="工作时间" maxlength="255"
|
|
|
+ <input class="form-control" id="input-work-time" type="text" placeholder="" maxlength="64"
|
|
|
th:value="${resume.getWorkTime()}"/>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label for="input-work-company">工作公司</label>
|
|
|
- <input class="form-control" id="input-work-company" type="text" placeholder="工作公司" maxlength="255"
|
|
|
+ <input class="form-control" id="input-work-company" type="text" placeholder="" maxlength="64"
|
|
|
th:value="${resume.getWorkCompany()}"/>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label for="input-work-position">职位</label>
|
|
|
- <input class="form-control" id="input-work-position" type="text" placeholder="职位" maxlength="255"
|
|
|
+ <input class="form-control" id="input-work-position" type="text" placeholder="" maxlength="64"
|
|
|
th:value="${resume.getWorkPosition()}"/>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label for="textarea-work-description">工作描述</label>
|
|
|
<textarea class="form-control" id="textarea-work-description" rows="4" maxlength="500"
|
|
|
- th:value="${resume.getWorkDescription()}"></textarea>
|
|
|
+ th:text="${resume.getWorkDescription()}"></textarea>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label for="textarea-work-gain">工作收获</label>
|
|
|
<textarea class="form-control" id="textarea-work-gain" rows="4" maxlength="500"
|
|
|
- th:value="${resume.getWorkGain()}"></textarea>
|
|
|
+ th:text="${resume.getWorkGain()}"></textarea>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label for="textarea-skill">专业技能</label>
|
|
|
<textarea class="form-control" id="textarea-skill" rows="4" maxlength="500"
|
|
|
- th:value="${resume.getSkill()}"></textarea>
|
|
|
+ th:text="${resume.getSkill()}"></textarea>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label for="textarea-project">项目经历</label>
|
|
|
<textarea class="form-control" id="textarea-project" rows="4" maxlength="500"
|
|
|
- th:value="${resume.getProject()}"></textarea>
|
|
|
+ th:text="${resume.getProject()}"></textarea>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label for="textarea-hobby">兴趣爱好</label>
|
|
|
<textarea class="form-control" id="textarea-hobby" rows="4" maxlength="500"
|
|
|
- th:value="${resume.getHobby()}"></textarea>
|
|
|
+ th:text="${resume.getHobby()}"></textarea>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label for="textarea-description">自我描述</label>
|
|
|
<textarea class="form-control" id="textarea-description" rows="4" maxlength="500"
|
|
|
- th:value="${resume.getDescription()}"></textarea>
|
|
|
+ th:text="${resume.getDescription()}"></textarea>
|
|
|
</div>
|
|
|
</form>
|
|
|
</div>
|
|
@@ -152,8 +152,73 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <script>
|
|
|
+ <script src="https://files.minbb.cn/plugins/jquery/3.4.0/jquery.js"></script>
|
|
|
+ <script type="text/javascript">
|
|
|
+ let photo = $("#photo")[0].src;
|
|
|
+ $(document).ready(function () {
|
|
|
+ $('#input-photo').change(function (e) {
|
|
|
+ let file = e.target.files[0];
|
|
|
+ if (file == null) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!/image\/\w+/.test(file.type)) {
|
|
|
+ alert("请确保文件为图像类型");
|
|
|
+ return false;
|
|
|
+ } else if (file.size / 1024 > 1024) {
|
|
|
+ alert("图像大小不能超过 1MB");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (window.FileReader) {
|
|
|
+ let reader = new FileReader();
|
|
|
+ reader.readAsDataURL(file);
|
|
|
+ reader.onloadend = function () {
|
|
|
+ photo = reader.result;
|
|
|
+ $('#photo').attr('src', photo);
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ alert("浏览器不支持");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
function save(obj) {
|
|
|
+ let name = $('#input-name').val(), jobPlanning = $('#input-job-planning').val(), phone = $('#input-phone').val(), mail = $('#input-mail').val(),
|
|
|
+ website = $('#input-website').val(), home = $('#input-home').val(), signature = $('#input-signature').val(), place = $('#input-place').val(),
|
|
|
+ eduTime = $('#input-edu-time').val(), eduSchool = $('#input-edu-school').val(), eduProfession = $('#input-edu-profession').val(),
|
|
|
+ workTime = $('#input-work-time').val(), workCompany = $('#input-work-company').val(), workPosition = $('#input-work-position').val(),
|
|
|
+ workDescription = $('#textarea-work-description').val(), workGain = $('#textarea-work-gain').val(), skill = $('#textarea-skill').val(),
|
|
|
+ project = $('#textarea-project').val(), hobby = $('#textarea-hobby').val(), description = $('#textarea-description').val();
|
|
|
+ if (name === '') {
|
|
|
+ alert("姓名不能为空");
|
|
|
+ return;
|
|
|
+ } else if (photo === "") {
|
|
|
+ alert("照片不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ url: '/user/info',
|
|
|
+ type: 'POST',
|
|
|
+ contentType: "application/json; charset=utf-8",
|
|
|
+ data: JSON.stringify({
|
|
|
+ "name": name, "photo": photo, "jobPlanning": jobPlanning, "phone": phone, "mail": mail,
|
|
|
+ "website": website, "home": home, "signature": signature, "place": place,
|
|
|
+ "eduTime": eduTime, "eduSchool": eduSchool, "eduProfession": eduProfession,
|
|
|
+ "workTime": workTime, "workCompany": workCompany, "workPosition": workPosition,
|
|
|
+ "workDescription": workDescription, "workGain": workGain, "skill": skill,
|
|
|
+ "project": project, "hobby": hobby, "description": description
|
|
|
+ }),
|
|
|
+ dataType: "json",
|
|
|
+ success: function (data) {
|
|
|
+ if (data.success) {
|
|
|
+ window.location.reload();
|
|
|
+ } else {
|
|
|
+ alert("请重试");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function (data) {
|
|
|
+ console.log(data);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
</script>
|
|
|
</th:block>
|