Commit 3fbb0b4c54bb1418a83976ac272fa0e95c7946cf

Authored by YunaiV
1 parent 93b8a2b6

修复滑块验证码,存在失败的情况

yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/captcha/CaptchaController.java
1 1 package cn.iocoder.yudao.module.system.controller.admin.captcha;
2 2  
  3 +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
3 4 import com.anji.captcha.model.common.ResponseModel;
4 5 import com.anji.captcha.model.vo.CaptchaVO;
5 6 import io.swagger.annotations.Api;
... ... @@ -22,19 +23,21 @@ import javax.servlet.http.HttpServletRequest;
22 23 */
23 24 @Api(tags = "管理后台 - 验证码")
24 25 @RestController("adminCaptchaController")
25   -@RequestMapping("/captcha")
  26 +@RequestMapping("/system/captcha")
26 27 public class CaptchaController extends com.anji.captcha.controller.CaptchaController {
27 28  
28 29 @PostMapping({"/get"})
29 30 @ApiOperation("获得验证码")
30 31 @PermitAll
  32 + @OperateLog(enable = false) // 避免 Post 请求被记录操作日志
31 33 public ResponseModel get(@RequestBody CaptchaVO data, HttpServletRequest request) {
32 34 return super.get(data, request);
33 35 }
34 36  
35   - @PostMapping({"/check"})
  37 + @PostMapping("/check")
36 38 @ApiOperation("校验验证码")
37 39 @PermitAll
  40 + @OperateLog(enable = false) // 避免 Post 请求被记录操作日志
38 41 public ResponseModel check(@RequestBody CaptchaVO data, HttpServletRequest request) {
39 42 return super.check(data, request);
40 43 }
... ...
yudao-server/src/main/resources/admin-ui/static/js/2.js
... ... @@ -673,7 +673,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
673 673 /***/ (function(module, exports, __webpack_require__) {
674 674  
675 675 "use strict";
676   -eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/@babel/runtime/helpers/interopRequireDefault.js\").default;\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.reqCheck = reqCheck;\nexports.reqGet = reqGet;\nvar _axios = _interopRequireDefault(__webpack_require__(/*! ./../utils/axios */ \"./src/components/Verifition/utils/axios.js\"));\n/**\n * 此处可直接引用自己项目封装好的 axios 配合后端联调\n */\n\n// 组件内部封装的axios\n// import request from \"@/api/axios.js\" //调用项目封装的axios\n\n// 获取验证图片 以及token\nfunction reqGet(data) {\n return (0, _axios.default)({\n // url: '/captcha/get',\n url: '/admin-api/captcha/get',\n // 使用项目自定义的 /admin-api/ 前缀\n method: 'post',\n data: data\n });\n}\n\n// 滑动或者点选验证\nfunction reqCheck(data) {\n return (0, _axios.default)({\n // url: '/captcha/check',\n url: '/admin-api/captcha/check',\n // 使用项目自定义的 /admin-api/ 前缀\n method: 'post',\n data: data\n });\n}\n\n//# sourceURL=webpack:///./src/components/Verifition/api/index.js?");
  676 +eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/@babel/runtime/helpers/interopRequireDefault.js\").default;\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.reqCheck = reqCheck;\nexports.reqGet = reqGet;\nvar _axios = _interopRequireDefault(__webpack_require__(/*! ./../utils/axios */ \"./src/components/Verifition/utils/axios.js\"));\n/**\n * 此处可直接引用自己项目封装好的 axios 配合后端联调\n */\n\n// 组件内部封装的axios\n// import request from \"@/api/axios.js\" //调用项目封装的axios\n\n// 获取验证图片 以及token\nfunction reqGet(data) {\n return (0, _axios.default)({\n // url: '/captcha/get',\n url: '/admin-api/system/captcha/get',\n // 使用项目自定义的 /admin-api/ 前缀\n method: 'post',\n data: data\n });\n}\n\n// 滑动或者点选验证\nfunction reqCheck(data) {\n return (0, _axios.default)({\n // url: '/captcha/check',\n url: '/admin-api/system/captcha/check',\n // 使用项目自定义的 /admin-api/ 前缀\n method: 'post',\n data: data\n });\n}\n\n//# sourceURL=webpack:///./src/components/Verifition/api/index.js?");
677 677  
678 678 /***/ }),
679 679  
... ...
yudao-server/src/main/resources/admin-ui/static/js/2.js.gz
No preview for this file type
yudao-server/src/main/resources/application.yaml
... ... @@ -109,8 +109,8 @@ yudao:
109 109 enable: true
110 110 ignore-urls:
111 111 - /admin-api/system/tenant/get-id-by-name # 基于名字获取租户,不许带租户编号
112   - - /admin-api/captcha/get # 获取图片验证码,和租户无关
113   - - /admin-api/captcha/check # 校验图片验证码,和租户无关
  112 + - /admin-api/system/captcha/get # 获取图片验证码,和租户无关
  113 + - /admin-api/system/captcha/check # 校验图片验证码,和租户无关
