Commit 4eb9aff7 authored by qddidi's avatar qddidi

refactor: 修改获取验证码逻辑

parent 0ea7fcf2
This diff is collapsed.
......@@ -154,6 +154,7 @@ export default function $axios(options) {
// 请求处理
instance(options).then(res => {
console.log(options)
resolve(res)
return false
}).catch(error => {
......
......@@ -288,3 +288,11 @@ export const selectNoArcEventLogList = (data) => {
data
})
};
//获取验证码
export const getCode = (data) => {
return axios({
url: '/captcha.jpg',
method: 'post',
data
})
}
\ No newline at end of file
......@@ -4,16 +4,11 @@
* 通过 this.Global 调用
*/
// 后台管理系统服务器地址
// export const baseUrl2 = 'http://xclc.rensheju.com'
//export const baseUrl = 'http://xc.rensheju.com'
// export const baseUrl2 = 'http://xclc.rensheju.com'
// //export const baseUrl = 'http://xc.rensheju.com'
// export const baseUrl = 'http://172.16.10.33:9002'
export const baseUrl = 'http://xc.rensheju.com'
export const baseUrl2 = 'http://xclc.rensheju.com'
export const baseUrl = 'http://xc.rensheju.com'
// export const baseUrl2 = 'http://xclc.rensheju.com'
//export const baseUrl = 'http://172.16.10.33:9002'
export const baseUrl2 = 'http://xclc.rensheju.com'
export default {
baseUrl,
baseUrl2
......
......@@ -81,7 +81,7 @@ export default {
login() {
this.loading = true
let userInfo = {account:this.loginForm.account, password:this.loginForm.password, captcha:this.loginForm.captcha}
let userInfo = {account:this.loginForm.account, password:this.loginForm.password,kaptchasessionkey:sessionStorage.getItem("KAPTCHA_SESSION_KEY"), captcha:this.loginForm.captcha}
this.$api.login.login(userInfo).then((res) => {
if(res.code != 200) {
this.$message({
......@@ -103,7 +103,13 @@ export default {
});
},
refreshCaptcha: function(){
this.loginForm.src = this.global.baseUrl + "/captcha.jpg?t=" + new Date().getTime();
this.$api.getlist.getCode().then((res) => {
this.loginForm.src=`data:image/jpg;base64,${res.data.img}`
sessionStorage.setItem('KAPTCHA_SESSION_KEY',res.data.KAPTCHA_SESSION_KEY)
}).catch((res) => {
});
//this.loginForm.src = this.global.baseUrl + "/captcha.jpg?t=" + new Date().getTime();
},
reset() {
this.$refs.loginForm.resetFields()
......
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