From 7083d991fe2a99ebdd995992ceb4c21a5f1f9a9a Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Thu, 17 Nov 2022 10:37:23 +0800 Subject: [PATCH] refactor: verify --- yudao-ui-admin/src/api/login.js | 18 ++++++++++++ .../src/components/RightToolbar/index.vue | 4 +-- .../Verifition/Verify/VerifyPoints.vue | 2 +- .../Verifition/Verify/VerifySlide.vue | 2 +- .../src/components/Verifition/api/index.js | 27 ----------------- .../src/components/Verifition/utils/axios.js | 29 ------------------- .../src/views/mall/trade/order/detail.vue | 2 +- .../src/views/mall/trade/order/index.vue | 2 +- 8 files changed, 24 insertions(+), 62 deletions(-) delete mode 100644 yudao-ui-admin/src/components/Verifition/api/index.js delete mode 100644 yudao-ui-admin/src/components/Verifition/utils/axios.js diff --git a/yudao-ui-admin/src/api/login.js b/yudao-ui-admin/src/api/login.js index b34d98d29..614a11fcb 100644 --- a/yudao-ui-admin/src/api/login.js +++ b/yudao-ui-admin/src/api/login.js @@ -126,5 +126,23 @@ export function authorize(responseType, clientId, redirectUri, state, }) } +// 获取验证图片 以及token +export function reqGet(data) { + return request({ + url: 'system/captcha/get', + method: 'post', + data + }) +} + +// 滑动或者点选验证 +export function reqCheck(data) { + return request({ + url: '/system/captcha/check', + method: 'post', + data + }) +} + export class socialBindLogin { } diff --git a/yudao-ui-admin/src/components/RightToolbar/index.vue b/yudao-ui-admin/src/components/RightToolbar/index.vue index e3a95f05c..12562917b 100644 --- a/yudao-ui-admin/src/components/RightToolbar/index.vue +++ b/yudao-ui-admin/src/components/RightToolbar/index.vue @@ -92,13 +92,13 @@ export default { }; diff --git a/yudao-ui-admin/src/components/Verifition/Verify/VerifyPoints.vue b/yudao-ui-admin/src/components/Verifition/Verify/VerifyPoints.vue index 72a71d9aa..4927ccacd 100644 --- a/yudao-ui-admin/src/components/Verifition/Verify/VerifyPoints.vue +++ b/yudao-ui-admin/src/components/Verifition/Verify/VerifyPoints.vue @@ -60,7 +60,7 @@ * */ import { resetSize } from './../utils/util' import { aesEncrypt } from '@/utils/ase' -import { reqGet, reqCheck } from './../api/index' +import { reqGet, reqCheck } from '@/api/login' export default { name: 'VerifyPoints', diff --git a/yudao-ui-admin/src/components/Verifition/Verify/VerifySlide.vue b/yudao-ui-admin/src/components/Verifition/Verify/VerifySlide.vue index 90d538e3f..a1cac7d7d 100644 --- a/yudao-ui-admin/src/components/Verifition/Verify/VerifySlide.vue +++ b/yudao-ui-admin/src/components/Verifition/Verify/VerifySlide.vue @@ -64,7 +64,7 @@ * */ import { aesEncrypt } from '@/utils/ase' import { resetSize } from './../utils/util' -import { reqGet, reqCheck } from './../api/index' +import { reqGet, reqCheck } from '@/api/login' // "captchaType":"blockPuzzle", export default { diff --git a/yudao-ui-admin/src/components/Verifition/api/index.js b/yudao-ui-admin/src/components/Verifition/api/index.js deleted file mode 100644 index 7c5a94094..000000000 --- a/yudao-ui-admin/src/components/Verifition/api/index.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 此处可直接引用自己项目封装好的 axios 配合后端联调 - */ - -import request from './../utils/axios' // 组件内部封装的axios -// import request from "@/api/axios.js" //调用项目封装的axios - -// 获取验证图片 以及token -export function reqGet(data) { - return request({ - // url: '/captcha/get', - url: '/admin-api/system/captcha/get', // 使用项目自定义的 /admin-api/ 前缀 - method: 'post', - data - }) -} - -// 滑动或者点选验证 -export function reqCheck(data) { - return request({ - // url: '/captcha/check', - url: '/admin-api/system/captcha/check', // 使用项目自定义的 /admin-api/ 前缀 - method: 'post', - data - }) -} - diff --git a/yudao-ui-admin/src/components/Verifition/utils/axios.js b/yudao-ui-admin/src/components/Verifition/utils/axios.js deleted file mode 100644 index 2f960bb54..000000000 --- a/yudao-ui-admin/src/components/Verifition/utils/axios.js +++ /dev/null @@ -1,29 +0,0 @@ -import axios from 'axios' - -axios.defaults.baseURL = process.env.VUE_APP_BASE_API - -const service = axios.create({ - timeout: 40000, - headers: { - 'X-Requested-With': 'XMLHttpRequest', - 'Content-Type': 'application/json; charset=UTF-8' - }, -}) -service.interceptors.request.use( - config => { - return config - }, - error => { - Promise.reject(error) - } -) - -// response interceptor -service.interceptors.response.use( - response => { - return response.data - }, - error => { - } -) -export default service diff --git a/yudao-ui-admin/src/views/mall/trade/order/detail.vue b/yudao-ui-admin/src/views/mall/trade/order/detail.vue index 4e50d8f41..7581f4148 100644 --- a/yudao-ui-admin/src/views/mall/trade/order/detail.vue +++ b/yudao-ui-admin/src/views/mall/trade/order/detail.vue @@ -244,7 +244,7 @@ export default {