提交 c97af508 编写于 作者: “grape”'s avatar “grape”

2022/8/16

上级 babaf030
......@@ -8,8 +8,8 @@
*/
import { MethodType } from "@/constants/enum/general/method-type.enum";
import { HeaderType } from "@/constants/enum/general/header-type.enum";
const prefix = "http://10.0.0.118:9130/ms-system/api/v1/sysCustInfo/permit_endpoint"
// http://10.0.1.9:9130
const prefix = "http://localhost:9135//ms-system/api/v1/sysCustInfo/permit_endpoint"
const loginApi = {
updatePicCode: {
......
......@@ -11,7 +11,6 @@ export default {
* @return {Object} jsonstr 返回加密后的json数据
*/
encryptData(jsonstr: any) {
debugger
let encryData = {};
try {
// SM2 加密秘钥
......@@ -57,11 +56,10 @@ export default {
jsonData = JSON.parse(jsonData);
}
try {
debugger
let sm2 = require('sm-crypto').sm2,
sm3 = require('sm-crypto').sm3,
sm4 = require('sm-crypto').sm4,
privateKey = '0494FEF4897CF4E9C9CB994B66B29E9B3EAF2C5C59EBEDB703B0F980199CEA7BDBF177AB3E65A17F3E96227977C55423929975CE535B715AC21E0AB23B9858AB4F', //SM2公钥
privateKey = '7666A8CA12A27CF6C440A1CFECB4B1BB7055F2FB3435E957EB35142FAB881EFB', //SM2公钥
sm4Key = '',
orSm4Key = jsonData.sm4key;
orSm4Key = orSm4Key.substr(2, orSm4Key.length - 2);
......
......@@ -32,7 +32,8 @@ class ApiService {
Vue.axios.interceptors.request.use(
config => {
config.headers['Access-Control-Allow-Origin'] = '*';
config.headers['MCEP'] = 'MCEP';
//开启
// config.headers['MCEP'] = 'MCEP';
if(!config.headers['Content-Type']){
config.headers['Content-Type'] = 'application/json; charset=utf-8';
}
......@@ -175,7 +176,12 @@ class ApiService {
path = query != null ? this.urlQueryConvert(path, query) : path;
console.log("服务调用--" + path);
return Vue.axios.post(`${path}`, params, requestConfig).then(this.createBusCodeHandler(query)).catch(this.createErrorHandler())
return Vue.axios.post(`${path}`, params, requestConfig).then(res=>{
//TODO
console.log(res);
return res.data
});
}
/**
* POST请求 文件上传
......
......@@ -105,7 +105,6 @@ export default class LoginView extends Vue {
//获取图形验证码
_updatePicCode() {
//请求图形验证码
debugger
apiService.general(loginApi.updatePicCode, undefined, undefined, undefined).then((response: RestfulResponse) => {
//console.log(response);
......@@ -153,7 +152,7 @@ export default class LoginView extends Vue {
//图形验证码
imageVerifyKey: this.imageSrcValue,
//渠道
loginType: "3",
loginType: "2",
//手机验证码
messCode: this.sms,
//密码
......
......@@ -13,46 +13,99 @@
</div>
<div class="login">
<van-row style="padding: 10% 0%;">
<van-row style="padding: 10% 0%">
<van-col span="24">
<p class="polog"><span class="font-size-18-dhc" style="padding: 2% 0%;font-weight: 600;">密码重置</span> </p>
<p class="polog">
<span
class="font-size-18-dhc"
style="padding: 2% 0%; font-weight: 600"
>密码重置</span
>
</p>
</van-col>
<van-col span="24"><span class="font-size-12-dhc" style="font-weight: 400; font-family: 'Arial Normal', 'Arial';
}">请使用注册手机号进行密码重置</span></van-col>
<van-col span="24"
><span
class="font-size-12-dhc"
style="font-weight: 400; font-family: 'Arial Normal', 'Arial';
}"
>请使用注册手机号进行密码重置</span
></van-col
>
</van-row>
<van-form @submit="onSubmit">
<div class="logindiv">
<span class="sopan">手机号码</span>
<van-field v-model="phone" label="+86 |" :border="true" placeholder="请输入手机号" />
<van-field
v-model="phone"
label="+86 |"
:border="true"
placeholder="请输入手机号"
/>
<van-divider />
</div>
<div class="logindiv">
<span class="sopan">新密码</span>
<van-field v-model="newpassword" type="password" center clearable placeholder="请填写新密码" />
<van-field
v-model="newpassword"
:type="passwordType"
clickable
center
clearable
placeholder="请填写新密码"
>
<template slot="right-icon">
<span class="solts" @click="switchPasswordType">
<van-icon name="eye" v-if="passwordType === 'password'" />
<van-icon name="closed-eye" v-else />
</span>
</template>
</van-field>
<!-- <van-divider /> -->
</div>
<div class="logindiv">
<div class="logindiv">
<span class="sopan">新密码</span>
<van-field v-model="restpassword" type="password" center clearable placeholder="请确认新密码" />
<van-field
v-model="restpassword"
:type="password"
clickable
center
clearable
placeholder="请确认新密码"
>
<template slot="right-icon">
<span class="solts" @click="switchPasswordType">
<van-icon name="eye" v-if="passwordType === 'password'" />
<van-icon name="closed-eye" v-else />
</span>
</template>
</van-field>
<!-- <van-divider /> -->
</div>
<span class="sopan">短信验证码</span>
<div>
<van-row >
<van-row>
<van-col span="16">
<van-field v-model="sms" center clearable placeholder="请输入短信验证码">
<van-field
v-model="sms"
center
clearable
placeholder="请输入短信验证码"
>
<!-- <van-divider /> -->
</van-field>
</van-col>
<van-col span="8"><a href="#" @click="getPhonePost()">获取短信验证码</a></van-col>
<van-col span="8"
><a href="#" @click="getPhonePost()">获取短信验证码</a></van-col
>
</van-row>
</div>
<div style="margin: 16px;">
<van-button square block type="info" native-type="submit">登录</van-button>
<div style="margin: 16px">
<van-button square block type="info" native-type="submit"
>登录</van-button
>
</div>
</van-form>
</div>
......@@ -60,34 +113,39 @@
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import { Image as VanImage, Toast } from 'vant';
import { Image as VanImage, Toast } from "vant";
import apiService from "@/services/api.service";
import { Code } from "@/constants/enum/general/code.enum";
import { RestfulResponse } from "@/model/domain/RestfulResponse";
import commonApi from "@/constants/api/login/common.api";
@Component({
name: "ForgetPassView",
[VanImage.name]: VanImage,
})
export default class ForgetPassView extends Vue {
password = "password";
passwordType="password"
getCmstotal = "获取短信验证码";
tatleName = "密码重置"
phone: string = "" //电话
newpassword: string = ""//密码
restpassword:string = ""//密码
imageSrc: string = ""//图形
sms: string = ""//短信
timer: any = "";//定时器
time: number = 60;//计数
radio: string = "0"
tatleName = "密码重置";
phone: string = ""; //电话
newpassword: string = ""; //密码
restpassword: string = ""; //密码
imageSrc: string = ""; //图形
sms: string = ""; //短信
timer: any = ""; //定时器
time: number = 60; //计数
radio: string = "0";
//获取图形验证码
_updatePicCode() {
//请求图形验证码
this.imageSrc = 'http://localhost:8080/users/sendPicCode?=' + Math.random();
this.imageSrc = "http://localhost:8080/users/sendPicCode?=" + Math.random();
//this.imageSrc = 'D:\GitClone\H5\mcep-h5\src\assets\images\ZYXTimg.png' + Math.random()
}
//方法
switchPasswordType() {
this.passwordType = this.passwordType === 'password' ? 'text' : 'password'
}
//计时器
changeCmstotal() {
this.getCmstotal = this.time + "s重发验证码";
......@@ -95,31 +153,31 @@ export default class ForgetPassView extends Vue {
this.time--;
this.getCmstotal = this.time + "s重发验证码";
if (this.time < 0) {
clearInterval(this.time)
clearInterval(this.time);
this.getCmstotal = "获取短信验证码";
}
}, 1000)
}, 1000);
}
getPhonePost(){
let param={
phoneCode:this.phone
}
apiService.general(commonApi.getPicCode,param,undefined,undefined).then((response: RestfulResponse) => {
getPhonePost() {
let param = {
phoneCode: this.phone,
};
apiService
.general(commonApi.getPicCode, param, undefined, undefined)
.then((response: RestfulResponse) => {
if (response.code == Code.SUCCESS.code) {
Toast('短信发送成功,5分钟有效');
this.changeCmstotal()
}else{
Toast('短信发送失败,请重试');
Toast("短信发送成功,5分钟有效");
this.changeCmstotal();
} else {
Toast("短信发送失败,请重试");
}
})
}
});
}
onSubmit(values: any) {
console.log('submit', values);
console.log("submit", values);
}
created() {
this.$nextTick(() => this._updatePicCode())
this.$nextTick(() => this._updatePicCode());
}
}
</script>
......@@ -147,8 +205,6 @@ getPhonePost(){
font-kerning: normal;
}
.van-col--15 {
margin-top: 2%;
}
......@@ -157,10 +213,10 @@ getPhonePost(){
margin-left: 6%;
}
.forget {}
.forget {
}
.sopan {
margin-top: 5px;
margin-left: 6%;
}
......
......@@ -24,37 +24,46 @@
<div class="logindiv">
<span class="sopan">手机号码</span>
<van-field v-model="phone" label="+86 |" :border="true" placeholder="请输入手机号" />
<van-divider />
<span class="sopan">身份证号</span>
<van-divider :style="{margin :0 }"></van-divider>
</div>
<div class="logindiv">
<span class="sopan">身份证号</span>
<van-field v-model="idCard" :border="true" placeholder="请输入身份证号" />
<van-divider />
<!-- <van-divider /> -->
<van-divider :style="{margin :0 }"></van-divider>
</div>
<span class="sopan">短信验证码</span>
<div>
<div class="logindiv"><span class="sopan">短信验证码</span>
<van-row >
<van-col span="16">
<van-field v-model="sms" center clearable placeholder="请输入短信验证码">
<!-- <van-divider /> -->
</van-field>
</van-col>
<van-col span="8"><a @click="getPhonePost()">{{getCmstotal}}</a></van-col>
<van-col span="8"><span style="color:blue" @click="getPhonePost()">{{getCmstotal}}</span></van-col>
</van-row>
<van-divider :style="{margin :0 }"></van-divider>
</div>
<div class="logindiv">
<span class="sopan">设置密码</span>
<van-field v-model="password" type="password" center clearable placeholder="请填写新密码" />
<!-- <van-divider /> -->
<van-divider :style="{margin :0 }"></van-divider>
</div>
<div class="logindiv">
<span class="sopan">确认密码</span>
<van-field v-model="restpassword" type="password" center clearable placeholder="请确认新密码" />
<!-- <van-divider /> -->
<van-divider :style="{margin :0 }"></van-divider>
</div>
</div>
<div style="margin: 16px;">
<van-button square block type="info" native-type="submit" @click="registSystem()">注册</van-button>
</div>
......@@ -168,6 +177,7 @@ getPhonePost(){
.logindiv {
line-height: 20px;
margin-bottom: 10px;
}
.van-button {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册