From e0d9813f5fae45591b971fb44ac01e48e1d788ec Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Thu, 14 Oct 2021 18:01:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=AA=E4=BA=BA=E4=B8=AD?= =?UTF-8?q?=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.js | 39 +++-- src/layouts/header/index.vue | 12 +- src/pages/appraisal/list/index.vue | 5 +- src/pages/setting/person/index.vue | 224 ++++++++++++++--------------- src/router/routes.js | 2 +- src/setting.js | 4 +- 6 files changed, 146 insertions(+), 140 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 8a9f44e..cbef640 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,7 +1,7 @@ import Setting from "@/setting"; 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/`; @@ -67,14 +67,24 @@ export default { // 阿里云文件/视频管理 fileDeletion: `${uploadURL}oss/manage/fileDeletion`, // 删除OSS文件 - fileupload: `${uploadURL}oss/manage/fileUpload`, // 文件上传 + fileupload: `${uploadURL}oss/manage/fileupload`, // 文件上传 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`, //登录 updateLogInNumber: `${loginhost}userInfo/updateLogInNumber`, //用户登录修改登录次数和登陆时间 - uploadUserAvatars: `${loginhost}userInfo/uploadUserAvatars`, //上传头像 + loginSchool: `${loginhost}userInfo/loginSchoolClient`, //登陆查询学校 loginRole: `${loginhost}userInfo/loginRole`, //登陆查询角色 save: `${host}tms/userInfo/add`, //注册 @@ -131,9 +141,7 @@ export default { queryStaffGradeDetails: `${host}staffGrade/queryStaffGradeDetails`, //查询员工部门详情 addStaffGrade: `${host}staffGrade/addStaffGrade`, //新增员工部门 updateStaffGrade: `${host}staffGrade/updateStaffGrade`, //编辑员工部门 - queryCourseDiscipline: `${loginhost}course/queryCourseDiscipline`, //查询课程学科 - queryCourseProfessionalClass: `${loginhost}course/queryCourseProfessionalClass`, //查询专业类 - queryCourseProfessional: `${loginhost}course/queryCourseProfessional`, //查询专业 + queryPhone: `${loginhost}userInfo/queryPhone`, //查询电话是否存在 queryStaff: `${host}staff/queryStaff`, //查询员工 @@ -202,17 +210,8 @@ export default { queryStaffPAN: `${host}staffProfessionalArchitecture/queryStaffPAN`,//查询员工专业是否存在 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`,//校验手机验证码 + + diff --git a/src/layouts/header/index.vue b/src/layouts/header/index.vue index ddc919f..59e5a57 100644 --- a/src/layouts/header/index.vue +++ b/src/layouts/header/index.vue @@ -35,12 +35,19 @@ export default { ]) }, mounted() { - + this.getUserInfo(); }, methods: { ...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() { this.$router.push("/setting/person"); }, @@ -103,6 +110,7 @@ export default { .user-avator { margin-left: 10px; + font-size: 12px; } .ml20 { diff --git a/src/pages/appraisal/list/index.vue b/src/pages/appraisal/list/index.vue index b3e9223..4ddc579 100644 --- a/src/pages/appraisal/list/index.vue +++ b/src/pages/appraisal/list/index.vue @@ -129,7 +129,6 @@ export default { currentQuestionSortNo: this.question.currentQuestionSortNo, // userAnswer: this.selected.split('').sort().join(','), userAnswer: this.selected, - userId: this.userId, types: 0 }); if (res.data) { @@ -161,7 +160,7 @@ export default { } }, 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) { this.question = res.data; this.isDone = false; @@ -191,7 +190,7 @@ export default { }, 1000); }, 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); // this.countDown('00:00:05') }, diff --git a/src/pages/setting/person/index.vue b/src/pages/setting/person/index.vue index cfbd2e9..8c98bdb 100644 --- a/src/pages/setting/person/index.vue +++ b/src/pages/setting/person/index.vue @@ -7,10 +7,10 @@
点击更改头像
@@ -406,6 +406,7 @@ import { mapState, mapActions } from "vuex"; export default { data() { return { + token: util.local.get(Setting.tokenKey), personalInformation: { userName: "", name: "", @@ -543,7 +544,7 @@ export default { ]), getProvince() { this.$get(this.api.queryProvince).then(res => { - this.provinceList = res.message; + this.provinceList = res.list; }).catch(res => { }); }, @@ -566,9 +567,9 @@ export default { let provinceId = type == 1 ? this.personalInformation.provinceId : this.archivesList[index].provinceId; this.$get(this.api.queryCity, { provinceId }).then(res => { if (type == 1) { - this.cityList = res.message; + this.cityList = res.list; } else { - this.archivesList[index].cityList = res.message; + this.archivesList[index].cityList = res.list; } }).catch(res => { }); @@ -582,7 +583,7 @@ export default { // 获取学校名称 getSchoolData() { this.$get(this.api.querySchoolData, { schoolName: "", provinceId: "", cityId: "" }).then(res => { - this.schoolList = res.message; + this.schoolList = res.list; }).catch(res => { }); }, @@ -610,57 +611,54 @@ export default { } }, getdata() { - this.$get(`${this.api.userinfo}/${this.userId}`) - .then(res => { - this.personalInformation = Object.assign(this.personalInformation, res.data.userInfo[0]); - this.personalInformation.idNumber = this.personalInformation.IDNumber; - this.originAccount = this.personalInformation.account; - this.archivesList = res.data.userPersonalFile; - this.$nextTick(() => { - if (this.personalInformation.provinceId) { - this.getCityData(1); - } - if (this.archivesList.length != 0) { - this.archivesList.forEach((e, k) => { - this.$set(e, "subjectList", this.subjectList); - this.$set(e, "disciplineId", e.disciplineId ? e.disciplineId : ""); - this.$set(e, "disciplineName", e.disciplineName ? e.disciplineName : ""); - this.$set(e, "professionalClassId", e.professionalClassId ? e.professionalClassId : ""); - this.$set(e, "professionalClassName", e.professionalClassName ? e.professionalClassName : ""); - this.$set(e, "professionalId", e.professionalId ? e.professionalId : ""); - this.$set(e, "professionalName", e.professionalName ? e.professionalName : ""); - this.$set(e, "schoolId", e.schoolId ? e.schoolId : ""); - this.$set(e, "schoolName", e.schoolName ? e.schoolName : ""); - - if (e.disciplineId) { - this.$get(this.api.queryCourseProfessionalClass, { disciplineId: e.disciplineId }).then(res => { - this.$set(e, "ProfessionalClassList", res.message); - }).catch(res => { - }); - } else { - this.$set(e, "ProfessionalClassList", []); - } - if (e.professionalClassId) { - this.$get(this.api.queryCourseProfessional, { professionalClassId: e.professionalClassId }).then(res => { - this.$set(e, "ProfessionalList", res.message); - }).catch(res => { - }); - } else { - this.$set(e, "ProfessionalList", []); - } - // if(e.provinceId){ - // this.$get(this.api.queryCity,{provinceId: e.provinceId}).then(res => { - // this.$set(e, 'cityList', res.message); - // }).catch(res => {}); - // }else{ - // this.$set(e, 'cityList', []); - // } - }); - } else { - this.concatArch(1); - } - }); - }) + this.$get(this.api.queryUserInfoDetails).then(res => { + let userInfo = res.result.hrUserInfo; + let schoolId = userInfo.schoolId; + this.personalInformation = Object.assign(userInfo, res.result.userAccountList[0]); + this.personalInformation.schoolId = schoolId; + this.personalInformation.accountId = userInfo.id; + this.originAccount = this.personalInformation.account; + this.archivesList = res.result.personalFileList; + if (userInfo.userAvatars) this.avatar = userInfo.userAvatars; + + this.$nextTick(() => { + if (this.personalInformation.provinceId) { + this.getCityData(1); + } + if (this.archivesList.length != 0) { + this.archivesList.forEach((e, k) => { + this.$set(e, "subjectList", this.subjectList); + this.$set(e, "disciplineId", e.disciplineId ? e.disciplineId : ""); + this.$set(e, "disciplineName", e.disciplineName ? e.disciplineName : ""); + this.$set(e, "professionalClassId", e.professionalClassId ? e.professionalClassId : ""); + this.$set(e, "professionalClassName", e.professionalClassName ? e.professionalClassName : ""); + this.$set(e, "professionalId", e.professionalId ? e.professionalId : ""); + this.$set(e, "professionalName", e.professionalName ? e.professionalName : ""); + this.$set(e, "schoolId", e.schoolId ? e.schoolId : ""); + this.$set(e, "schoolName", e.schoolName ? e.schoolName : ""); + + if (e.disciplineId) { + this.$get(this.api.queryCourseProfessionalClass, { disciplineId: e.disciplineId }).then(res => { + this.$set(e, "ProfessionalClassList", res.list); + }).catch(res => { + }); + } else { + this.$set(e, "ProfessionalClassList", []); + } + if (e.professionalClassId) { + this.$get(this.api.queryCourseProfessional, { professionalClassId: e.professionalClassId }).then(res => { + this.$set(e, "ProfessionalList", res.list); + }).catch(res => { + }); + } else { + this.$set(e, "ProfessionalList", []); + } + }); + } else { + this.concatArch(1); + } + }); + }) .catch(err => { console.log(err); }); @@ -748,7 +746,7 @@ export default { // 获取学科类别 getSubject() { this.$get(this.api.queryCourseDiscipline).then(res => { - this.subjectList = res.message; + this.subjectList = res.list; }).catch(res => { }); }, @@ -793,7 +791,7 @@ export default { this.$get(this.api.queryCourseProfessionalClass, { disciplineId: item }).then(res => { this.archivesList.map(e => { if (e.disciplineId == item) { - e.ProfessionalClassList = res.message; + e.ProfessionalClassList = res.list; e.disciplineName = obj.disciplineName; } }); @@ -803,7 +801,7 @@ export default { }, getProfessionalClassData(value) { this.$get(this.api.queryCourseProfessionalClass, { disciplineId: value }).then(res => { - this.ProfessionalClassList = res.message; + this.ProfessionalClassList = res.list; }).catch(res => { }); }, @@ -843,7 +841,7 @@ export default { obj = e.ProfessionalClassList.find(r => { return r.professionalClassId === item; }); - e.ProfessionalList = res.message; + e.ProfessionalList = res.list; e.professionalClassName = obj.professionalClassName; } }); @@ -853,7 +851,7 @@ export default { }, getProfessionalData(value) { this.$get(this.api.queryCourseProfessional, { professionalClassId: value }).then(res => { - this.ProfessionalList = res.message; + this.ProfessionalList = res.list; }).catch(res => { }); }, @@ -882,35 +880,17 @@ export default { }, save() { let isEmpty = false; - this.archivesList.forEach((n, k) => { - if (!n.personalCareerId) isEmpty = true; - n.userId = this.userId; - }); - if (isEmpty) return util.warningMsg("请选择职业"); - if (this.accountReapeat) return util.warningMsg("该账号已存在"); + // this.archivesList.forEach((n, k) => { + // if (!n.personalCareerId) isEmpty = true; + // n.userId = this.userId; + // }); + // if (isEmpty) 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("请输入正确的证件号码"); - let personalInformation = this.personalInformation; - let userInfoEntity = { - idNumber: personalInformation.idNumber, - account: personalInformation.account, - 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, + let form = this.personalInformation; + let personalFileList = [] + this.archivesList.forEach((n,k) => { + n.personalCareerId && personalFileList.push({ disciplineId: n.disciplineId, disciplineName: n.disciplineName, personalCareerId: n.personalCareerId, @@ -923,19 +903,35 @@ export default { provinceName: n.provinceName, schoolId: n.schoolId, schoolName: n.schoolName, - userId: this.userId - }); - }); + userId: form.userId + }) + }) let data = { - userInfoEntity, - personalFileEntities - }; - this.$put(this.api.userinfoUpdate, data).then(res => { - this.setUserName(personalInformation.userName); - // bus.$emit('updateAccount',personalInformation.userName) - util.successMsg("提交成功!"); - }).catch(res => { - }); + userId: form.userId, + userAccountList: [{ + id: form.accountId, + account: form.account, + userId: form.userId, + }], + hrUserInfo: { + 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() { let count = 60; @@ -986,10 +982,12 @@ export default { email: this.email, types: 1 }; - this.$post(this.api.sendEmailCode, data).then(res => { - if (res.errmessage == "success") { + this.$post(this.api.sendPhoneOrEmailCode, data).then(res => { + if(res.message.opener){ this.emailCountdown(); - this.emailOpener = res.data; + this.emailOpener = res.message.opener; + } else{ + util.errorMsg(res.message); } }).catch(res => { }); @@ -1005,8 +1003,8 @@ export default { code: this.emailCode, opener: this.emailOpener }; - this.$put(this.api.bingEmail, data).then(res => { - if (res.errmessage == "success") { + this.$put(this.api.bindPhoneOrEmail, data).then(res => { + if(res.status == 200){ util.successMsg("绑定成功"); this.personalInformation.email = this.email; this.emailVisible = false; @@ -1027,10 +1025,12 @@ export default { phone: this.phone, types: 2 }; - this.$post(this.api.sendPhoneCode, data).then(res => { - if (res.errmessage == "success") { + this.$post(this.api.sendPhoneOrEmailCode, data).then(res => { + if(res.message.opener){ this.phoneCountdown(); - this.phoneOpener = res.data; + this.phoneOpener = res.message.opener; + } else{ + util.errorMsg(res.message); } }).catch(res => { }); @@ -1046,8 +1046,8 @@ export default { code: this.phoneCode, opener: this.phoneOpener }; - this.$put(this.api.bindPhone, data).then(res => { - if (res.errmessage == "success") { + this.$put(this.api.bindPhoneOrEmail, data).then(res => { + if(res.status == 200){ util.successMsg("绑定成功"); this.personalInformation.phone = this.phone; this.phoneVisible = false; diff --git a/src/router/routes.js b/src/router/routes.js index 2f1de49..2e71d07 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -17,7 +17,7 @@ const frameIn = [ }, { path: "/index", - redirect: "/appraisal" + redirect: "/station" }, { path: "/", diff --git a/src/setting.js b/src/setting.js index 2b5c31b..ee2eec6 100644 --- a/src/setting.js +++ b/src/setting.js @@ -47,10 +47,10 @@ if (isHh) { schoolId = 2105; } 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.151:9000/"; // 榕 - host = "http://192.168.31.125:9000/"; // 坤 + // host = "http://192.168.31.125:9000/"; // 坤 defaultSubSystem = "http://39.108.250.202/pyTrials/#/"; title = "职站"; schoolId = 2105;