flx:修改登录、短信验证

This commit is contained in:
Rain_ 2025-09-10 14:06:46 +08:00
parent d38f0b6325
commit 8654d17dec
5 changed files with 1942 additions and 70 deletions

View File

@ -1,7 +1,7 @@
/** /**
* api接口统一管理 * api接口统一管理
*/ */
import {post,get} from '../http' import { post, get } from '../http'
export const registerApi = data => post('xmgl/base/register', data); //注册 export const registerApi = data => post('xmgl/base/register', data); //注册
export const newRegisterApi = data => post('xmgl/xzRegistry/add', 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 companyLoginApi = data => post('xmgl/base/companyLogin', data); //企业账号密码登录
export const projectLoginApi = data => post('xmgl/base/projectLogin', data); //项目账号密码登录 export const projectLoginApi = data => post('xmgl/base/projectLogin', data); //项目账号密码登录
export const getSmsRegCodeApi = data => post('xmgl/base/getRegisterVerificationCode', 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); //查询服务器认证信息 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 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);

View File

@ -6,73 +6,103 @@
</template> </template>
<script> <script>
import {checkPhone} from '@/assets/js/util.js' import { checkPhone } from "@/assets/js/util.js";
// changePhoneIsRegist // changePhoneIsRegist
import {getSmsRegCodeApi} from '@/assets/js/api/loginSign' import {
getSmsRegCodeApi,
export default { getRegisterVerificationCodeApi,
props: ['phone', 'type'], } from "@/assets/js/api/loginSign";
data() { import axios from "axios";
return { export default {
sendSuccess: false, //true false props: ["phone", "captchaId", "imgCode", "type"],
time: 60 // data() {
}; return {
}, sendSuccess: false, //true false
methods: { time: 60, //
// };
finish() { },
// methods: {
this.sendSuccess = true; //
// finish() {
let Time = setInterval(() => { //
if (this.time <= 1) { this.sendSuccess = true;
// //
// let Time = setInterval(() => {
clearInterval(Time); if (this.time <= 1) {
this.sendSuccess = false; //
this.time = 60; //
} else { clearInterval(Time);
this.time--; this.sendSuccess = false;
} this.time = 60;
}, 1000); } else {
}, this.time--;
//
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'));//,
}
}
} }
} }, 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> </script>
<style lang="less" scoped> <style lang="less" scoped>
.theme1 { .theme1 {
margin-right: -5px; margin-right: -5px;
border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0;
} }
</style> </style>

View File

@ -21,8 +21,9 @@ const routes2 = [{
name: "login", name: "login",
// component: () => import('../views/home/login.vue') // component: () => import('../views/home/login.vue')
// component: () => import("../views/home/login_v1.vue"), // component: () => import("../views/home/login_v1.vue"),
// component: () => import ("../views/home/login_v2.vue"),
component: () => component: () =>
import ("../views/home/login_v2.vue"), import ("../views/home/login_v3.vue"),
}, },
{ {
path: "/resetPassword", path: "/resetPassword",

1836
src/views/home/login_v3.vue Normal file

File diff suppressed because it is too large Load Diff

View File

@ -509,18 +509,18 @@
</el-dialog> </el-dialog>
<el-dialog <el-dialog
:modal-append-to-body="false" :modal-append-to-body="false"
title="配置isc服务器" title="配置服务器"
:visible.sync="Popup2.accountServer" :visible.sync="Popup2.accountServer"
width="667px" width="667px"
> >
<div class="dialog_content"> <div class="dialog_content">
<el-form label-width="100px" class="dialogFormBox" size="medium"> <el-form label-width="100px" class="dialogFormBox" size="medium">
<el-form-item label="apiKey"> <!-- <el-form-item label="apiKey">
<el-input <el-input
v-model="policeCameraVideoInfo.apiKey" v-model="policeCameraVideoInfo.apiKey"
:placeholder="$t('message.videoManage.placeholder')" :placeholder="$t('message.videoManage.placeholder')"
></el-input> ></el-input>
</el-form-item> </el-form-item> -->
<el-form-item label="appId"> <el-form-item label="appId">
<el-input <el-input
v-model="policeCameraVideoInfo.appId" v-model="policeCameraVideoInfo.appId"