|
|
@ -68,19 +68,29 @@ |
|
|
|
<el-input type="password" v-model="regForm.password" placeholder="请输入密码"></el-input> |
|
|
|
<el-input type="password" v-model="regForm.password" placeholder="请输入密码"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="rePassword"> |
|
|
|
<el-form-item prop="rePassword"> |
|
|
|
<el-input type="password" v-model="regForm.rePassword" placeholder="请再次输入密码" @keyup.enter.native="registerForm"></el-input> |
|
|
|
<el-input type="password" v-model="regForm.rePassword" placeholder="请再次输入密码"></el-input> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="line"> |
|
|
|
|
|
|
|
<el-form-item> |
|
|
|
|
|
|
|
<p class="label">*验证码</p> |
|
|
|
|
|
|
|
<el-input v-model="regForm.validateCode" placeholder="请输入验证码" @keyup.enter.native="registerForm"></el-input> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item> |
|
|
|
|
|
|
|
<img :src="verifyCode" style="cursor: pointer;" @click="getVerificationCode" title="看不清?换一张" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<el-button class="submit" type="primary" @click="registerForm">注册</el-button> |
|
|
|
<el-button class="submit" type="primary" @click="registerForm">注册</el-button> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
|
|
|
|
import axios from 'axios'; |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data: function() { |
|
|
|
data: function() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
|
|
|
|
verifyCode:'', |
|
|
|
regForm: { |
|
|
|
regForm: { |
|
|
|
userName: '', |
|
|
|
userName: '', |
|
|
|
workNumber: '', |
|
|
|
workNumber: '', |
|
|
@ -91,7 +101,8 @@ export default { |
|
|
|
password: '', |
|
|
|
password: '', |
|
|
|
rePassword: '', |
|
|
|
rePassword: '', |
|
|
|
roleId: 4, |
|
|
|
roleId: 4, |
|
|
|
schoolId: 2105 |
|
|
|
schoolId: 2105, |
|
|
|
|
|
|
|
validateCode:'' |
|
|
|
}, |
|
|
|
}, |
|
|
|
regRules: { |
|
|
|
regRules: { |
|
|
|
userName: [{ required: true, message: '请输入学生姓名', trigger: 'blur' }], |
|
|
|
userName: [{ required: true, message: '请输入学生姓名', trigger: 'blur' }], |
|
|
@ -122,8 +133,27 @@ export default { |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
this.getProvince() |
|
|
|
this.getProvince() |
|
|
|
this.getSchoolData() |
|
|
|
this.getSchoolData() |
|
|
|
|
|
|
|
this.getVerificationCode() |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
//获取图形验证码 |
|
|
|
|
|
|
|
getVerificationCode(){ |
|
|
|
|
|
|
|
// this.$get(this.api.getValidateCode) |
|
|
|
|
|
|
|
axios({ |
|
|
|
|
|
|
|
url:this.api.getValidateCode, |
|
|
|
|
|
|
|
methods:'get', |
|
|
|
|
|
|
|
headers: { |
|
|
|
|
|
|
|
"Content-Type": "application/json", |
|
|
|
|
|
|
|
"EngineCode": "j371gy1q1ioeveq2y05l4gjz3", |
|
|
|
|
|
|
|
"EngineSecret": "IgMlZo+KOs8FthII3KnobUoynILH5ELJVqcHNZcs1G2mwrkofR1THw==" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
responseType: 'arraybuffer', |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.then(res => { |
|
|
|
|
|
|
|
const bufferUrl = btoa(new Uint8Array(res.data).reduce((data, byte) => data + String.fromCharCode(byte), '')); |
|
|
|
|
|
|
|
this.verifyCode = 'data:image/png;base64,' + bufferUrl; |
|
|
|
|
|
|
|
}).catch(res => {}); |
|
|
|
|
|
|
|
}, |
|
|
|
getProvince(){ |
|
|
|
getProvince(){ |
|
|
|
this.$get(this.api.queryProvince).then(res => { |
|
|
|
this.$get(this.api.queryProvince).then(res => { |
|
|
|
this.provinceList = res.message |
|
|
|
this.provinceList = res.message |
|
|
@ -155,12 +185,14 @@ export default { |
|
|
|
let data = this.regForm |
|
|
|
let data = this.regForm |
|
|
|
data.account = data.phone |
|
|
|
data.account = data.phone |
|
|
|
data.uniqueIdentificationAccount = new Date().getTime() |
|
|
|
data.uniqueIdentificationAccount = new Date().getTime() |
|
|
|
this.$post(`${this.api.save}?workNumber=${this.regForm.workNumber}`,data).then(res => { |
|
|
|
this.$post(`${this.api.save}?workNumber=${this.regForm.workNumber}&validateCode=${this.regForm.validateCode}`,data).then(res => { |
|
|
|
this.$message.success('注册成功') |
|
|
|
this.$message.success('注册成功') |
|
|
|
this.$emit('update:isReg',false) |
|
|
|
this.$emit('update:isReg',false) |
|
|
|
this.$emit('updateInfo',{username: this.regForm.phone,password: this.regForm.password}) |
|
|
|
this.$emit('updateInfo',{username: this.regForm.phone,password: this.regForm.password}) |
|
|
|
this.$refs.reg.resetFields() |
|
|
|
this.$refs.reg.resetFields() |
|
|
|
}).catch(res => {}); |
|
|
|
}).catch(res => { |
|
|
|
|
|
|
|
// this.$message.error(res) |
|
|
|
|
|
|
|
}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// this.$message.error('请输入账号和密码'); |
|
|
|
// this.$message.error('请输入账号和密码'); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|