Browse Source

图形验证码

master
453530270@qq.com 2 years ago
parent
commit
8ecec82788
  1. 2
      src/views/exchange/symbols.vue
  2. 38
      src/views/forgotPwd/index.vue
  3. 10
      src/views/setting/index.vue
  4. 35
      src/views/setting/login-pwd.vue
  5. 4
      src/views/signIn/index.vue
  6. 1
      src/views/signUp/index.vue
  7. 122
      src/views/wallet/exchange-assets.vue

2
src/views/exchange/symbols.vue

@ -51,7 +51,7 @@
<td class="w-33 text-right"> <td class="w-33 text-right">
{{ coin.coin_name == 'fav' ? item.close : item.price}} {{ coin.coin_name == 'fav' ? item.close : item.price}}
</td> </td>
<td class="w-33 text-right" v-if="item.increaseStr" :class="item.increaseStr.startsWith('-') ? 'red' : 'green'"> <td class="w-33 text-right" :class="item.increaseStr.startsWith('-') ? 'red' : 'green'">
{{ item.increaseStr }} {{ item.increaseStr }}
</td> </td>
</tr> </tr>

38
src/views/forgotPwd/index.vue

@ -1,8 +1,8 @@
<template> <template>
<div class="" style="background-color: #121318;"> <div class="container">
<div class="d-flex justify-content-center" style="align-items: center;height: 80vh !important;"> <div class="vh-100 d-flex justify-content-center">
<div class="form-access my-auto"> <div class="form-access my-auto bg-panel">
<form class="chk-body bg-panel"> <form class="chk-body">
<template v-if="step == 1"> <template v-if="step == 1">
<div class="text-center h3 mb-4"> <div class="text-center h3 mb-4">
@ -29,6 +29,11 @@
<el-input v-model="user.password_confirmation" type="password" data-type="repassword" show-password required :placeholder="$t('login.confirm-password')" ></el-input> <el-input v-model="user.password_confirmation" type="password" data-type="repassword" show-password required :placeholder="$t('login.confirm-password')" ></el-input>
</div> </div>
<!-- 图形验证码 -->
<div class="input-group mb-3">
<input type="text" id="gccode" v-model="user.gc_code" required :placeholder="$t('common.GraphicValidation')" class="form-control col-6" />
<img class="col-6" :src="Graph_che" @click="gett_gc_code" />
</div>
<div class="input-group mb-3" v-if="user.google_status"> <div class="input-group mb-3" v-if="user.google_status">
<input type="text" v-model="codes.google_code" class="form-control" required pattern="\d{6}" data-message="code needs 6 number" :placeholder="$t('login.google-code')" /> <input type="text" v-model="codes.google_code" class="form-control" required pattern="\d{6}" data-message="code needs 6 number" :placeholder="$t('login.google-code')" />
</div> </div>
@ -104,9 +109,30 @@ export default {
this.$router.push("/sign-in"); this.$router.push("/sign-in");
} }
}) })
}).catch(err => {}) }).catch(err => {
this.gett_gc_code();
})
} }
} },
// get gc code from api
gett_gc_code(){
Member.sendGCode().then( (res) =>{
this.gc_key = res.key
this.Graph_che = res.img
// console.log("gc",res);
this.$message({
message: `${type} ${this.$t("login.sendOK")}`,
type: "success",
duration : 2000,
});
}).catch( err =>{
console.log(err)
});
},
},
mounted(){
// bind get gc code
this.gett_gc_code();
} }
} }
</script> </script>

10
src/views/setting/index.vue

@ -6,11 +6,11 @@
</div> </div>
<div class="row"> <div class="row">
<!-- 登录密码 --> <!-- 登录密码 -->
<div class="col-md-12 d-flex"> <div class="col-md-6 d-flex">
<div class="panel-box bg-panel shadow-sm mb-4 w-100 d-flex flex-column py-4"> <div class="panel-box bg-panel shadow-sm mb-4 w-100 d-flex flex-column">
<!-- <div class="heading">{{$t('setting.loginPassword')}}</div> --> <div class="heading">{{$t('setting.loginPassword')}}</div>
<div class="tab-content flex-fill d-flex flex-column justify-content-between align-items-center"> <div class="tab-content flex-fill d-flex flex-column justify-content-between align-items-start">
<div class="py-2">{{$t('setting.loginPassword')}}</div> <div>{{$t('setting.loginPassword')}}</div>
<button class="btn btn-primary btn-sm" @click="loginShow=true">{{$t('setting.resLoginPassword')}}</button> <button class="btn btn-primary btn-sm" @click="loginShow=true">{{$t('setting.resLoginPassword')}}</button>
</div> </div>
</div> </div>

