flx:修改登录、短信验证
This commit is contained in:
parent
d38f0b6325
commit
8654d17dec
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* api接口统一管理
|
||||
*/
|
||||
import {post,get} from '../http'
|
||||
import { post, get } from '../http'
|
||||
|
||||
export const registerApi = data => post('xmgl/base/register', data); //注册
|
||||
export const newRegisterApi = data => post('xmgl/xzRegistry/add', data); //注册
|
||||
@ -12,6 +12,7 @@ export const loginApiMD5 = (data) => post("xmgl/base/md5/login", data); //账号
|
||||
export const companyLoginApi = data => post('xmgl/base/companyLogin', data); //企业账号密码登录
|
||||
export const projectLoginApi = data => post('xmgl/base/projectLogin', data); //项目账号密码登录
|
||||
export const getSmsRegCodeApi = data => post('xmgl/base/getRegisterVerificationCode', data); //获取注册短信验证码
|
||||
export const getRegisterVerificationCodeApi = data => post('xmgl/base/code/getRegisterVerificationCode', data); // 获取注册短信验证码(带验证码)
|
||||
|
||||
|
||||
export const getOneComputerAuthApi = data => get('xmgl/computerAuth/getOneComputerAuth', data); //查询服务器认证信息
|
||||
@ -50,3 +51,7 @@ export const getGroupListByCompanyApi = data => post('xmgl/company/getMyHeadquar
|
||||
|
||||
|
||||
export const jumpLargeUserInfoApi = data => post('xmgl/base/getLoginInfoByToken', data, { headers: { "Content-Type": "application/json" } }); //通过token 做无码登录
|
||||
// 获取登录的图片验证码
|
||||
export const getImgCodeLoginApi = data => get('xmgl/base/login/captcha', data);
|
||||
// 账号密码登录(带验证码)
|
||||
export const verifyLoginApi = data => post('xmgl/base/verify/login', data);
|
||||
@ -6,73 +6,103 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {checkPhone} from '@/assets/js/util.js'
|
||||
// changePhoneIsRegist
|
||||
import {getSmsRegCodeApi} from '@/assets/js/api/loginSign'
|
||||
|
||||
export default {
|
||||
props: ['phone', 'type'],
|
||||
data() {
|
||||
return {
|
||||
sendSuccess: false, //true验证码发送 false验证码未发送
|
||||
time: 60 //时间
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//定时器
|
||||
finish() {
|
||||
//禁用以下表单
|
||||
this.sendSuccess = true;
|
||||
//进行倒计时提示
|
||||
let Time = setInterval(() => {
|
||||
if (this.time <= 1) {
|
||||
//当时间小于等于一的时候清除定时器
|
||||
//初始化一下数据参数
|
||||
clearInterval(Time);
|
||||
this.sendSuccess = false;
|
||||
this.time = 60;
|
||||
} else {
|
||||
this.time--;
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
//发送验证码请求
|
||||
sendClick() {
|
||||
|
||||
if (checkPhone(this.phone)) {
|
||||
window._paq.push(['trackEvent', '点击', '获取','获取短信验证码'])
|
||||
// changePhoneIsRegist({phone:this.phone}).then((res) => {
|
||||
// this.canuse = res.canuse
|
||||
// if(res.canuse){
|
||||
//调用定时器
|
||||
this.finish();
|
||||
//发送请求
|
||||
console.log(this.phone)
|
||||
getSmsRegCodeApi({phone: this.phone}).then(res => {
|
||||
// if(res.STATUS=="1"){
|
||||
this.$message.success(this.$t('message.sign.verificationSendSuccess'));//验证码发送成功
|
||||
this.$emit('getCode', res.VerificationCode)
|
||||
// }else{
|
||||
// this.$message.error('验证码发送失败');
|
||||
// }
|
||||
})
|
||||
// }else{
|
||||
// this.$message.error('新手机号不可用')
|
||||
// }
|
||||
// })
|
||||
|
||||
} else {
|
||||
this.$message.error(this.$t('message.sign.verificationSendError'));//发送失败,手机号码格式不正确
|
||||
}
|
||||
|
||||
}
|
||||
import { checkPhone } from "@/assets/js/util.js";
|
||||
// changePhoneIsRegist
|
||||
import {
|
||||
getSmsRegCodeApi,
|
||||
getRegisterVerificationCodeApi,
|
||||
} from "@/assets/js/api/loginSign";
|
||||
import axios from "axios";
|
||||
export default {
|
||||
props: ["phone", "captchaId", "imgCode", "type"],
|
||||
data() {
|
||||
return {
|
||||
sendSuccess: false, //true验证码发送 false验证码未发送
|
||||
time: 60, //时间
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//定时器
|
||||
finish() {
|
||||
//禁用以下表单
|
||||
this.sendSuccess = true;
|
||||
//进行倒计时提示
|
||||
let Time = setInterval(() => {
|
||||
if (this.time <= 1) {
|
||||
//当时间小于等于一的时候清除定时器
|
||||
//初始化一下数据参数
|
||||
clearInterval(Time);
|
||||
this.sendSuccess = false;
|
||||
this.time = 60;
|
||||
} else {
|
||||
this.time--;
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
//发送验证码请求
|
||||
sendClick() {
|
||||
if (checkPhone(this.phone)) {
|
||||
window._paq.push(["trackEvent", "点击", "获取", "获取短信验证码"]);
|
||||
// changePhoneIsRegist({phone:this.phone}).then((res) => {
|
||||
// this.canuse = res.canuse
|
||||
// if(res.canuse){
|
||||
if (!this.imgCode) {
|
||||
this.$message.error("请输入验证码!"); //发送失败,请输入图形验证码
|
||||
return;
|
||||
}
|
||||
//发送请求
|
||||
console.log(this.phone);
|
||||
// getSmsRegCodeApi({phone: this.phone}).then(res => {
|
||||
// // if(res.STATUS=="1"){
|
||||
// this.$message.success(this.$t('message.sign.verificationSendSuccess'));//验证码发送成功
|
||||
// this.$emit('getCode', res.VerificationCode)
|
||||
// // }else{
|
||||
// // this.$message.error('验证码发送失败');
|
||||
// // }
|
||||
// })
|
||||
axios({
|
||||
method: "post",
|
||||
headers: {
|
||||
// Authorization: "Bearer " + this.passwordForm.token,
|
||||
"Content-Type": "application/json", // 设置请求头的 Content-Type
|
||||
"Captcha-Id": this.captchaId,
|
||||
},
|
||||
url:
|
||||
this.$http.defaults.baseURL +
|
||||
"xmgl/base/code/getRegisterVerificationCode",
|
||||
data: {
|
||||
phone: this.phone,
|
||||
code: this.imgCode, // 验证码
|
||||
},
|
||||
}).then((result) => {
|
||||
const res = result.data;
|
||||
if (res.code != 200) {
|
||||
this.$emit("getImgCodeLogin");
|
||||
this.$message.error(res.message);
|
||||
return;
|
||||
}
|
||||
//调用定时器
|
||||
this.finish();
|
||||
this.$message.success(
|
||||
this.$t("message.sign.verificationSendSuccess")
|
||||
); //验证码发送成功
|
||||
this.$emit("getCode", res.VerificationCode);
|
||||
});
|
||||
// }else{
|
||||
// this.$message.error('新手机号不可用')
|
||||
// }
|
||||
// })
|
||||
} else {
|
||||
this.$message.error(this.$t("message.sign.verificationSendError")); //发送失败,手机号码格式不正确
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.theme1 {
|
||||
margin-right: -5px;
|
||||
border-radius: 0 3px 3px 0;
|
||||
}
|
||||
.theme1 {
|
||||
margin-right: -5px;
|
||||
border-radius: 0 3px 3px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -21,8 +21,9 @@ const routes2 = [{
|
||||
name: "login",
|
||||
// component: () => import('../views/home/login.vue')
|
||||
// component: () => import("../views/home/login_v1.vue"),
|
||||
// component: () => import ("../views/home/login_v2.vue"),
|
||||
component: () =>
|
||||
import ("../views/home/login_v2.vue"),
|
||||
import ("../views/home/login_v3.vue"),
|
||||
},
|
||||
{
|
||||
path: "/resetPassword",
|
||||
|
||||
1836
src/views/home/login_v3.vue
Normal file
1836
src/views/home/login_v3.vue
Normal file
File diff suppressed because it is too large
Load Diff
@ -509,18 +509,18 @@
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
:modal-append-to-body="false"
|
||||
title="配置isc服务器"
|
||||
title="配置服务器"
|
||||
:visible.sync="Popup2.accountServer"
|
||||
width="667px"
|
||||
>
|
||||
<div class="dialog_content">
|
||||
<el-form label-width="100px" class="dialogFormBox" size="medium">
|
||||
<el-form-item label="apiKey">
|
||||
<!-- <el-form-item label="apiKey">
|
||||
<el-input
|
||||
v-model="policeCameraVideoInfo.apiKey"
|
||||
:placeholder="$t('message.videoManage.placeholder')"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="appId">
|
||||
<el-input
|
||||
v-model="policeCameraVideoInfo.appId"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user