更新个人中心

UI_2022-02-10
yujialong 3 years ago
parent b6a3ce9818
commit e0d9813f5f
  1. 39
      src/api/index.js
  2. 12
      src/layouts/header/index.vue
  3. 5
      src/pages/appraisal/list/index.vue
  4. 224
      src/pages/setting/person/index.vue
  5. 2
      src/router/routes.js
  6. 4
      src/setting.js

@ -1,7 +1,7 @@
import Setting from "@/setting"; import Setting from "@/setting";
let host = Setting.apiBaseURL; let host = Setting.apiBaseURL;
let uploadURL = "http://39.108.250.202:10000/"; let uploadURL = "http://39.108.250.202:9000/";
let loginhost = `${Setting.apiBaseURL}liuwanr/`; let loginhost = `${Setting.apiBaseURL}liuwanr/`;
@ -67,14 +67,24 @@ export default {
// 阿里云文件/视频管理 // 阿里云文件/视频管理
fileDeletion: `${uploadURL}oss/manage/fileDeletion`, // 删除OSS文件 fileDeletion: `${uploadURL}oss/manage/fileDeletion`, // 删除OSS文件
fileupload: `${uploadURL}oss/manage/fileUpload`, // 文件上传 fileupload: `${uploadURL}oss/manage/fileupload`, // 文件上传
getPlayAuth: `${uploadURL}oss/manage/getPlayAuth`, // 获取播放凭证 getPlayAuth: `${uploadURL}oss/manage/getPlayAuth`, // 获取播放凭证
queryProvince: `${host}nakadai/nakadai/province/queryProvince`, //查询省份
queryCity: `${host}nakadai/nakadai/city/queryCity`, //查询城市
querySchoolData: `${host}nakadai/nakadai/school/querySchool`, //根据学校名称查询学校信息
queryCourseDiscipline: `${host}nakadai/nakadai/subject/courseDiscipline`, //查询课程学科
queryCourseProfessionalClass: `${host}nakadai/nakadai/subject/courseProfessionalClass`, //查询专业类
queryCourseProfessional: `${host}nakadai/nakadai/subject/courseProfessional`, //查询专业
// 个人中心
uploadUserAvatars: `${host}users/users/userAccount/updateUserAvatars`, //更改头像
queryUserInfoDetails: `${host}users/users/userAccount/queryUserInfoDetails`,//个人中心信息展示
updatePersonCenter: `${host}users/users/userAccount/updatePersonCenter`,//个人中心信息修改
examinePassword: `${host}users/users/userAccount/examinePassword`,//更换密码
bindPhoneOrEmail: `${host}/users/users/userAccount/bindPhoneOrEmail`,// 绑定手机或邮箱
sendPhoneOrEmailCode: `${host}/users/users/userAccount/sendPhoneOrEmailCode`,// 更换手机号或邮箱--发送手机验证码
@ -88,7 +98,7 @@ export default {
// logins: `${loginhost}userInfo/logins`, //登录 // logins: `${loginhost}userInfo/logins`, //登录
updateLogInNumber: `${loginhost}userInfo/updateLogInNumber`, //用户登录修改登录次数和登陆时间 updateLogInNumber: `${loginhost}userInfo/updateLogInNumber`, //用户登录修改登录次数和登陆时间
uploadUserAvatars: `${loginhost}userInfo/uploadUserAvatars`, //上传头像
loginSchool: `${loginhost}userInfo/loginSchoolClient`, //登陆查询学校 loginSchool: `${loginhost}userInfo/loginSchoolClient`, //登陆查询学校
loginRole: `${loginhost}userInfo/loginRole`, //登陆查询角色 loginRole: `${loginhost}userInfo/loginRole`, //登陆查询角色
save: `${host}tms/userInfo/add`, //注册 save: `${host}tms/userInfo/add`, //注册
@ -131,9 +141,7 @@ export default {
queryStaffGradeDetails: `${host}staffGrade/queryStaffGradeDetails`, //查询员工部门详情 queryStaffGradeDetails: `${host}staffGrade/queryStaffGradeDetails`, //查询员工部门详情
addStaffGrade: `${host}staffGrade/addStaffGrade`, //新增员工部门 addStaffGrade: `${host}staffGrade/addStaffGrade`, //新增员工部门
updateStaffGrade: `${host}staffGrade/updateStaffGrade`, //编辑员工部门 updateStaffGrade: `${host}staffGrade/updateStaffGrade`, //编辑员工部门
queryCourseDiscipline: `${loginhost}course/queryCourseDiscipline`, //查询课程学科
queryCourseProfessionalClass: `${loginhost}course/queryCourseProfessionalClass`, //查询专业类
queryCourseProfessional: `${loginhost}course/queryCourseProfessional`, //查询专业
queryPhone: `${loginhost}userInfo/queryPhone`, //查询电话是否存在 queryPhone: `${loginhost}userInfo/queryPhone`, //查询电话是否存在
queryStaff: `${host}staff/queryStaff`, //查询员工 queryStaff: `${host}staff/queryStaff`, //查询员工
@ -202,17 +210,8 @@ export default {
queryStaffPAN: `${host}staffProfessionalArchitecture/queryStaffPAN`,//查询员工专业是否存在 queryStaffPAN: `${host}staffProfessionalArchitecture/queryStaffPAN`,//查询员工专业是否存在
queryStudentisAssess: `${host}assesment/queryStudentisAssess`,//查看正在参与考核的学生 queryStudentisAssess: `${host}assesment/queryStudentisAssess`,//查看正在参与考核的学生
queryProvince: `${loginhost}province/queryProvince`, //查询省份
queryCity: `${loginhost}city/queryCity`, //查询城市
querySchoolData: `${loginhost}customer/querySchool`, //根据学校名称查询学校信息
examinePassword: `${host}tms/user/examinePassword`,//更换密码
userinfoUpdate: `${host}tms/user/update`,//个人中心信息修改
userinfo: `${host}tms/user/userinfo`,//个人中心信息展示
sendEmailCode: `${host}tms/user/sendEmailCode`,//发送邮箱验证码
bingEmail: `${host}tms/user/bingEmail`,//邮箱验证并更新
sendPhoneCode: `${host}tms/user/sendPhoneCode`,//发送手机验证码
bindPhone: `${host}tms/user/bindPhone`,//校验手机验证码

@ -35,12 +35,19 @@ export default {
]) ])
}, },
mounted() { mounted() {
this.getUserInfo();
}, },
methods: { methods: {
...mapActions("user", [ ...mapActions("user", [
"logout" "logout", "setAvatar", "setUserName"
]), ]),
getUserInfo() {
this.$get(this.api.queryUserInfoDetails).then(res => {
let {userAvatars, userName} = res.result.hrUserInfo;
this.setAvatar(userAvatars);
this.setUserName(userName);
}).catch(err => {})
},
toPersonal() { toPersonal() {
this.$router.push("/setting/person"); this.$router.push("/setting/person");
}, },
@ -103,6 +110,7 @@ export default {
.user-avator { .user-avator {
margin-left: 10px; margin-left: 10px;
font-size: 12px;
} }
.ml20 { .ml20 {

@ -129,7 +129,6 @@ export default {
currentQuestionSortNo: this.question.currentQuestionSortNo, currentQuestionSortNo: this.question.currentQuestionSortNo,
// userAnswer: this.selected.split('').sort().join(','), // userAnswer: this.selected.split('').sort().join(','),
userAnswer: this.selected, userAnswer: this.selected,
userId: this.userId,
types: 0 types: 0
}); });
if (res.data) { if (res.data) {
@ -161,7 +160,7 @@ export default {
} }
}, },
async start() { async start() {
let res = await this.$get(this.api.experimentStart, { userId: this.userId, types: 0 }); let res = await this.$get(this.api.experimentStart);
if (res.data) { if (res.data) {
this.question = res.data; this.question = res.data;
this.isDone = false; this.isDone = false;
@ -191,7 +190,7 @@ export default {
}, 1000); }, 1000);
}, },
async getCountdown() { async getCountdown() {
let res = await this.$get(this.api.experimentRemaining, { userId: this.userId }); let res = await this.$get(this.api.experimentRemaining);
res.data && this.countDown(res.data); res.data && this.countDown(res.data);
// this.countDown('00:00:05') // this.countDown('00:00:05')
}, },

