Commit 0cc2a831 authored by wxk's avatar wxk

密码加密方式优化、登录输入忽略首尾空格

parent 2d71a0d6
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
> 机器人监控,负责交易所网站和币种的监控 > 机器人监控,负责交易所网站和币种的监控
## 密码加密方法
```
md5(password+md5(username))
```
## Build Setup ## Build Setup
``` bash ``` bash
......
...@@ -15,6 +15,7 @@ const Api = { ...@@ -15,6 +15,7 @@ const Api = {
Transaction: originUrl + "/transaction", //交易记录 Transaction: originUrl + "/transaction", //交易记录
Records: originUrl + "/records", //充提记录 Records: originUrl + "/records", //充提记录
Ticket: originUrl + '/ticket', //查询交易对行情 Ticket: originUrl + '/ticket', //查询交易对行情
Excle: originUrl + '/recordsExcle',//导出充提记录
} }
export default Api; export default Api;
...@@ -7,17 +7,17 @@ ...@@ -7,17 +7,17 @@
<div class="content"> <div class="content">
<div class="groupcom"> <div class="groupcom">
<i class="iicon user"></i> <i class="iicon user"></i>
<input type="text" name="username" placeholder="请输入您的邮箱" class="usercom" v-model="loginEmail"> <input type="text" name="username" placeholder="请输入您的邮箱" class="usercom" v-model.trim="loginEmail">
</div> </div>
<div class="groupcom inputpwd"> <div class="groupcom inputpwd">
<i class="iicon pwd"></i> <i class="iicon pwd"></i>
<input type="password" placeholder="请输入密码" class="usercom" v-model="loginPassword" @keyup.enter="Login"> <input type="password" placeholder="请输入密码" class="usercom" v-model.trim="loginPassword" @keyup.enter="Login">
</div> </div>
<div class="ground"> <div class="ground">
<span class="ground-right"> <span class="ground-right">
<span @click="goShowPanel(2)" class="bluepoint">马上注册</span> <span @click="goShowPanel(2)" class="bluepoint">马上注册</span>
&nbsp; &nbsp;
<span @click="goShowPanel(3)" class="bluepoint">忘记密码</span> <span @click="goShowPanel(3)" class="bluepoint">重置密码</span>
</span> </span>
<input type="checkbox" name="记住用户密码" class="rember" v-model="isSaveLoginInfo"> <input type="checkbox" name="记住用户密码" class="rember" v-model="isSaveLoginInfo">
<span>记住密码</span> <span>记住密码</span>
...@@ -31,19 +31,19 @@ ...@@ -31,19 +31,19 @@
<div class="content"> <div class="content">
<div class="groupcom"> <div class="groupcom">
<i class="iicon user"></i> <i class="iicon user"></i>
<input type="text" name="username" placeholder="请输入您的邮箱" class="usercom" v-model="regist_email"> <input type="text" name="username" placeholder="请输入您的邮箱" class="usercom" v-model.trim="regist_email">
</div> </div>
<div class="groupcom inputpwd"> <div class="groupcom inputpwd">
<i class="iicon pwd"></i> <i class="iicon pwd"></i>
<input type="password" placeholder="请输入密码(不少于6位)" class="usercom" v-model="regist_password"> <input type="password" placeholder="请输入密码(不少于6位)" class="usercom" v-model.trim="regist_password">
</div> </div>
<div class="groupcom inputpwd"> <div class="groupcom inputpwd">
<i class="iicon pwd"></i> <i class="iicon pwd"></i>
<input type="password" placeholder="请再次输入密码" class="usercom" v-model="regist_rppassword"> <input type="password" placeholder="请再次输入密码" class="usercom" v-model.trim="regist_rppassword">
</div> </div>
<div class="inputyzm inputpwd"> <div class="inputyzm inputpwd">
<i class="iicon pwd"></i> <i class="iicon pwd"></i>
<input type="text" placeholder="请输入验证码" class="usercomyzm" v-model="regist_yzm"> <input type="text" placeholder="请输入验证码" class="usercomyzm" v-model.trim="regist_yzm">
<el-button type="primary" class="getyzm" @click="getYZM('regist')" :disabled='!show'> <el-button type="primary" class="getyzm" @click="getYZM('regist')" :disabled='!show'>
<span v-show = "show">获取验证码</span> <span v-show = "show">获取验证码</span>
<span v-show = "!show" class="count">已发送{{count}} s</span> <span v-show = "!show" class="count">已发送{{count}} s</span>
...@@ -60,15 +60,15 @@ ...@@ -60,15 +60,15 @@
</div> </div>
<!-- 忘记密码 --> <!-- 忘记密码 -->
<div class="login" v-show="islogin==3"> <div class="login" v-show="islogin==3">
<h2 class="title">忘记密码</h2> <h2 class="title">重置密码</h2>
<div class="content"> <div class="content">
<div class="groupcom"> <div class="groupcom">
<i class="iicon user"></i> <i class="iicon user"></i>
<input type="text" name="username" placeholder="请输入您的邮箱" class="usercom" v-model="forget_email"> <input type="text" name="username" placeholder="请输入您的邮箱" class="usercom" v-model.trim="forget_email">
</div> </div>
<div class="inputyzm inputpwd"> <div class="inputyzm inputpwd">
<i class="iicon pwd"></i> <i class="iicon pwd"></i>
<input type="text" placeholder="请输入验证码" class="usercomyzm" v-model="forget_yzm"> <input type="text" placeholder="请输入验证码" class="usercomyzm" v-model.trim="forget_yzm">
<el-button type="primary" class="getyzm" @click="getYZM('forgetpassword')" :disabled='!show'> <el-button type="primary" class="getyzm" @click="getYZM('forgetpassword')" :disabled='!show'>
<span v-show = "show">获取验证码</span> <span v-show = "show">获取验证码</span>
<span v-show = "!show" class="count">已发送{{count}} s</span> <span v-show = "!show" class="count">已发送{{count}} s</span>
...@@ -76,11 +76,11 @@ ...@@ -76,11 +76,11 @@
</div> </div>
<div class="groupcom inputpwd"> <div class="groupcom inputpwd">
<i class="iicon pwd"></i> <i class="iicon pwd"></i>
<input type="password" placeholder="请输入新密码(不少于6位)" class="usercom" v-model="forget_password"> <input type="password" placeholder="请输入新密码(不少于6位)" class="usercom" v-model.trim="forget_password">
</div> </div>
<div class="groupcom inputpwd"> <div class="groupcom inputpwd">
<i class="iicon pwd"></i> <i class="iicon pwd"></i>
<input type="password" placeholder="请再次输入新密码" class="usercom" v-model="forget_rppassword"> <input type="password" placeholder="请再次输入新密码" class="usercom" v-model.trim="forget_rppassword">
</div> </div>
<div class="ground" style="margin-bottom:70px;"> <div class="ground" style="margin-bottom:70px;">
<span class="ground-right"> <span class="ground-right">
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<span @click="goShowPanel(1)" class="bluepoint">马上登录</span> <span @click="goShowPanel(1)" class="bluepoint">马上登录</span>
</span> </span>
</div> </div>
<el-button type="primary" class="loginget" @click="forgetpassword">忘记密码</el-button> <el-button type="primary" class="loginget" @click="forgetpassword">重置密码</el-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -104,7 +104,6 @@ import ApiConfig from "../config/api-config"; ...@@ -104,7 +104,6 @@ import ApiConfig from "../config/api-config";
export default { export default {
data(){ data(){
return { return {
salt: 'fzm_salt',//md5加盐值
show:true, show:true,
count:'', count:'',
timer:null, timer:null,
...@@ -125,7 +124,6 @@ export default { ...@@ -125,7 +124,6 @@ export default {
mounted(){ mounted(){
//加载存储的数据 //加载存储的数据
console.log(md5('Wxk12345'+this.salt))
this.loginEmail = localStorage["username"]; this.loginEmail = localStorage["username"];
this.loginPassword = localStorage["password"]; this.loginPassword = localStorage["password"];
}, },
...@@ -189,27 +187,20 @@ export default { ...@@ -189,27 +187,20 @@ export default {
}, },
//注册 //注册
registered(){ registered(){
//console.log(this.regist_email) const message = !this.regist_email ? '邮箱不能为空' :
//console.log(this.regist_password) (!this.regist_password ? '密码不能为空' :
if(this.regist_password == '' || this.regist_rppassword == '' || this.regist_password!=this.regist_rppassword){//密码格式不对 (this.regist_password!==this.regist_rppassword ? '两次密码不一致,请重新输入后再试' :
this.$notify({ (!this.regist_yzm ? '验证码不能为空' : '')));
title: '提示', if(message) {
message: "密码格式不正确,请重新输入",
type: 'error',
duration:'2000',
});
return;
}
if(this.regist_yzm==''){//且验证码为空
this.$notify({ this.$notify({
title: '提示', title: '提示',
message: "请输入验证码", message: message,
type: 'error', type: 'error',
duration:'2000', duration:'2000',
}); });
return; return
} }
axios.post(ApiConfig.Register,{"user":this.regist_email,"password":md5(this.regist_password + this.salt),"emailvcode":this.regist_yzm}).then(res => { axios.post(ApiConfig.Register,{"user":this.regist_email,"password":md5(this.regist_password + md5(this.regist_email)),"emailvcode":this.regist_yzm}).then(res => {
if(res.data.code === 200){ if(res.data.code === 200){
this.$notify({ this.$notify({
title: '提示', title: '提示',
...@@ -251,7 +242,7 @@ export default { ...@@ -251,7 +242,7 @@ export default {
}); });
return; return;
} }
const password = localStorage["username"] === this.loginEmail && localStorage["password"] === this.loginPassword ? localStorage["password"] : md5(this.loginPassword + this.salt); const password = localStorage["username"] === this.loginEmail && localStorage["password"] === this.loginPassword ? localStorage["password"] : md5(this.loginPassword + md5(this.loginEmail));
axios.post(ApiConfig.Login,{"user":this.loginEmail, "password": password}).then(res => { axios.post(ApiConfig.Login,{"user":this.loginEmail, "password": password}).then(res => {
if(res.data.code === 200){ if(res.data.code === 200){
this.$notify({ this.$notify({
...@@ -319,7 +310,7 @@ export default { ...@@ -319,7 +310,7 @@ export default {
}); });
return; return;
} }
axios.post(ApiConfig.ResetPassword,{"user":this.forget_email,"password": md5(this.forget_password+this.salt),"emailvcode":this.forget_yzm}).then(res => { axios.post(ApiConfig.ResetPassword,{"user":this.forget_email,"password": md5(this.forget_password+md5(this.forget_email)),"emailvcode":this.forget_yzm}).then(res => {
// console.log(res) // console.log(res)
if(res.data.code === 200){ if(res.data.code === 200){
this.$notify({ this.$notify({
......
...@@ -288,6 +288,9 @@ ...@@ -288,6 +288,9 @@
<span>{{value}}</span> <span>{{value}}</span>
</li> </li>
</ul> </ul>
<div class="fl">
<el-button type="primary" @click="exportExcel">导出</el-button>
</div>
</div> </div>
<el-table <el-table
v-loading="recordsLoading" v-loading="recordsLoading"
...@@ -809,6 +812,17 @@ ...@@ -809,6 +812,17 @@
handleCurrentChange1(val) { handleCurrentChange1(val) {
this.getRecords({page: val+''}); this.getRecords({page: val+''});
}, },
//导出
exportExcel() {
const symbol = this.robotDetailInfo.coin+'/'+this.robotDetailInfo.base;
const params = {
account: this.robotDetailInfo.account,
symbol: symbol,
}
axios.post(ApiConfig.Excle,params).then( res => {
console.log(res)
})
}
}, },
watch: { watch: {
robotBankList(val) { robotBankList(val) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment