Commit 4eb9aff7 authored by qddidi's avatar qddidi

refactor: 修改获取验证码逻辑

parent 0ea7fcf2
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -154,6 +154,7 @@ export default function $axios(options) { ...@@ -154,6 +154,7 @@ export default function $axios(options) {
// 请求处理 // 请求处理
instance(options).then(res => { instance(options).then(res => {
console.log(options)
resolve(res) resolve(res)
return false return false
}).catch(error => { }).catch(error => {
......
...@@ -288,3 +288,11 @@ export const selectNoArcEventLogList = (data) => { ...@@ -288,3 +288,11 @@ export const selectNoArcEventLogList = (data) => {
data data
}) })
}; };
//获取验证码
export const getCode = (data) => {
return axios({
url: '/captcha.jpg',
method: 'post',
data
})
}
\ No newline at end of file
...@@ -4,16 +4,11 @@ ...@@ -4,16 +4,11 @@
* 通过 this.Global 调用 * 通过 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 { export default {
baseUrl, baseUrl,
baseUrl2 baseUrl2
......
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
login() { login() {
this.loading = true 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) => { this.$api.login.login(userInfo).then((res) => {
if(res.code != 200) { if(res.code != 200) {
this.$message({ this.$message({
...@@ -103,7 +103,13 @@ export default { ...@@ -103,7 +103,13 @@ export default {
}); });
}, },
refreshCaptcha: function(){ 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() { reset() {
this.$refs.loginForm.resetFields() 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