dev_202412
yujialong 3 months ago
parent 745caa7ab1
commit 5638089fc9
  1. 8
      src/pages/account/login/index.vue
  2. 65
      src/pages/setting/person/info.vue

@ -57,7 +57,7 @@
<img @click="getVerImg" :src="verificationIMG" class="ver-img" alt="">
</el-form-item>
</template>
<div class="bottom">
<div v-if="!form.distinguish" class="bottom">
<el-link :underline="false" type="primary" @click="switchType">{{ verCodeLogin ? '密码' : '验证码' }}登录</el-link>
<!-- 只有手机号和验证码两个字段的注册 -->
<el-link v-if="person" :underline="false" type="primary" @click="toAccount">没有账号点击申请</el-link>
@ -208,7 +208,7 @@
import vFooter from '@/layouts/footer'
import { mapState, mapMutations, mapActions } from 'vuex'
import Util from '@/libs/util'
import Setting from "@/setting";
import Setting from '@/setting'
import AccountApply from './accountApply'
import AccountApplyMatch from './accountApplyMatch'
import CryptoJS from 'crypto-js'
@ -716,7 +716,7 @@ export default {
const { phone, phoneCode } = this
if (!this.verifyPhone(phone)) return false
if (!phoneCode) return Util.warningMsg('请输入验证码')
const { workNumber, schoolId } = this.form
const { account, schoolId } = this.form
if (this.binding) {
this.$post(this.api.bindPhoneOrEmail, {
mark: this.form.type,
@ -725,7 +725,7 @@ export default {
code: phoneCode,
opener: this.phoneOpener,
platform: Setting.platformId,
account: workNumber,
account,
schoolId,
accountId: this.curUser.id || '',
}).then(({ token }) => {

@ -269,7 +269,7 @@
<script>
import { mapState, mapActions } from 'vuex'
import util from '@/libs/util'
import Util from '@/libs/util'
export default {
data () {
return {
@ -414,6 +414,7 @@ export default {
userInfo.account = userAccount.account
userInfo.phone = userAccount.phone
userInfo.workNumber = userAccount.workNumber
userInfo.id = userAccount.id
this.form = userInfo
this.originAccount = this.form.account
this.archivesList = result.personalFileList
@ -490,7 +491,7 @@ export default {
this.$get(`${this.api.getAccount}?account=${this.form.account}`).then(res => {
if (res.data.userInfo) {
this.accountRepeat = true
util.warningMsg('该账号已存在')
Util.warningMsg('该账号已存在')
} else {
this.accountRepeat = false
}
@ -512,8 +513,9 @@ export default {
}
},
save (close) {
if (this.form.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.form.idNumber)) return util.warningMsg("请输入正确的身份证号码");
let form = this.form;
const { form } = this
if (!form.userName) return Util.warningMsg('请输入姓名')
if (form.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(form.idNumber)) return Util.warningMsg("请输入正确的身份证号码");
let personalFileList = []
this.archivesList.forEach((n, k) => {
n.personalCareerId && personalFileList.push({
@ -534,11 +536,6 @@ export default {
})
let data = {
userId: form.userId,
userAccountList: [{
id: form.accountId,
account: form.account,
userId: form.userId,
}],
hrUserInfo: {
provinceId: form.provinceId,
cityId: form.cityId,
@ -552,6 +549,10 @@ export default {
userName: form.userName,
wechatId: form.wechatId
},
userAccount: {
workNumber: form.workNumber,
id: form.id
},
personalFileList,
}
this.$post(this.api.updatePersonCenter, data).then(res => {
@ -585,7 +586,7 @@ export default {
this.archivesList.forEach((n, k) => {
if (!n.personalCareerId) isEmpty = true
})
if (isEmpty) return util.warningMsg('请选择职业')
if (isEmpty) return Util.warningMsg('请选择职业')
this.showArch = true
this.concatArch()
},
@ -621,17 +622,17 @@ export default {
this.passwordVisible = true
},
editPassword () {
if (!this.passwordForm.password) return util.warningMsg('请输入原密码')
if (!this.passwordForm.newPassword) return util.warningMsg('请输入新密码')
if (!this.passwordForm.reNewPassword) return util.warningMsg('请确认新密码')
if (this.passwordForm.newPassword.length < 6 || this.passwordForm.reNewPassword.length < 6) return util.warningMsg('请输入6位数以上的密码')
if (this.passwordForm.newPassword !== this.passwordForm.reNewPassword) return util.warningMsg('输入的新密码不一致,请重新确认')
if (this.passwordForm.password === this.passwordForm.newPassword) return util.warningMsg('原密码跟新密码不能一致')
if (!this.passwordForm.password) return Util.warningMsg('请输入原密码')
if (!this.passwordForm.newPassword) return Util.warningMsg('请输入新密码')
if (!this.passwordForm.reNewPassword) return Util.warningMsg('请确认新密码')
if (this.passwordForm.newPassword.length < 6 || this.passwordForm.reNewPassword.length < 6) return Util.warningMsg('请输入6位数以上的密码')
if (this.passwordForm.newPassword !== this.passwordForm.reNewPassword) return Util.warningMsg('输入的新密码不一致,请重新确认')
if (this.passwordForm.password === this.passwordForm.newPassword) return Util.warningMsg('原密码跟新密码不能一致')
let data = this.passwordForm
data.accountId = this.form.id
this.$post(this.api.examinePassword, data).then(res => {
util.successMsg('更换成功')
Util.successMsg('更换成功')
this.passwordVisible = false
}).catch(err => { })
},
@ -807,8 +808,8 @@ export default {
this.emailCode = ''
},
sendEmailCode () {
if (!this.email) return util.warningMsg('请输入邮箱')
if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(this.email)) return util.warningMsg('请输入正确的邮箱')
if (!this.email) return Util.warningMsg('请输入邮箱')
if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(this.email)) return Util.warningMsg('请输入正确的邮箱')
let data = {
userId: this.form.userId,
email: this.email,
@ -819,14 +820,14 @@ export default {
this.emailCountdown()
this.emailOpener = res.message.opener
} else {
util.errorMsg(res.message)
Util.errorMsg(res.message)
}
}).catch(res => { })
},
emailSubmit () {
if (!this.email) return util.warningMsg('请输入邮箱')
if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(this.email)) return util.warningMsg('请输入正确的邮箱')
if (!this.emailCode) return util.warningMsg('请输入验证码')
if (!this.email) return Util.warningMsg('请输入邮箱')
if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(this.email)) return Util.warningMsg('请输入正确的邮箱')
if (!this.emailCode) return Util.warningMsg('请输入验证码')
let data = {
userId: this.form.userId,
email: this.email,
@ -835,7 +836,7 @@ export default {
opener: this.emailOpener
}
this.$post(this.api.bindPhoneOrEmail, data).then(res => {
util.successMsg('绑定成功')
Util.successMsg('绑定成功')
this.form.email = this.email
this.emailVisible = false
}).catch(res => { })
@ -844,8 +845,8 @@ export default {
this.phoneCode = ''
},
sendPhoneCode () {
if (!this.phone) return util.warningMsg('请输入手机号')
if (!/^1[3456789]\d{9}$/.test(this.phone)) return util.warningMsg('请输入正确的手机号')
if (!this.phone) return Util.warningMsg('请输入手机号')
if (!/^1[3456789]\d{9}$/.test(this.phone)) return Util.warningMsg('请输入正确的手机号')
let data = {
userId: this.form.userId,
phone: this.phone,
@ -856,15 +857,15 @@ export default {
this.phoneCountdown()
this.phoneOpener = res.message.opener
} else {
util.errorMsg(res.message)
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('请输入验证码')
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 = {
userId: this.form.userId,
phone: this.phone,
@ -873,7 +874,7 @@ export default {
opener: this.phoneOpener
}
this.$post(this.api.bindPhoneOrEmail, data).then(res => {
util.successMsg('绑定成功')
Util.successMsg('绑定成功')
this.form.phone = this.phone
this.phoneVisible = false
}).catch(res => { })
@ -887,7 +888,7 @@ export default {
this.form.account = this.account
this.accountVisible = false
} else {
util.errorMsg('请输入账号')
Util.errorMsg('请输入账号')
}
}
}

Loading…
Cancel
Save