114 114 - /admin-api/infra/file/*/get/** # 获取图片,和租户无关
115 115 - /admin-api/system/sms/callback/* # 短信回调接口,无法带上租户编号
116 116 - /app-api/pay/order/notify/* # 支付回调通知,不携带租户编号
... ...
yudao-ui-admin-uniapp/components/verifition/verifyPoint/verifyPoint.vue
... ... @@ -142,7 +142,7 @@
142 142 }
143 143 myRequest({
144 144 // url: `/captcha/check`,
145   - url: '/admin-api/captcha/check', // 使用项目自定义的 /admin-api/ 前缀
  145 + url: '/admin-api/system/captcha/check', // 使用项目自定义的 /admin-api/ 前缀
146 146 data,
147 147 method:"POST",
148 148 }).then(result => {
... ... @@ -213,7 +213,7 @@
213 213 }
214 214 myRequest({
215 215 // url: "/captcha/get", //仅为示例,并非真实接口地址。
216   - url: '/admin-api/captcha/get', // 使用项目自定义的 /admin-api/ 前缀
  216 + url: '/admin-api/system/captcha/get', // 使用项目自定义的 /admin-api/ 前缀
217 217 data,
218 218 method:"POST",
219 219 }).then((result) => {
... ...
yudao-ui-admin-uniapp/components/verifition/verifySlider/verifySlider.vue
... ... @@ -231,7 +231,7 @@
231 231 }
232 232 myRequest({
233 233 // url: `/captcha/check`,
234   - url: '/admin-api/captcha/check', // 使用项目自定义的 /admin-api/ 前缀
  234 + url: '/admin-api/system/captcha/check', // 使用项目自定义的 /admin-api/ 前缀
235 235 data,
236 236 method: "POST",
237 237 }).then((result) => {
... ... @@ -319,7 +319,7 @@
319 319 }
320 320 myRequest({
321 321 // url: '/captcha/get', //仅为示例,并非真实接口地址。
322   - url: '/admin-api/captcha/get', // 使用项目自定义的 /admin-api/ 前缀
  322 + url: '/admin-api/system/captcha/get', // 使用项目自定义的 /admin-api/ 前缀
323 323 data,
324 324 method: "POST",
325 325 }).then((result) => {
... ...
yudao-ui-admin-vue3/src/components/Verifition/src/api/index.ts
... ... @@ -9,7 +9,7 @@ import request from './../utils/axios' //组件内部封装的axios
9 9 export function reqGet(data) {
10 10 return request({
11 11 // url: '/captcha/get',
12   - url: '/admin-api/captcha/get', // 使用项目自定义的 /admin-api/ 前缀
  12 + url: '/admin-api/system/captcha/get', // 使用项目自定义的 /admin-api/ 前缀
13 13 method: 'post',
14 14 data
15 15 })
... ... @@ -19,7 +19,7 @@ export function reqGet(data) {
19 19 export function reqCheck(data) {
20 20 return request({
21 21 // url: '/captcha/check',
22   - url: '/admin-api/captcha/check', // 使用项目自定义的 /admin-api/ 前缀
  22 + url: '/admin-api/system/captcha/check', // 使用项目自定义的 /admin-api/ 前缀
23 23 method: 'post',
24 24 data
25 25 })
... ...
yudao-ui-admin/src/components/Verifition/api/index.js
... ... @@ -9,7 +9,7 @@ import request from './../utils/axios' // 组件内部封装的axios
9 9 export function reqGet(data) {
10 10 return request({
11 11 // url: '/captcha/get',
12   - url: '/admin-api/captcha/get', // 使用项目自定义的 /admin-api/ 前缀
  12 + url: '/admin-api/system/captcha/get', // 使用项目自定义的 /admin-api/ 前缀
13 13 method: 'post',
14 14 data
15 15 })
... ... @@ -19,7 +19,7 @@ export function reqGet(data) {
19 19 export function reqCheck(data) {
20 20 return request({
21 21 // url: '/captcha/check',
22   - url: '/admin-api/captcha/check', // 使用项目自定义的 /admin-api/ 前缀
  22 + url: '/admin-api/system/captcha/check', // 使用项目自定义的 /admin-api/ 前缀
23 23 method: 'post',
24 24 data
25 25 })
... ...