提交 b354214f authored 作者: zfl's avatar zfl

等保要求整改

上级 57c205ca
......@@ -159,3 +159,11 @@ export function getUserAnalysisTrend() {
method: 'get',
})
}
//获取邮箱验证码
export function getCaptcha() {
return request({
url: '/api/getCaptcha',
method: 'get'
})
}
\ No newline at end of file
......@@ -31,7 +31,9 @@ import echarts from 'echarts';
//引入加密函数,并将其封装
import { handleParams, Aesdecrypt, removeProperty } from '@/utils/cryptoJS';
import { Aesencrypt, Aesdecrypt, removeProperty, handleParams } from '@/utils/cryptoJS';
Vue.prototype.$Aesencrypt = Aesencrypt;//加密
Vue.prototype.$handleParams = handleParams;//封装机密格式的参数
Vue.prototype.$Aesdecrypt = Aesdecrypt;//封装机密格式的参数
Vue.prototype.$removeProperty = removeProperty;//去除空值
......
......@@ -30,6 +30,16 @@
</div>
</div>
</el-form-item>
<el-form-item >
<el-row style="padding-top:10px">
<el-col :span="14">
<el-input type="text" v-model="loginForm.code" placeholder="输入验证码"></el-input>
</el-col>
<el-col :span="10" style="text-align: right; padding:2px 4px">
<img @click="getCaptcha_fun()" :loading="Captcha_l" :src="loginForm.image" style="width: 98%;" alt="">
</el-col>
</el-row>
</el-form-item>
<el-form-item prop="password">
<div>
<p style="font-weight: bold; line-height: 25px" class="pointer">
......@@ -57,6 +67,7 @@
</template>
<script>
import { getCaptcha } from '@/api/user';
export default {
name: '',
......@@ -80,7 +91,11 @@ export default {
loginForm: {
name: null,
password: null,
code: '',
image: '',
key: '',
},
Captcha_l:false,
passwordType: 'password',
loginRules: {
name: [{ required: true, trigger: 'blur', validator: validateAccount }],
......@@ -91,6 +106,7 @@ export default {
};
},
mounted() {
this.getCaptcha_fun()
// if (!this.loginForm.name) {
// this.$refs.account_input.focus();
// } else if (!this.loginForm.password) {
......@@ -98,6 +114,16 @@ export default {
// }
},
methods: {
getCaptcha_fun(){
this.Captcha_l=true
getCaptcha().then(res => {
if(res.img){
this.loginForm.image=res.img
this.loginForm.key=res.key
this.Captcha_l=false
}
})
},
checkCapslock(e) {
const { key } = e;
this.capsTooltip = key && key.length === 1 && key >= 'A' && key <= 'Z';
......
......@@ -296,8 +296,12 @@ export default {
if (this.activeName == 'account') {
this.loading = true;
let data={
...this.$refs.user_login.loginForm,
password : this.$Aesencrypt(this.$refs.user_login.loginForm.password)
}
this.$store
.dispatch('user/AccountLogin', this.$refs.user_login.loginForm)
.dispatch('user/AccountLogin', data)
.then((response) => {
console.log('登录返回值' + response);
this.loading = false;
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论