@ -7,10 +7,10 @@
<div style="color:#9278FF;font-size:14px;font-family:MicrosoftYaHei;margin-top:5px;"> <div style="color:#9278FF;font-size:14px;font-family:MicrosoftYaHei;margin-top:5px;">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
:headers="{token}"
:action="this.api.uploadUserAvatars" :action="this.api.uploadUserAvatars"
:data="{userId: this.userId}"
name="file" name="file"
:limit="3" :limit="1"
:on-success="getRes" :on-success="getRes"
> >
<div>点击更改头像</div> <div>点击更改头像</div>
@ -406,6 +406,7 @@ import { mapState, mapActions } from "vuex";
export default { export default {
data() { data() {
return { return {
token: util.local.get(Setting.tokenKey),
personalInformation: { personalInformation: {
userName: "", userName: "",
name: "", name: "",
@ -543,7 +544,7 @@ export default {
]), ]),
getProvince() { getProvince() {
this.$get(this.api.queryProvince).then(res => { this.$get(this.api.queryProvince).then(res => {
this.provinceList = res.message; this.provinceList = res.list;
}).catch(res => { }).catch(res => {
}); });
}, },
@ -566,9 +567,9 @@ export default {
let provinceId = type == 1 ? this.personalInformation.provinceId : this.archivesList[index].provinceId; let provinceId = type == 1 ? this.personalInformation.provinceId : this.archivesList[index].provinceId;
this.$get(this.api.queryCity, { provinceId }).then(res => { this.$get(this.api.queryCity, { provinceId }).then(res => {
if (type == 1) { if (type == 1) {
this.cityList = res.message; this.cityList = res.list;
} else { } else {
this.archivesList[index].cityList = res.message; this.archivesList[index].cityList = res.list;
} }
}).catch(res => { }).catch(res => {
}); });
@ -582,7 +583,7 @@ export default {
// //
getSchoolData() { getSchoolData() {
this.$get(this.api.querySchoolData, { schoolName: "", provinceId: "", cityId: "" }).then(res => { this.$get(this.api.querySchoolData, { schoolName: "", provinceId: "", cityId: "" }).then(res => {
this.schoolList = res.message; this.schoolList = res.list;
}).catch(res => { }).catch(res => {
}); });
}, },
@ -610,57 +611,54 @@ export default {
} }
}, },
getdata() { getdata() {
this.$get(`${this.api.userinfo}/${this.userId}`) this.$get(this.api.queryUserInfoDetails).then(res => {
.then(res => { let userInfo = res.result.hrUserInfo;
this.personalInformation = Object.assign(this.personalInformation, res.data.userInfo[0]); let schoolId = userInfo.schoolId;
this.personalInformation.idNumber = this.personalInformation.IDNumber; this.personalInformation = Object.assign(userInfo, res.result.userAccountList[0]);
this.originAccount = this.personalInformation.account; this.personalInformation.schoolId = schoolId;
this.archivesList = res.data.userPersonalFile; this.personalInformation.accountId = userInfo.id;
this.$nextTick(() => { this.originAccount = this.personalInformation.account;
if (this.personalInformation.provinceId) { this.archivesList = res.result.personalFileList;
this.getCityData(1); if (userInfo.userAvatars) this.avatar = userInfo.userAvatars;
}
if (this.archivesList.length != 0) { this.$nextTick(() => {
this.archivesList.forEach((e, k) => { if (this.personalInformation.provinceId) {
this.$set(e, "subjectList", this.subjectList); this.getCityData(1);
this.$set(e, "disciplineId", e.disciplineId ? e.disciplineId : ""); }
this.$set(e, "disciplineName", e.disciplineName ? e.disciplineName : ""); if (this.archivesList.length != 0) {
this.$set(e, "professionalClassId", e.professionalClassId ? e.professionalClassId : ""); this.archivesList.forEach((e, k) => {
this.$set(e, "professionalClassName", e.professionalClassName ? e.professionalClassName : ""); this.$set(e, "subjectList", this.subjectList);
this.$set(e, "professionalId", e.professionalId ? e.professionalId : ""); this.$set(e, "disciplineId", e.disciplineId ? e.disciplineId : "");
this.$set(e, "professionalName", e.professionalName ? e.professionalName : ""); this.$set(e, "disciplineName", e.disciplineName ? e.disciplineName : "");
this.$set(e, "schoolId", e.schoolId ? e.schoolId : ""); this.$set(e, "professionalClassId", e.professionalClassId ? e.professionalClassId : "");
this.$set(e, "schoolName", e.schoolName ? e.schoolName : ""); this.$set(e, "professionalClassName", e.professionalClassName ? e.professionalClassName : "");
this.$set(e, "professionalId", e.professionalId ? e.professionalId : "");
if (e.disciplineId) { this.$set(e, "professionalName", e.professionalName ? e.professionalName : "");
this.$get(this.api.queryCourseProfessionalClass, { disciplineId: e.disciplineId }).then(res => { this.$set(e, "schoolId", e.schoolId ? e.schoolId : "");
this.$set(e, "ProfessionalClassList", res.message); this.$set(e, "schoolName", e.schoolName ? e.schoolName : "");
}).catch(res => {
}); if (e.disciplineId) {
} else { this.$get(this.api.queryCourseProfessionalClass, { disciplineId: e.disciplineId }).then(res => {
this.$set(e, "ProfessionalClassList", []); this.$set(e, "ProfessionalClassList", res.list);
} }).catch(res => {
if (e.professionalClassId) { });
this.$get(this.api.queryCourseProfessional, { professionalClassId: e.professionalClassId }).then(res => { } else {
this.$set(e, "ProfessionalList", res.message); this.$set(e, "ProfessionalClassList", []);
}).catch(res => { }
}); if (e.professionalClassId) {
} else { this.$get(this.api.queryCourseProfessional, { professionalClassId: e.professionalClassId }).then(res => {
this.$set(e, "ProfessionalList", []); this.$set(e, "ProfessionalList", res.list);
} }).catch(res => {
// if(e.provinceId){ });
// this.$get(this.api.queryCity,{provinceId: e.provinceId}).then(res => { } else {
// this.$set(e, 'cityList', res.message); this.$set(e, "ProfessionalList", []);
// }).catch(res => {}); }
// }else{ });
// this.$set(e, 'cityList', []); } else {
// } this.concatArch(1);
}); }
} else { });
this.concatArch(1); })
}
});
})
.catch(err => { .catch(err => {
console.log(err); console.log(err);
}); });
@ -748,7 +746,7 @@ export default {
// //
getSubject() { getSubject() {
this.$get(this.api.queryCourseDiscipline).then(res => { this.$get(this.api.queryCourseDiscipline).then(res => {
this.subjectList = res.message; this.subjectList = res.list;
}).catch(res => { }).catch(res => {
}); });
}, },
@ -793,7 +791,7 @@ export default {
this.$get(this.api.queryCourseProfessionalClass, { disciplineId: item }).then(res => { this.$get(this.api.queryCourseProfessionalClass, { disciplineId: item }).then(res => {
this.archivesList.map(e => { this.archivesList.map(e => {
if (e.disciplineId == item) { if (e.disciplineId == item) {
e.ProfessionalClassList = res.message; e.ProfessionalClassList = res.list;
e.disciplineName = obj.disciplineName; e.disciplineName = obj.disciplineName;
} }
}); });
@ -803,7 +801,7 @@ export default {
}, },
getProfessionalClassData(value) { getProfessionalClassData(value) {
this.$get(this.api.queryCourseProfessionalClass, { disciplineId: value }).then(res => { this.$get(this.api.queryCourseProfessionalClass, { disciplineId: value }).then(res => {
this.ProfessionalClassList = res.message; this.ProfessionalClassList = res.list;
}).catch(res => { }).catch(res => {
}); });
}, },
@ -843,7 +841,7 @@ export default {
obj = e.ProfessionalClassList.find(r => { obj = e.ProfessionalClassList.find(r => {
return r.professionalClassId === item; return r.professionalClassId === item;
}); });
e.ProfessionalList = res.message; e.ProfessionalList = res.list;
e.professionalClassName = obj.professionalClassName; e.professionalClassName = obj.professionalClassName;
} }
}); });
@ -853,7 +851,7 @@ export default {
}, },
getProfessionalData(value) { getProfessionalData(value) {
this.$get(this.api.queryCourseProfessional, { professionalClassId: value }).then(res => { this.$get(this.api.queryCourseProfessional, { professionalClassId: value }).then(res => {
this.ProfessionalList = res.message; this.ProfessionalList = res.list;
}).catch(res => { }).catch(res => {
}); });
}, },
@ -882,35 +880,17 @@ export default {
}, },
save() { save() {
let isEmpty = false; let isEmpty = false;
this.archivesList.forEach((n, k) => { // this.archivesList.forEach((n, k) => {
if (!n.personalCareerId) isEmpty = true; // if (!n.personalCareerId) isEmpty = true;
n.userId = this.userId; // n.userId = this.userId;
}); // });
if (isEmpty) return util.warningMsg("请选择职业"); // if (isEmpty) return util.warningMsg("");
if (this.accountReapeat) return util.warningMsg("该账号已存在"); // if (this.accountReapeat) return util.warningMsg("");
if (this.personalInformation.idNumber && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/.test(this.personalInformation.idNumber)) return util.warningMsg("请输入正确的证件号码"); if (this.personalInformation.idNumber && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/.test(this.personalInformation.idNumber)) return util.warningMsg("请输入正确的证件号码");
let personalInformation = this.personalInformation; let form = this.personalInformation;
let userInfoEntity = { let personalFileList = []
idNumber: personalInformation.idNumber, this.archivesList.forEach((n,k) => {
account: personalInformation.account, n.personalCareerId && personalFileList.push({
cityId: personalInformation.cityId,
countries: personalInformation.countries,
dateBirth: personalInformation.dateBirth,
educationDegree: personalInformation.educationDegree,
email: personalInformation.email,
phone: personalInformation.phone,
provinceId: personalInformation.provinceId,
schoolId: personalInformation.schoolId,
sex: personalInformation.sex,
userId: this.userId,
userName: personalInformation.userName,
weChatID: personalInformation.weChatID
};
let personalFileEntities = [];
this.archivesList.forEach((n, k) => {
personalFileEntities.push({
cityId: n.cityId,
cityName: n.cityName,
disciplineId: n.disciplineId, disciplineId: n.disciplineId,
disciplineName: n.disciplineName, disciplineName: n.disciplineName,
personalCareerId: n.personalCareerId, personalCareerId: n.personalCareerId,
@ -923,19 +903,35 @@ export default {
provinceName: n.provinceName, provinceName: n.provinceName,
schoolId: n.schoolId, schoolId: n.schoolId,
schoolName: n.schoolName, schoolName: n.schoolName,
userId: this.userId userId: form.userId
}); })
}); })
let data = { let data = {
userInfoEntity, userId: form.userId,
personalFileEntities userAccountList: [{
}; id: form.accountId,
this.$put(this.api.userinfoUpdate, data).then(res => { account: form.account,
this.setUserName(personalInformation.userName); userId: form.userId,
// bus.$emit('updateAccount',personalInformation.userName) }],
util.successMsg("提交成功!"); hrUserInfo: {
}).catch(res => { provinceId: form.provinceId,
}); cityId: form.cityId,
countries: form.countries,
dateBirth: form.dateBirth,
educationDegree: form.educationDegree,
idNumber: form.idNumber,
schoolId: form.schoolId,
sex: form.sex,
userId: form.userId,
userName: form.userName,
wechatId: form.wechatId
},
personalFileList,
}
this.$post(this.api.updatePersonCenter,data).then(res => {
this.setUserName(form.userName);
this.$message.success('提交成功!')
}).catch(res => {})
}, },
emailCountdown() { emailCountdown() {
let count = 60; let count = 60;
@ -986,10 +982,12 @@ export default {
email: this.email, email: this.email,
types: 1 types: 1
}; };
this.$post(this.api.sendEmailCode, data).then(res => { this.$post(this.api.sendPhoneOrEmailCode, data).then(res => {
if (res.errmessage == "success") { if(res.message.opener){
this.emailCountdown(); this.emailCountdown();
this.emailOpener = res.data; this.emailOpener = res.message.opener;
} else{
util.errorMsg(res.message);
} }
}).catch(res => { }).catch(res => {
}); });
@ -1005,8 +1003,8 @@ export default {
code: this.emailCode, code: this.emailCode,
opener: this.emailOpener opener: this.emailOpener
}; };
this.$put(this.api.bingEmail, data).then(res => { this.$put(this.api.bindPhoneOrEmail, data).then(res => {
if (res.errmessage == "success") { if(res.status == 200){
util.successMsg("绑定成功"); util.successMsg("绑定成功");
this.personalInformation.email = this.email; this.personalInformation.email = this.email;
this.emailVisible = false; this.emailVisible = false;
@ -1027,10 +1025,12 @@ export default {
phone: this.phone, phone: this.phone,
types: 2 types: 2
}; };
this.$post(this.api.sendPhoneCode, data).then(res => { this.$post(this.api.sendPhoneOrEmailCode, data).then(res => {
if (res.errmessage == "success") { if(res.message.opener){
this.phoneCountdown(); this.phoneCountdown();
this.phoneOpener = res.data; this.phoneOpener = res.message.opener;
} else{
util.errorMsg(res.message);
} }
}).catch(res => { }).catch(res => {
}); });
@ -1046,8 +1046,8 @@ export default {
code: this.phoneCode, code: this.phoneCode,
opener: this.phoneOpener opener: this.phoneOpener
}; };
this.$put(this.api.bindPhone, data).then(res => { this.$put(this.api.bindPhoneOrEmail, data).then(res => {
if (res.errmessage == "success") { if(res.status == 200){
util.successMsg("绑定成功"); util.successMsg("绑定成功");
this.personalInformation.phone = this.phone; this.personalInformation.phone = this.phone;
this.phoneVisible = false; this.phoneVisible = false;

@ -17,7 +17,7 @@ const frameIn = [
}, },
{ {
path: "/index", path: "/index",
redirect: "/appraisal" redirect: "/station"
}, },
{ {
path: "/", path: "/",

@ -47,10 +47,10 @@ if (isHh) {
schoolId = 2105; schoolId = 2105;
} else if (isDev) { } else if (isDev) {
// 本地 // 本地
// host = "http://39.108.250.202:9000/"; // 中台测试服 host = "http://39.108.250.202:9000/"; // 中台测试服
// host = "http://192.168.31.137:9000/"; // 赓 // host = "http://192.168.31.137:9000/"; // 赓
// host = "http://192.168.31.151:9000/"; // 榕 // host = "http://192.168.31.151:9000/"; // 榕
host = "http://192.168.31.125:9000/"; // 坤 // host = "http://192.168.31.125:9000/"; // 坤
defaultSubSystem = "http://39.108.250.202/pyTrials/#/"; defaultSubSystem = "http://39.108.250.202/pyTrials/#/";
title = "职站"; title = "职站";
schoolId = 2105; schoolId = 2105;

Loading…
Cancel
Save