yujialong 1 month ago
parent 3ba5746381
commit d857e59090
  1. 48
      src/pages/account/login/index.vue
  2. 21
      src/pages/allocationReview/records/people.vue
  3. 4
      src/pages/expert/list/index.vue
  4. 103
      src/pages/setting/list/index.vue
  5. 2
      src/setting.js

@ -9,7 +9,7 @@
<el-form :model="form" :rules="rules" ref="form" style="margin-top: 20px"> <el-form :model="form" :rules="rules" ref="form" style="margin-top: 20px">
<el-form-item prop="account" ref="phoneItem"> <el-form-item prop="account" ref="phoneItem">
<label class="label account"></label> <label class="label account"></label>
<el-input v-model.trim="form.account" placeholder="请输入手机号" @input="val => checkAccountByPhone(val, 0)" <el-input v-model.trim="form.account" placeholder="请输入手机号/邮箱" @input="val => checkAccountByPhone(val, 0)"
@keyup.enter.native="submit"> @keyup.enter.native="submit">
<img v-if="verFormEnable" slot="suffix" class="correct-icon" src="@/assets/images/login/correct.svg" <img v-if="verFormEnable" slot="suffix" class="correct-icon" src="@/assets/images/login/correct.svg"
alt=""> alt="">
@ -119,18 +119,17 @@ export default {
phoneReg: /^1[3456789]\d{9}$/, phoneReg: /^1[3456789]\d{9}$/,
mailReg: /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/, mailReg: /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/,
verificationIMG: '', verificationIMG: '',
platform: 4,
form: { form: {
workNumber: '', workNumber: '',
account: '', // account: '', //
password: '', password: '',
code: '', // code: '', //
random: '', // random: '', //
platform: 4, platform: Setting.platformId,
distinguish: 1, distinguish: 1,
}, },
rules: { rules: {
account: [{ required: true, message: "请输入手机号", trigger: "blur" }], account: [{ required: true, message: "请输入手机号/邮箱", trigger: "blur" }],
password: [{ required: true, message: "请输入密码", trigger: "blur" }], password: [{ required: true, message: "请输入密码", trigger: "blur" }],
code: [{ required: true, message: "请输入验证码", trigger: "blur" }] code: [{ required: true, message: "请输入验证码", trigger: "blur" }]
}, },
@ -213,7 +212,7 @@ export default {
if (accounts && accounts.length) { if (accounts && accounts.length) {
const expert = accounts.find(e => e.isExpert) // const expert = accounts.find(e => e.isExpert) //
if (expert && expert.isEnable) { if (expert && expert.isEnable) {
const res = await this.$post(`${this.api.getToken}?id=${expert.id}&platform=${this.platform}`) const res = await this.$post(`${this.api.getToken}?id=${expert.id}&platform=${Setting.platformId}`)
if (res.data) token = res.data.token if (res.data) token = res.data.token
} else { } else {
return Util.errorMsg('请输入专家账号') return Util.errorMsg('请输入专家账号')
@ -237,7 +236,7 @@ export default {
// //
verifyPhone (phone) { verifyPhone (phone) {
if (!phone) { if (!phone) {
this.$message.error("请输入手机号") this.$message.error("请输入手机号/邮箱")
return false return false
} }
if (!this.phoneReg.test(phone) && !this.mailReg.test(phone)) { if (!this.phoneReg.test(phone) && !this.mailReg.test(phone)) {
@ -264,7 +263,7 @@ export default {
async sendCodePw () { async sendCodePw () {
const { phoneOrEmail } = this.pwForm const { phoneOrEmail } = this.pwForm
if (!this.verifyPhone(phoneOrEmail)) return false if (!this.verifyPhone(phoneOrEmail)) return false
const { message } = await this.$post(`${this.api.sendPhoneVerificationCode}?phoneOrEmail=${phoneOrEmail}&loginOrBind=1&platform=${this.platform}`) const { message } = await this.$post(`${this.api.sendPhoneVerificationCode}?phoneOrEmail=${phoneOrEmail}&loginOrBind=1&platform=${Setting.platformId}`)
Util.successMsg(message) Util.successMsg(message)
this.phoneCountdown() this.phoneCountdown()
}, },
@ -274,7 +273,7 @@ export default {
if (valid) { if (valid) {
const form = this.pwForm const form = this.pwForm
if (form.password !== form.rePassword) return Util.errorMsg('两次输入的密码不一致,请重新输入!') if (form.password !== form.rePassword) return Util.errorMsg('两次输入的密码不一致,请重新输入!')
form.platform = this.platform form.platform = Setting.platformId
this.$post(this.api.forgotPassword, form).then(res => { this.$post(this.api.forgotPassword, form).then(res => {
this.resetPwVisible = false this.resetPwVisible = false
Util.successMsg('密码重置成功!请重新登录。') Util.successMsg('密码重置成功!请重新登录。')
@ -285,21 +284,26 @@ export default {
// type01 // type01
async checkAccountByPhone (val, type) { async checkAccountByPhone (val, type) {
if (!this.phoneReg.test(val) && !this.mailReg.test(val)) { if (val) {
this.$refs[type ? 'diaPhoneItem' : 'phoneItem'].clearValidate() if (!this.phoneReg.test(val) && !this.mailReg.test(val)) {
this.diaClientMsg = '请输入正确的手机号' this.$refs[type ? 'diaPhoneItem' : 'phoneItem'].clearValidate()
this[type ? 'diaClientExist' : 'verFormEnable'] = false this.diaClientMsg = '请输入正确的手机号/邮箱'
return false this[type ? 'diaClientExist' : 'verFormEnable'] = false
} return false
}
try { try {
const { message } = await this.$get(`${this.api.forgotPreVerification}?phoneOrEmail=${val}&platform=${this.platform}`) const { message } = await this.$get(`${this.api.forgotPreVerification}?phoneOrEmail=${val}&platform=${Setting.platformId}`)
const exist = message === 'success' // const exist = message === 'success' //
this[type ? 'diaClientExist' : 'verFormEnable'] = exist this[type ? 'diaClientExist' : 'verFormEnable'] = exist
this.diaClientMsg = exist ? '' : message this.diaClientMsg = exist ? '' : message
} catch (e) { } catch (e) {
this[type ? 'diaClientExist' : 'verFormEnable'] = false
this.diaClientMsg = e.message
}
} else {
this.diaClientMsg = ''
this[type ? 'diaClientExist' : 'verFormEnable'] = false this[type ? 'diaClientExist' : 'verFormEnable'] = false
this.diaClientMsg = e.message
} }
}, },
@ -325,7 +329,7 @@ export default {
sendPhoneCodeLogin () { sendPhoneCodeLogin () {
const phone = this.form.account const phone = this.form.account
if (!this.verifyPhone(phone)) return false if (!this.verifyPhone(phone)) return false
this.$post(`${this.api.sendPhoneVerificationCode}?phoneOrEmail=${phone}&loginOrBind=0&platform=${this.platform}`).then(({ message }) => { this.$post(`${this.api.sendPhoneVerificationCode}?phoneOrEmail=${phone}&loginOrBind=0&platform=${Setting.platformId}`).then(({ message }) => {
Util.successMsg(message) Util.successMsg(message)
this.phoneCountdownLogin() this.phoneCountdownLogin()
}).catch(res => { }) }).catch(res => { })

@ -27,16 +27,16 @@
<template v-if="users.length"> <template v-if="users.length">
<div class="line"> <div class="line">
<el-checkbox v-model="userCheck" @change="userAllCheckChange"></el-checkbox> <el-checkbox v-model="userCheck" @change="userAllCheckChange"></el-checkbox>
<span class="username">姓名</span> <span :class="['username', { isExpert: userType }]">姓名</span>
<!-- <span>现所在单位</span> <span v-if="userType">现所在单位</span>
<span>职务</span> -->
</div> </div>
<div class="lines"> <div class="lines">
<div v-for="(item, i) in users" :key="i" class="line"> <div v-for="(item, i) in users" :key="i" class="line">
<el-checkbox v-model="item.check" :disabled="item.disabled" <el-checkbox v-model="item.check" :disabled="item.disabled"
@change="val => userChange(val, item)"></el-checkbox> @change="val => userChange(val, item)"></el-checkbox>
<p class="username" :title="item.userName">{{ item.userName }}</p> <p :class="['username', { isExpert: userType }]" :title="item.userName">{{ item.userName }}</p>
<p v-if="userType" :title="item.currentUnit">{{ item.currentUnit }}</p>
</div> </div>
</div> </div>
</template> </template>
@ -57,15 +57,18 @@
<template v-if="checked.length"> <template v-if="checked.length">
<div class="line"> <div class="line">
<el-checkbox v-model="checkedAllCheck" @change="checkedAllCheckChange"></el-checkbox> <el-checkbox v-model="checkedAllCheck" @change="checkedAllCheckChange"></el-checkbox>
<span class="username">姓名</span> <span class="username isExpert">姓名</span>
<span>现所在单位</span>
</div> </div>
<div class="lines"> <div class="lines">
<template v-for="(item, i) in checked"> <template v-for="(item, i) in checked">
<div v-if="item.userName.includes(checkedKeyword)" :key="i" class="line"> <div v-if="item.userName.includes(checkedKeyword) || item.currentUnit.includes(checkedKeyword)" :key="i"
class="line">
<div class="check-left"> <div class="check-left">
<el-checkbox v-model="item.check"></el-checkbox> <el-checkbox v-model="item.check"></el-checkbox>
<p class="username" :title="item.userName">{{ item.userName }}</p> <p class="username isExpert" :title="item.userName">{{ item.userName }}</p>
<p v-if="item.currentUnit" :title="item.currentUnit">{{ item.currentUnit }}</p>
</div> </div>
<i class="el-icon-delete action-icon" @click="delChecked(item)"></i> <i class="el-icon-delete action-icon" @click="delChecked(item)"></i>
</div> </div>
@ -387,6 +390,10 @@ export default {
.username { .username {
margin: 0 12px; margin: 0 12px;
&.isExpert {
width: 120px;
}
} }
} }

@ -51,9 +51,9 @@
<el-form-item prop="phone" label="手机号"> <el-form-item prop="phone" label="手机号">
<el-input v-model.trim="form.phone" placeholder="请输入手机号" maxlength="11"></el-input> <el-input v-model.trim="form.phone" placeholder="请输入手机号" maxlength="11"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password" label="登录密码"> <!-- <el-form-item prop="password" label="登录密码">
<el-input type="password" v-model.trim="form.password" placeholder="为空则默认密码:手机号码后六位" show-password></el-input> <el-input type="password" v-model.trim="form.password" placeholder="为空则默认密码:手机号码后六位" show-password></el-input>
</el-form-item> </el-form-item> -->
<el-form-item prop="email" label="电子邮箱"> <el-form-item prop="email" label="电子邮箱">
<el-input v-model.trim="form.email" placeholder="请输入电子邮箱"></el-input> <el-input v-model.trim="form.email" placeholder="请输入电子邮箱"></el-input>
</el-form-item> </el-form-item>

@ -28,7 +28,9 @@
<el-button type="text" size="small" @click="bindPassword">更换</el-button> <el-button type="text" size="small" @click="bindPassword">更换</el-button>
</el-form-item> </el-form-item>
<el-form-item prop="email" label="电子邮箱"> <el-form-item prop="email" label="电子邮箱">
<el-input v-model.trim="form.email" placeholder="请输入电子邮箱"></el-input> <el-input class="m-r-10" style="width: 243px;" v-model.trim="form.email" placeholder="请输入电子邮箱"
disabled></el-input>
<el-button type="text" size="small" @click="bindEmail">{{ form.email ? '更换' : '绑定' }}</el-button>
</el-form-item> </el-form-item>
<el-form-item prop="sex" label="性别"> <el-form-item prop="sex" label="性别">
<el-radio v-model="form.sex" :label="1"></el-radio> <el-radio v-model="form.sex" :label="1"></el-radio>
@ -64,17 +66,23 @@
<el-button type="primary" size="small" @click="submit">更新</el-button> <el-button type="primary" size="small" @click="submit">更新</el-button>
</div> </div>
</div> </div>
<el-dialog :title="form.email ? '更换邮箱' : '绑定邮箱'" :visible.sync="emailVisible" :close-on-click-modal="false" <el-dialog :title="form.email ? '更换邮箱' : '绑定邮箱'" :visible.sync="emailVisible" :close-on-click-modal="false"
@close="closeEmail" width="30%"> @close="closeEmail" width="400px">
<el-form ref="form" :model="form" label-width="60px"> <el-form ref="form" :model="form" label-width="60px">
<el-form-item label="邮箱"> <el-form-item label="邮箱" ref="diaEmailItem">
<el-input placeholder="请输入邮箱" v-model="email"></el-input> <el-input placeholder="请输入邮箱" v-model="email" @input="checkAccountByEmail">
<img v-if="diaClientExist" slot="suffix" class="correct-icon" src="@/assets/images/login/correct.svg"
alt="">
</el-input>
<p v-if="diaClientMsg" class="el-form-item__error">{{ diaClientMsg }}</p>
</el-form-item> </el-form-item>
<el-form-item label="验证码"> <el-form-item label="验证码">
<div class="flex-between"> <div class="flex-between">
<el-input v-model="emailCode" placeholder="请输入验证码" maxlength="6"></el-input> <el-input v-model="emailCode" placeholder="请输入验证码" maxlength="6" :disabled="!diaClientExist"></el-input>
<el-button style="margin-left: 10px" type="text" @click="sendEmailCode" :disabled="emailDisabled">{{ <el-button style="margin-left: 10px" type="text" @click="sendEmailCode"
emailBtnText }}</el-button> :disabled="emailDisabled || !diaClientExist">{{
emailBtnText }}</el-button>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -83,6 +91,7 @@
<el-button type="primary" @click="emailSubmit"> </el-button> <el-button type="primary" @click="emailSubmit"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog :title="form.phone ? '更换手机号' : '绑定手机号'" :visible.sync="phoneVisible" :close-on-click-modal="false" <el-dialog :title="form.phone ? '更换手机号' : '绑定手机号'" :visible.sync="phoneVisible" :close-on-click-modal="false"
@close="closePhone" width="400px"> @close="closePhone" width="400px">
<el-form ref="form" :model="form" label-width="60px"> <el-form ref="form" :model="form" label-width="60px">
@ -95,9 +104,10 @@
</el-form-item> </el-form-item>
<el-form-item label="验证码"> <el-form-item label="验证码">
<div class="flex-between"> <div class="flex-between">
<el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input> <el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6" :disabled="!diaClientExist"></el-input>
<el-button style="margin-left: 10px" type="text" @click="sendPhoneCode" :disabled="phoneDisabled">{{ <el-button style="margin-left: 10px" type="text" @click="sendPhoneCode"
phoneBtnText }}</el-button> :disabled="phoneDisabled || !diaClientExist">{{
phoneBtnText }}</el-button>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -106,6 +116,7 @@
<el-button type="primary" @click="phoneSubmit"> </el-button> <el-button type="primary" @click="phoneSubmit"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="更换密码" :visible.sync="pwdVisible" :close-on-click-modal="false" @close="closePassword" width="30%"> <el-dialog title="更换密码" :visible.sync="pwdVisible" :close-on-click-modal="false" @close="closePassword" width="30%">
<el-form ref="pwdForm" :model="form" label-width="60px"> <el-form ref="pwdForm" :model="form" label-width="60px">
<el-form-item label="原密码"> <el-form-item label="原密码">
@ -125,17 +136,6 @@
<el-button type="primary" @click="editPassword"> </el-button> <el-button type="primary" @click="editPassword"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="修改账号" :visible.sync="accountVisible" :close-on-click-modal="false" width="30%">
<el-form label-width="70px">
<el-form-item label="账号">
<el-input v-model="editUsername" placeholder="请输入账号"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="accountVisible = false"> </el-button>
<el-button size="small" type="primary" @click="confirmAccount"> </el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
@ -151,10 +151,9 @@ export default {
headers: { headers: {
token: localStorage.getItem('expert_token') token: localStorage.getItem('expert_token')
}, },
editUsername: '',
accountVisible: false,
updateTime: 0, updateTime: 0,
phoneReg: /^1[3456789]\d{9}$/, phoneReg: /^1[3456789]\d{9}$/,
mailReg: /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/,
form: { form: {
accountId: '', accountId: '',
userName: '', userName: '',
@ -273,26 +272,7 @@ export default {
changeAvatar (res) { changeAvatar (res) {
this.setAvatar(res.message) this.setAvatar(res.message)
}, },
//
showAccount () {
this.accountVisible = true
},
//
confirmAccount () {
if (this.editUsername) {
form.username = this.editUsername
this.accountVisible = false
const { form } = this
this.$put(this.api.user, form).then(res => {
this.setUserName(form.username)
this.$message.success("提交成功!")
}).catch(res => { })
} else {
Util.errorMsg('请输入账号')
}
},
bindEmail () { bindEmail () {
this.email = this.form.email
this.emailVisible = true this.emailVisible = true
}, },
bindPhone () { bindPhone () {
@ -367,10 +347,31 @@ export default {
} }
}, },
closeEmail () { closeEmail () {
this.email = ''
this.emailCode = ''
this.diaClientMsg = ''
this.diaClientExist = false
if (!this.emailDisabled) { if (!this.emailDisabled) {
this.emailCode = ""; this.emailCode = "";
} }
}, },
//
async checkAccountByEmail (val) {
if (!this.mailReg.test(val)) {
this.$refs.diaEmailItem.clearValidate()
this.diaClientMsg = '请输入正确的邮箱'
this.diaClientExist = false
this.emailCode = ''
return false
}
try {
const { message } = await this.$get(`${this.api.forgotPreVerification}?phoneOrEmail=${val}&platform=${Setting.platformId}`)
const exist = message !== 'success' //
this.diaClientExist = exist
this.diaClientMsg = exist ? '' : '该邮箱已注册!'
} catch (e) { }
},
sendEmailCode () { sendEmailCode () {
if (!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("请输入正确的邮箱") if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(this.email)) return Util.warningMsg("请输入正确的邮箱")
@ -390,7 +391,7 @@ export default {
if (!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("请输入正确的邮箱") 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.emailCode) return Util.warningMsg("请输入验证码")
this.$put(this.api.bindPhoneOrEmail, { this.$post(this.api.bindPhoneOrEmail, {
userId: this.userId, userId: this.userId,
email: this.email, email: this.email,
types: 1, types: 1,
@ -403,21 +404,26 @@ export default {
}).catch(res => { }) }).catch(res => { })
}, },
closePhone () { closePhone () {
if (!this.emailDisabled) { this.phone = ''
this.emailCode = '' this.phoneCode = ''
this.diaClientMsg = ''
this.diaClientExist = false
if (!this.phoneDisabled) {
this.phoneCode = ''
} }
}, },
// type01 //
async checkAccountByPhone (val) { async checkAccountByPhone (val) {
if (!this.phoneReg.test(val)) { if (!this.phoneReg.test(val)) {
this.$refs.diaPhoneItem.clearValidate() this.$refs.diaPhoneItem.clearValidate()
this.diaClientMsg = '请输入正确的手机号' this.diaClientMsg = '请输入正确的手机号'
this.diaClientExist = false this.diaClientExist = false
this.phoneCode = ''
return false return false
} }
try { try {
const { message } = await this.$get(`${this.api.forgotPreVerification}?phoneOrEmail=${val}&platform=4`) const { message } = await this.$get(`${this.api.forgotPreVerification}?phoneOrEmail=${val}&platform=${Setting.platformId}`)
const exist = message !== 'success' // const exist = message !== 'success' //
this.diaClientExist = exist this.diaClientExist = exist
this.diaClientMsg = exist ? '' : '该手机号已注册!' this.diaClientMsg = exist ? '' : '该手机号已注册!'
@ -456,8 +462,7 @@ export default {
Util.successMsg("绑定成功"); Util.successMsg("绑定成功");
this.form.phone = this.phone; this.form.phone = this.phone;
this.phoneVisible = false; this.phoneVisible = false;
}).catch(res => { }).catch(res => { })
});
} }
} }
}; };

@ -14,7 +14,7 @@ const Setting = {
/** /**
* 基础配置 * 基础配置
* */ * */
platformId: 3, platformId: 7,
titleSuffix: '专家评阅平台', // 网页标题的后缀 titleSuffix: '专家评阅平台', // 网页标题的后缀
routerMode: "hash", // 路由模式,可选值为 history 或 hash routerMode: "hash", // 路由模式,可选值为 history 或 hash
showProgressBar: true, // 页面切换时,是否显示模拟的进度条 showProgressBar: true, // 页面切换时,是否显示模拟的进度条

Loading…
Cancel
Save