master
yujialong 1 month ago
parent b408562376
commit 3ba5746381
  1. 1
      src/api/index.js
  2. 3
      src/layouts/navbar/index.vue
  3. 46
      src/pages/account/login/index.vue
  4. 23
      src/pages/allocationReview/records/people.vue
  5. 10
      src/pages/expert/list/index.vue
  6. 38
      src/pages/setting/list/index.vue

@ -4,6 +4,7 @@ const { apiBaseURL: host } = Setting
export default { export default {
login: `/users/users/user/login`, login: `/users/users/user/login`,
verification: `${host}/users/users/user/captcha`, verification: `${host}/users/users/user/captcha`,
getToken: `/users/users/user/getToken`,
sendPhoneVerificationCode: `/users/users/user/sendPhoneVerificationCode`, sendPhoneVerificationCode: `/users/users/user/sendPhoneVerificationCode`,
forgotPassword: `/users/users/user/forgotPassword`, forgotPassword: `/users/users/user/forgotPassword`,
forgotPreVerification: `/users/users/user/forgotPreVerification`, forgotPreVerification: `/users/users/user/forgotPreVerification`,

@ -70,6 +70,8 @@ export default {
this.active = '/myReview' this.active = '/myReview'
} else if (path.includes('allocationReview/')) { } else if (path.includes('allocationReview/')) {
this.active = '/allocationReview' this.active = '/allocationReview'
} else {
this.active = '/expert'
} }
}, },
mounted () { mounted () {
@ -89,7 +91,6 @@ export default {
// store // store
if (Setting.dynamicRoute) { if (Setting.dynamicRoute) {
const { btns, defaultMenus: all } = this const { btns, defaultMenus: all } = this
console.log("🚀 ~ initMenu ~ btns:", btns)
const menus = [all[0]] const menus = [all[0]]
btns.find(e => e === '分配评阅任务') && menus.push(all[1]) btns.find(e => e === '分配评阅任务') && menus.push(all[1])
btns.find(e => e === '专家管理') && menus.push(all[2]) btns.find(e => e === '专家管理') && menus.push(all[2])

@ -201,20 +201,36 @@ export default {
// //
submit () { submit () {
if (!this.agreeCheck) return Util.errorMsg('请勾选同意,才可继续登录!') if (!this.agreeCheck) return Util.errorMsg('请勾选同意,才可继续登录!')
this.$refs.form.validate(valid => { this.$refs.form.validate(async (valid) => {
if (valid) { if (valid) {
const form = JSON.parse(JSON.stringify(this.form)) const { form } = this
this.$post(this.api.login, form).then(({ status, data, message }) => { form.distinguish = this.active ? 2 : 1
try {
const { status, data } = await this.$post(this.api.login, form)
let { userAccounts: accounts, token } = data
if (status == 200) { if (status == 200) {
localStorage.setItem('expert_token', data.token) //
if (accounts && accounts.length) {
const expert = accounts.find(e => e.isExpert) //
if (expert && expert.isEnable) {
const res = await this.$post(`${this.api.getToken}?id=${expert.id}&platform=${this.platform}`)
if (res.data) token = res.data.token
} else {
return Util.errorMsg('请输入专家账号')
}
} else if (!data.isExpert) {
form.code = ''
return Util.errorMsg('专家评阅平台只允许专家账号登录,请重新输入')
}
localStorage.setItem('expert_token', token)
Util.successMsg('登录成功') Util.successMsg('登录成功')
this.$router.replace(`/myReview`) this.$router.replace(`/myReview`)
} }
}).catch(res => { } catch (e) {
form.code = '' form.code = ''
this.getVerImg() this.getVerImg()
}) }
} }
}); });
}, },
@ -366,21 +382,10 @@ export default {
.agree { .agree {
width: 500px; width: 500px;
height: 450px;
padding-bottom: 20px; padding-bottom: 20px;
background-color: #062c87; background-color: #fff;
/deep/.el-checkbox {
color: #fff;
.el-checkbox__label {
color: #fff;
}
.el-checkbox__input.is-checked .el-checkbox__inner {
background-color: #cd4c01;
border-color: #cd4c01;
}
}
} }
.agreement { .agreement {
@ -392,11 +397,9 @@ export default {
margin-bottom: 10px; margin-bottom: 10px;
font-size: 20px; font-size: 20px;
font-weight: 600; font-weight: 600;
color: #fff;
} }
.text { .text {
color: #fff;
line-height: 1.6; line-height: 1.6;
} }
@ -439,6 +442,7 @@ export default {
.form { .form {
width: 436px; width: 436px;
height: 450px;
padding: 20px 38px 50px; padding: 20px 38px 50px;
border-radius: 6px; border-radius: 6px;
background-color: #fff; background-color: #fff;

@ -167,9 +167,14 @@ export default {
}) })
}, },
// //
userTypeChange () { userTypeChange (val) {
const el = this.$refs.nakadais const el = this.$refs.nakadais
el && el.setCurrentKey(null) el && el.setCurrentKey(null)
if (val) {
this.getExpert()
} else {
this.getNakadaiUser()
}
}, },
// //
depClick (data) { depClick (data) {
@ -194,6 +199,22 @@ export default {
this.users = list this.users = list
this.getDetail(init) this.getDetail(init)
}, },
//
getExpert () {
this.$post(this.api.expertList, {
type: 1,
pageNum: 1,
pageSize: 1000
}).then(({ page }) => {
const list = page.records
const { checked } = this
list.forEach(e => {
e.check = !!checked.find(n => n.accountId === e.accountId)
})
this.users = list
this.getDetail(1)
}).catch(err => { })
},
// //
userAllCheckChange (val) { userAllCheckChange (val) {

@ -97,7 +97,7 @@
<script> <script>
import Util from '@/libs/util' import Util from '@/libs/util'
import Setting from '@/setting' import Setting from '@/setting'
// import clipboard from '@/libs/clipboard' import clipboard from '@/libs/clipboard'
export default { export default {
data () { data () {
const phonePass = (rule, value, callback) => { const phonePass = (rule, value, callback) => {
@ -215,11 +215,7 @@ export default {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize pageSize: this.pageSize
}).then(({ page }) => { }).then(({ page }) => {
const list = page.records this.list = page.records
// list.map(e => {
// e.cryptoPhone =
// })
this.list = list
this.total = page.total this.total = page.total
}).catch(err => { }) }).catch(err => { })
}, },
@ -296,7 +292,7 @@ export default {
}, },
// //
copy (e) { copy (e) {
// clipboard(this.link, e, '') clipboard('http://121.37.12.51/reviewCenter', e, '链接已复制!')
}, },
// / // /
async queryExpert (row, isDetail) { async queryExpert (row, isDetail) {

@ -60,7 +60,7 @@
</el-form> </el-form>
</div> </div>
<div class="btns"> <div class="btns">
<el-button size="small" @click="$emit('back')">取消</el-button> <el-button size="small" @click="$router.back()">取消</el-button>
<el-button type="primary" size="small" @click="submit">更新</el-button> <el-button type="primary" size="small" @click="submit">更新</el-button>
</div> </div>
</div> </div>
@ -84,10 +84,14 @@
</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="30%"> @close="closePhone" 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="diaPhoneItem">
<el-input style="width: 404px;" placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input> <el-input placeholder="请输入新手机号" v-model="phone" maxlength="11" @input="checkAccountByPhone">
<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">
@ -150,6 +154,7 @@ export default {
editUsername: '', editUsername: '',
accountVisible: false, accountVisible: false,
updateTime: 0, updateTime: 0,
phoneReg: /^1[3456789]\d{9}$/,
form: { form: {
accountId: '', accountId: '',
userName: '', userName: '',
@ -225,6 +230,8 @@ export default {
phoneCode: "", phoneCode: "",
phoneDisabled: false, phoneDisabled: false,
phoneTimer: null, phoneTimer: null,
diaClientExist: false,
diaClientMsg: '',
emailOpener: "", emailOpener: "",
phoneOpener: "", phoneOpener: "",
originAccount: "", originAccount: "",
@ -397,8 +404,24 @@ export default {
}, },
closePhone () { closePhone () {
if (!this.emailDisabled) { if (!this.emailDisabled) {
this.emailCode = ""; this.emailCode = ''
}
},
// type01
async checkAccountByPhone (val) {
if (!this.phoneReg.test(val)) {
this.$refs.diaPhoneItem.clearValidate()
this.diaClientMsg = '请输入正确的手机号'
this.diaClientExist = false
return false
} }
try {
const { message } = await this.$get(`${this.api.forgotPreVerification}?phoneOrEmail=${val}&platform=4`)
const exist = message !== 'success' //
this.diaClientExist = exist
this.diaClientMsg = exist ? '' : '该手机号已注册!'
} catch (e) { }
}, },
sendPhoneCode () { sendPhoneCode () {
if (!this.phone) return Util.warningMsg("请输入手机号"); if (!this.phone) return Util.warningMsg("请输入手机号");
@ -475,4 +498,9 @@ export default {
width: 80px; width: 80px;
} }
} }
.correct-icon {
width: 30px;
margin-top: -5px;
}
</style> </style>
Loading…
Cancel
Save