邮箱判重

dev_2022-05-11
yujialong 4 years ago
parent 4a36a9d0de
commit b6a1242805
  1. 18
      src/components/page/Staff.vue
  2. 2
      src/components/page/student.vue
  3. 3
      src/utils/api.js

@ -117,7 +117,7 @@
<el-input v-model="teacherForm.phone" placeholder="请输入手机号" maxlength="11" @change="phoneChange"></el-input>
</el-form-item>
<el-form-item prop="email" label="邮箱">
<el-input v-model="teacherForm.email" placeholder="请输入邮箱"></el-input>
<el-input v-model="teacherForm.email" placeholder="请输入邮箱" @change="emailChange"></el-input>
</el-form-item>
<!-- <el-form-item prop="major" label="专业方向">
<el-select v-model="teacherForm.major" placeholder="请选择专业方向">
@ -288,6 +288,7 @@ export default {
ProfessionalList: [],
NoAdd: '',
AccountNoAdd: '',
emailNoAdd: '',
managerNumberNoAdd: true,
teacherNumberNoAdd: true,
studentNumberNoAdd: true,
@ -520,6 +521,15 @@ export default {
this.NoAdd = true
}
},
async emailChange(){
let res = await this.$get(this.api.queryEmail, { email: this.teacherForm.email });
if(res.message.length != 0){
this.$message.warning('该邮箱已存在');
this.emailNoAdd = false
}else{
this.emailNoAdd = true
}
},
async accountChange(){
let res = await this.$get(this.api.queryAccountIsExist, {
account: this.encodeString(this.teacherForm.userAccount),
@ -626,7 +636,11 @@ export default {
if(this.NoAdd == '' && this.teacherForm.phone){
this.phoneChange()
if(!this.NoAdd) return false
}else if(this.NoAdd === false) return this.$message.warning('该手机号已存在');
}else if(this.NoAdd === false){
return this.$message.warning('该手机号已存在')
}else if(this.emailNoAdd === false){
return this.$message.warning('该邮箱已存在')
}
}
if(!this.managerNumberNoAdd) return this.$message.warning('该管理员工号已存在');
if(!this.teacherNumberNoAdd) return this.$message.warning('该老师工号已存在');

@ -92,7 +92,7 @@
<el-input v-model="form.email" placeholder="可用于登录平台,以及找回密码"></el-input>
</el-form-item>
<el-form-item prop="schoolId" label="所在院校">
<el-select v-model="form.schoolId" placeholder="默认为当前院校(可修改)" filterable disabled>
<el-select v-model="form.schoolId" placeholder="默认为当前院校(可修改)" filterable disabled @change="worknumberChange">
<el-option v-for="(item,index) in schoolList" :key="index" :label="item.schoolName" :value="item.schoolId"></el-option>
</el-select>
</el-form-item>

@ -6,7 +6,7 @@ let host = ''
let host1 = 'http://39.108.250.202:8080'
// let loginhost = 'http://www.liuwanr.cn'
let uploadURL = 'http://8.134.8.197:8001'
if(location.host.includes('liuwanr.cn')){
if(location.host.includes('liuwanr.cn') || process.env.NODE_ENV === 'development'){
host = 'http://www.liuwanr.cn'
}else{
host = 'http://www.occupationlab.com'
@ -40,6 +40,7 @@ export default {
queryCourseProfessionalClass: `${host}/liuwanr/course/queryCourseProfessionalClass`, //查询专业类
queryCourseProfessional: `${host}/liuwanr/course/queryCourseProfessional`, //查询专业
queryPhone: `${host}/liuwanr/user/queryPhone`, //查询电话是否存在
queryEmail: `${host}/liuwanr/user/queryEmail`, //查询邮箱是否存在
queryStaffPAN:`${host}/liuwanr/staffProfessionalArchitecture/queryStaffPAN`,//查询员工专业是否存在
// 个人中心

Loading…
Cancel
Save