From 188891de525c10a7ef4cef42725a8377be4edba0 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 18 Oct 2021 17:20:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90=E9=85=8D=E7=BD=AE=EF=BC=8C?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=86=97=E4=BD=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.js | 7 +- src/components/quill/index.vue | 2 +- src/pages/account/login/index.vue | 218 ++++++++++++------ src/pages/achievement/ass/index.vue | 5 +- src/pages/achievement/edit/index.vue | 4 +- src/pages/achievement/list/index.vue | 41 ++-- src/pages/achievement/show/index.vue | 3 +- src/pages/achievement/teach/index.vue | 21 +- src/pages/achievement/vir/index.vue | 14 +- src/pages/assessment/add/index.vue | 13 +- src/pages/assessment/list/index.vue | 29 ++- .../add.vue => add/index.vue} | 5 +- .../index.vue} | 0 .../course/list/courseManagement/index.vue | 22 +- src/pages/course/list/index.vue | 9 +- .../course/list/sortManagement/index.vue | 12 +- .../preview.vue => preview/index.vue} | 0 src/pages/evaluation/list/index.vue | 35 ++- .../addArticle.vue => addarticle/index.vue} | 2 +- .../{list => }/columnManage/index.vue | 28 +-- .../{list => }/contentManage/contentList.vue | 16 +- .../{list => }/contentManage/index.vue | 0 src/pages/information/list/index.vue | 8 +- src/pages/match/add/index.vue | 4 +- src/pages/match/list/index.vue | 22 +- src/pages/match/list/manage/matchDetail.vue | 2 +- src/pages/match/manage/matchDetail.vue | 2 +- src/pages/match/manage/matchSignup.vue | 4 +- src/pages/project/add/index.vue | 7 +- src/pages/project/add/index.vue.copy | 12 +- src/pages/project/list/index.vue | 28 +-- src/pages/setting/list/index.vue | 45 ++-- src/pages/student/list/index.vue | 30 +-- src/pages/system/list/index.vue | 4 +- src/pages/system/list/role.vue | 16 +- src/pages/system/list/staff.vue | 24 +- src/router/index.js | 205 +++++++++------- src/router/modules/achievement.js | 43 ---- src/router/modules/assessment.js | 29 --- src/router/modules/course.js | 41 ---- src/router/modules/evaluation.js | 23 -- src/router/modules/information.js | 29 --- src/router/modules/match.js | 35 --- src/router/modules/project.js | 29 --- src/router/modules/setting.js | 23 -- src/router/modules/student.js | 23 -- src/router/modules/system.js | 23 -- src/router/routes.js | 22 -- src/setting.js | 5 +- 49 files changed, 512 insertions(+), 712 deletions(-) rename src/pages/course/{list/courseManagement/add.vue => add/index.vue} (98%) rename src/pages/course/{list/courseManagement/contentSettings.vue => contentSettings/index.vue} (100%) rename src/pages/course/{list/courseManagement/preview.vue => preview/index.vue} (100%) rename src/pages/information/{list/contentManage/addArticle.vue => addarticle/index.vue} (99%) rename src/pages/information/{list => }/columnManage/index.vue (90%) rename src/pages/information/{list => }/contentManage/contentList.vue (88%) rename src/pages/information/{list => }/contentManage/index.vue (100%) delete mode 100644 src/router/modules/achievement.js delete mode 100644 src/router/modules/assessment.js delete mode 100644 src/router/modules/course.js delete mode 100644 src/router/modules/evaluation.js delete mode 100644 src/router/modules/information.js delete mode 100644 src/router/modules/match.js delete mode 100644 src/router/modules/project.js delete mode 100644 src/router/modules/setting.js delete mode 100644 src/router/modules/student.js delete mode 100644 src/router/modules/system.js diff --git a/src/api/index.js b/src/api/index.js index 1bfae20..644d405 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -32,6 +32,7 @@ export default { saveOrg: `${host}occupationlab/architecture/save`, // 新增组织架构 updateOrg: `${host}occupationlab/architecture/update`, // 编辑组织架构 deleteOrg: `${host}occupationlab/architecture/delete`, // 删除组织架构 + studentTemplate: `http://39.108.250.202/template/职站学生导入模板.xlsx`, // 职站学生导入模板 // 测评管理 questionsList: `${host}occupationlab/questions/list`, // 题库列表查询 @@ -40,7 +41,7 @@ export default { questionsDetail: `${host}occupationlab/questions/detail`, // 查看当前题库信息 questionsDelete: `${host}occupationlab/questions/delete`, // 根据主键删除 questionsIsDisable: `${host}occupationlab/questions/isDisable`, // 是否禁用试题 - questionsTemplate: `${Setting.apiBaseURL}template/试题导入模板.xlsx`, //excel模板文件下载 + questionsTemplate: `http://39.108.250.202/template/职站试题导入模板.xlsx`, //excel模板文件下载 questionsImport: `${host}occupationlab/questions/importQuestion`, // 批量导入题库 questionsExportFailure: `${host}occupationlab/questions/exportFailure`, // 批量导入题库失败数据导出 questionsInfo: `${host}occupationlab/questions/info`, // 测评规则信息的展示 @@ -171,7 +172,8 @@ export default { bindPhoneOrEmail: `${host}/users/users/userAccount/bindPhoneOrEmail`,// 绑定手机或邮箱 sendPhoneOrEmailCode: `${host}/users/users/userAccount/sendPhoneOrEmailCode`,// 更换手机号或邮箱--发送手机验证码 - + // 系统设置 + staffTemplate: `http://39.108.250.202/template/职站员工用户导入模板.xlsx`, //职站员工用户导入模板 @@ -211,7 +213,6 @@ export default { // resetPwd: `${host}evaluation/tms/system/resetPwd`, dalStaffByStaffGradeId: `${host}evaluation/tms/system/dalStaffByStaffGradeId`, dalStaffByProfessionalId: `${host}evaluation/tms/system/dalStaffByProfessionalId`, - staffTemplate: `${host}template/staff.xlsx`, // 角色权限 rolePermissionList: `${host}evaluation/sys-permission/rolePermissionList`, diff --git a/src/components/quill/index.vue b/src/components/quill/index.vue index c8e58c6..195825c 100644 --- a/src/components/quill/index.vue +++ b/src/components/quill/index.vue @@ -9,7 +9,7 @@ :on-success="editorUploadSuccess" style="display: none" > - 点击上传 + 点击上传 diff --git a/src/pages/account/login/index.vue b/src/pages/account/login/index.vue index bfceb33..6b48fee 100644 --- a/src/pages/account/login/index.vue +++ b/src/pages/account/login/index.vue @@ -7,62 +7,58 @@
- - - - - - - - - - - - - - - - 马上登录 - - - - - - - - - - - - - - - - - - 马上登录 - - + + + + + + + + + + + + + + + + + + + + 马上登录 +
+ + + + + + +
+ + {{ phoneBtnText }} + +
+
+
+ + 取 消 + 确 定 + +
@@ -77,52 +73,130 @@ export default { data: function() { return { isHh: Setting.isHh, - tabName: "1", - param: { - account: "zh", - password: "111aaa", + activeName: "1", + loginForm: { + account: "", + password: "", code: "", // 验证码 random: "", // 随机数 - distinguish: null, // 区分手机号账号登录,1为账号登录,2为手机号或邮箱登录 - platform: 1 // 平台标识,1职站,2数据平台,3中台 + distinguish: 1, // 区分手机号账号登录,1为账号登录,2为手机号或邮箱登录 + platform: Setting.platformId }, - rules: { + loginRules: { account: [{ required: true, message: "请输入账号", trigger: "blur" }], password: [{ required: true, message: "请输入密码", trigger: "blur" }], code: [{ required: true, message: "请输入验证码", trigger: "blur" }] }, - verificationIMG: "" + verificationIMG: "", + phoneVisible: false, // 绑定手机号对话框 + phone: "", + phoneCode: "", + phoneDisabled: false, + phoneTimer: null, + phoneBtnText: "发送验证码" }; }, components: { vFooter }, + created() { + this.getVerImg(); + }, + mounted() { + // 页面离开的时候销毁手机和邮箱验证码定时器 + this.$once("hook:beforeDestroy", function() { + clearInterval(this.phoneTimer); + this.phoneTimer = null; + }); + }, methods: { ...mapActions("user", [ "login" ]), - submitForm(form) { - this.$refs[form].validate(valid => { + getVerImg() { // 获取验证码图片 + this.loginForm.random = Math.floor(Math.random() * 999999999); + this.verificationIMG = this.api.verification + "?random=" + `${this.loginForm.random}`; + }, + handleClick(tab, event) { // 切换标签 + this.loginForm.account = ""; + this.$refs.loginForm.clearValidate(); + this.loginRules.account[0].message = tab.index === "1" ? "请输入账号" : "请输入手机号/邮箱"; + }, + submitFormLogin() { // 提交登录 + this.$refs.loginForm.validate(valid => { if (valid) { - this.param.distinguish = this.tabName === "1" ? 1 : 2; - this.login(this.param).then(() => { + this.loginForm.distinguish = Number(this.activeName); + this.login(this.loginForm).then(() => { let redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : "/index"; this.$router.replace(redirect); - console.log(redirect) }).catch(res => { + if (res && res.status == 30001) { + this.phoneVisible = true; + } + this.getVerImg(); + this.loginForm.code = ""; }); } else { return util.errorMsg("请检查表单数据"); } }); }, - blur() { - this.param.random = Math.floor(Math.random() * 999999999); - this.verificationIMG = this.api.verification + "?random=" + `${this.param.random}`; + phoneCountdown() { + let count = 60; + if (!this.phoneTimer) { + this.phoneDisabled = true; + this.phoneTimer = setInterval(() => { + console.log("倒计时中"); + if (count > 0) { + count--; + this.phoneBtnText = `${count}秒后重试`; + } else { + this.phoneDisabled = false; + clearInterval(this.phoneTimer); + this.phoneTimer = null; + this.phoneBtnText = `发送验证码`; + } + }, 1000); + } + }, + sendPhoneCode() { + if (!this.phone) return util.warningMsg("请输入手机号"); + if (!/^1[3456789]\d{9}$/.test(this.phone)) return util.warningMsg("请输入正确的手机号"); + let data = { + platform: Setting.platformId, + phone: this.phone, + types: 2 + }; + this.$post(this.api.sendPhoneOrEmailCode, data).then(res => { + if (res.message.opener) { + this.phoneCountdown(); + this.phoneOpener = res.message.opener; + } else { + util.errorMsg(res.message); + } + + }).catch(res => { + }); + }, + phoneSubmit() { + if (!this.phone) return util.warningMsg("请输入手机号"); + if (!/^1[3456789]\d{9}$/.test(this.phone)) return util.warningMsg("请输入正确的手机号"); + if (!this.phoneCode) return util.warningMsg("请输入验证码"); + let data = { + phone: this.phone, + types: 2, + code: this.phoneCode, + opener: this.phoneOpener, + platform: Setting.platformId, + account: this.loginForm.account + }; + this.$post(this.api.bindPhoneOrEmail, data).then(res => { + util.successMsg("绑定成功"); + this.loginForm.phone = this.phone; + this.phoneVisible = false; + }).catch(res => { + }); } - }, - created() { - this.blur(); } }; @@ -221,7 +295,7 @@ export default { cursor: pointer; } - .btn { + .submit { width: 100%; height: 88px; margin-bottom: 50px; diff --git a/src/pages/achievement/ass/index.vue b/src/pages/achievement/ass/index.vue index b17a0fd..958754f 100644 --- a/src/pages/achievement/ass/index.vue +++ b/src/pages/achievement/ass/index.vue @@ -34,8 +34,8 @@
- 批量删除 - 导出 + 批量删除 + 导出
@@ -76,7 +76,6 @@