态势感知平台-账号密码登录及验证码接口对接治理平台登录接口
This commit is contained in:
@@ -1,8 +1,22 @@
|
||||
import request from '@/utils/request';
|
||||
import axios from 'axios';
|
||||
|
||||
export const getCaptcha = (account: any, password: any) => {
|
||||
return request({
|
||||
url: `/u-auth/index/getCaptcha`,
|
||||
// export const getCaptcha = (account: any, password: any) => {
|
||||
// return request({
|
||||
// url: `/u-auth/index/getCaptcha`,
|
||||
// method: 'POST',
|
||||
// data: {
|
||||
// account,
|
||||
// password,
|
||||
// loginCode: 'admin'
|
||||
// },
|
||||
// responseType: 'blob'
|
||||
// });
|
||||
// };
|
||||
|
||||
export function getCaptcha(account: any, password: any) {
|
||||
return axios.request({
|
||||
url: `/gateway/u-auth/index/getCaptcha`,
|
||||
method: 'POST',
|
||||
data: {
|
||||
account,
|
||||
@@ -11,7 +25,8 @@ export const getCaptcha = (account: any, password: any) => {
|
||||
},
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export const login = (account: any, code: any, password: any) => {
|
||||
return request({
|
||||
url: `/u-auth/index/login`,
|
||||
|
||||
@@ -146,6 +146,8 @@ import {
|
||||
import { useRouter } from "vue-router";
|
||||
// 引入页面2风格的接口逻辑
|
||||
import { getCaptcha, login } from "@/api/jyh/auth";
|
||||
import getRsaCode from '@/utils/jsencrypt';
|
||||
import { useAccountStore } from '@/stores/user';
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
modelValue: boolean;
|
||||
@@ -252,12 +254,12 @@ const handleLogin = async () => {
|
||||
return;
|
||||
}
|
||||
Message.error(res.data.msg);
|
||||
formModel.code = '';
|
||||
loginForm.code = '';
|
||||
getCaptchaUrl();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
formModel.code = '';
|
||||
loginForm.code = '';
|
||||
getCaptchaUrl();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user