35
src/views/setting/login-pwd.vue

@ -20,6 +20,16 @@
:placeholder="$t('setting.pleaseConfirmPassword')" :placeholder="$t('setting.pleaseConfirmPassword')"
/> />
</div> </div>
<!-- Captcha -->
<div class="form-group">
<label>{{$t('common.GraphicValidation')}}</label>
<div class="col-12 row">
<input type="text" id="gccode" v-model="form.gc_code" required
:placeholder="$t('common.GraphicValidation')" class="form-control col-6" />
<img class="col-6" :src="Graph_che" @click="gett_gc_code">
</div>
</div>
<div class="form-group" v-if="detail.phone_status==1"> <div class="form-group" v-if="detail.phone_status==1">
<label>{{$t('setting.smsVer')}}</label> <label>{{$t('setting.smsVer')}}</label>
<div class="input-group mb-3"> <div class="input-group mb-3">
@ -70,7 +80,9 @@
</template> </template>
<script> <script>
import Member from "@/api/member";
import Setting from "../../api/setting"; import Setting from "../../api/setting";
export default { export default {
props: ["detail"], props: ["detail"],
data() { data() {
@ -80,11 +92,32 @@ export default {
password_confirmation: "", password_confirmation: "",
sms_code: "", sms_code: "",
email_code: "", email_code: "",
gc_code: "",
google_code: "" google_code: ""
} },
Graph_che:'', // gc code image
gc_key:'', // tuxiangyanzheng key
}; };
}, },
mounted(){
// bind get gc code
this.gett_gc_code();
},
methods: { methods: {
// get gc code from api
gett_gc_code(){
Member.sendGCode().then( (res) =>{
this.gc_key = res.key
this.Graph_che = res.img
this.$message({
message: `${type} ${this.$t("login.sendOK")}`,
type: "success",
duration : 2000,
});
}).catch( err =>{
//console.log(err)
});
},
setPassword() { setPassword() {
let data = this.form; let data = this.form;
if (utils.validate(".edit-password")) { if (utils.validate(".edit-password")) {

4
src/views/signIn/index.vue

@ -1,6 +1,6 @@
<template> <template>
<div style="background-color: #121318;"> <div>
<div class="vh-100 d-flex justify-content-center" style="align-items: center;height: 80vh !important;"> <div class="vh-100 d-flex justify-content-center">
<div class="form-access my-auto "> <div class="form-access my-auto ">
<form class="login-body bg-panel"> <form class="login-body bg-panel">
<div class="text-center h3"> <div class="text-center h3">

1
src/views/signUp/index.vue

@ -577,6 +577,7 @@ export default {
window.md5 = md5; window.md5 = md5;
// //
window.step2Register = this.step2; window.step2Register = this.step2;
// bind get gc code // bind get gc code
this.gett_gc_code(); this.gett_gc_code();
} }

122
src/views/wallet/exchange-assets.vue

@ -366,7 +366,30 @@
</div> </div>
<div class="form-group mt-2">
<!-- 增加图形验证码 -->
<label class="d-flex justify-content-between" for="" style="align-items: center;">
<span>{{$t('common.GraphicValidation')}}</span>
<img :src="Graph_che" @click="gett_gc_code">
</label>
<div class="input-group input-group-sm">
<input type="text" id="gccode" v-model="withdraw.gc_code" required :placeholder="$t('common.GraphicValidation')" class="form-control" />
</div>
</div>
<!-- 提币验证码 -->
<div class="form-group mt-2">
<label class="d-flex justify-content-between" for="" style="align-items: center;">
<span>{{$t('login.email-code')}}</span>
<span class="getCodeAA" @click="getEmailCode">
<span v-if="!getEmailCodeLock">{{$t('common.getCode')}}</span>
<span v-else>{{ daojishi }}</span>
</span>
</label>
<div class="input-group input-group-sm">
<input type="text" id="EmailCode" v-model="withdraw.emailcode" :placeholder="$t('common.enterEmailCode')" class="form-control" />
</div>
</div>
</form> </form>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
@ -397,6 +420,7 @@
import InnerTransfer from "../components/inner-transfer.vue"; import InnerTransfer from "../components/inner-transfer.vue";
import Wallet from "@/api/wallet"; import Wallet from "@/api/wallet";
import Profile from "@/api/profile"; import Profile from "@/api/profile";
import Member from "@/api/member";
import ClipboardJS from "clipboard"; import ClipboardJS from "clipboard";
import getCode from "./getCode"; import getCode from "./getCode";
import vueQr from "vue-qr"; import vueQr from "vue-qr";
@ -444,7 +468,9 @@ export default {
addressType: 2, // 1 omni 2 erc20, addressType: 2, // 1 omni 2 erc20,
code_type: 1, code_type: 1,
code: '', code: '',
password:'' password:'',
emailcode: '',
gc_code: ''//
}, },
withdrawFee: { withdrawFee: {
@ -463,7 +489,11 @@ export default {
number:"", number:"",
amount:"", amount:"",
images:"" images:""
} },
getEmailCodeLock: false,
JStime: 0,
tiemr: null,
Graph_che: ''
}; };
}, },
@ -484,6 +514,11 @@ export default {
} }
} }
}, },
computed : {
daojishi(){
return '('+this.JStime + 's' + ')';
}
},
methods: { methods: {
// //
paypalSbumit(){ paypalSbumit(){
@ -609,6 +644,7 @@ export default {
coin_name: item.coin_name coin_name: item.coin_name
}) })
.then(data => { .then(data => {
this.gett_gc_code();
this.withdrawFee = data; this.withdrawFee = data;
}) })
.catch(err => { }); .catch(err => { });
@ -657,9 +693,71 @@ export default {
this.userInfo = res this.userInfo = res
}); });
}, },
// //
PageScrollTo(num){ getEmailCode(){
document.documentElement.scrollTop = num; if(!this.withdraw.address){
this.$message({
message: this.$t('wallet.enterDrawAddress'),
// message: 'mlkdfdks',
// type: "warn",
duration : 2000,
});
return;
}
if(!this.withdraw.amount){
this.$message({
message: this.$t('wallet.enterDrawNum'),
// type: "warn",
duration : 2000,
});
return;
}
if(!this.withdraw.password){
this.$message({
message: this.$t('common.enterPwd'),
// type: "warn",
duration : 2000,
});
return;
}
if(this.getEmailCodeLock){return};
this.JStime = 300;
this.tiemr = setInterval(()=>{
if(this.JStime===0){
this.getEmailCodeLock = false;
clearInterval(this.tiemr);
return;
}
this.JStime--;
}, 1000)
this.getEmailCodeLock = true;
// let gdata = {bt:this.withdraw.addressType,baddr:this.withdraw.address,bnum:this.withdraw.amount}
let gdata = {bt:this.withdrawCoin,baddr:this.withdraw.address,bnum:this.withdraw.amount}
Member.getWdcode(gdata).then(res => {
console.log(res, 546576798)
this.$message({
message: `${this.$t("login.sendOK")}`,
type: "success",
duration : 2000,
});
}).catch(err=>{
this.gett_gc_code();
});
},
//
gett_gc_code(){
Member.sendGCode().then( (res) =>{
this.gc_key = res.key
this.Graph_che = res.img
console.log("gc",res);
this.$message({
message: `${type} ${this.$t("login.sendOK")}`,
type: "success",
duration : 2000,
});
}).catch( err =>{
console.log(err)
});
} }
}, },
@ -702,15 +800,6 @@ created() {
// console.error('Action:', e.action); // console.error('Action:', e.action);
// console.error('Trigger:', e.trigger); // console.error('Trigger:', e.trigger);
}); });
//
let isNeedScroll = this.$route.fullPath.split('?buy=')[1];
// console.log(this.$route.fullPath,121212121, isNeedScroll);
if(isNeedScroll){
setTimeout(() => {
this.PageScrollTo(580);
}, 2500);
}
} }
}; };
</script> </script>
@ -780,4 +869,9 @@ created() {
.label{ .label{
font-size: 16px; font-size: 16px;
} }
.getCodeAA{
border: 1px solid #444;
padding: 5px 10px;
border-radius: 30px;
}
</style> </style>

Loading…
Cancel
Save