Browse Source

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

YunaiV 2 years ago
parent
commit
3fbb0b4c54

+ 5 - 2
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/captcha/CaptchaController.java

@@ -1,5 +1,6 @@
 package cn.iocoder.yudao.module.system.controller.admin.captcha;
 
+import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
 import com.anji.captcha.model.common.ResponseModel;
 import com.anji.captcha.model.vo.CaptchaVO;
 import io.swagger.annotations.Api;
@@ -22,19 +23,21 @@ import javax.servlet.http.HttpServletRequest;
  */
 @Api(tags = "管理后台 - 验证码")
 @RestController("adminCaptchaController")
-@RequestMapping("/captcha")
+@RequestMapping("/system/captcha")
 public class CaptchaController extends com.anji.captcha.controller.CaptchaController {
 
     @PostMapping({"/get"})
     @ApiOperation("获得验证码")
     @PermitAll
+    @OperateLog(enable = false) // 避免 Post 请求被记录操作日志
     public ResponseModel get(@RequestBody CaptchaVO data, HttpServletRequest request) {
         return super.get(data, request);
     }
 
-    @PostMapping({"/check"})
+    @PostMapping("/check")
     @ApiOperation("校验验证码")
     @PermitAll
+    @OperateLog(enable = false) // 避免 Post 请求被记录操作日志
     public ResponseModel check(@RequestBody CaptchaVO data, HttpServletRequest request) {
         return super.check(data, request);
     }

+ 1 - 1
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
 /***/ (function(module, exports, __webpack_require__) {
 
 "use strict";
-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?");
+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?");
 
 /***/ }),
 

BIN
yudao-server/src/main/resources/admin-ui/static/js/2.js.gz


+ 2 - 2
yudao-server/src/main/resources/application.yaml

@@ -109,8 +109,8 @@ yudao:
     enable: true
     ignore-urls:
       - /admin-api/system/tenant/get-id-by-name # 基于名字获取租户,不许带租户编号
-      - /admin-api/captcha/get # 获取图片验证码,和租户无关
-      - /admin-api/captcha/check # 校验图片验证码,和租户无关
+      - /admin-api/system/captcha/get # 获取图片验证码,和租户无关
+      - /admin-api/system/captcha/check # 校验图片验证码,和租户无关
       - /admin-api/infra/file/*/get/** # 获取图片,和租户无关
       - /admin-api/system/sms/callback/* # 短信回调接口,无法带上租户编号
       - /app-api/pay/order/notify/* # 支付回调通知,不携带租户编号

+ 2 - 2
yudao-ui-admin-uniapp/components/verifition/verifyPoint/verifyPoint.vue

@@ -142,7 +142,7 @@
                             }
                             myRequest({
                                 // url: `/captcha/check`,
-                                url: '/admin-api/captcha/check', // 使用项目自定义的 /admin-api/ 前缀
+                                url: '/admin-api/system/captcha/check', // 使用项目自定义的 /admin-api/ 前缀
                                 data,
                                 method:"POST",
                             }).then(result => {
@@ -213,7 +213,7 @@
                 }
                 myRequest({
                     // url: "/captcha/get", //仅为示例,并非真实接口地址。
-                    url: '/admin-api/captcha/get', // 使用项目自定义的 /admin-api/ 前缀
+                    url: '/admin-api/system/captcha/get', // 使用项目自定义的 /admin-api/ 前缀
                     data,
                     method:"POST",
                 }).then((result) => {

+ 2 - 2
yudao-ui-admin-uniapp/components/verifition/verifySlider/verifySlider.vue

@@ -231,7 +231,7 @@
 						}
 						myRequest({
 							// url: `/captcha/check`,
-              url: '/admin-api/captcha/check', // 使用项目自定义的 /admin-api/ 前缀
+              url: '/admin-api/system/captcha/check', // 使用项目自定义的 /admin-api/ 前缀
               data,
 							method: "POST",
 						}).then((result) => {
@@ -319,7 +319,7 @@
 				}
 				myRequest({
 					// url: '/captcha/get', //仅为示例,并非真实接口地址。
-					url: '/admin-api/captcha/get', // 使用项目自定义的 /admin-api/ 前缀
+					url: '/admin-api/system/captcha/get', // 使用项目自定义的 /admin-api/ 前缀
 					data,
 					method: "POST",
 				}).then((result) => {

+ 2 - 2
yudao-ui-admin-vue3/src/components/Verifition/src/api/index.ts

@@ -9,7 +9,7 @@ import request from './../utils/axios' //组件内部封装的axios
 export function reqGet(data) {
   return request({
     // url: '/captcha/get',
-    url: '/admin-api/captcha/get', // 使用项目自定义的 /admin-api/ 前缀
+    url: '/admin-api/system/captcha/get', // 使用项目自定义的 /admin-api/ 前缀
     method: 'post',
     data
   })
@@ -19,7 +19,7 @@ export function reqGet(data) {
 export function reqCheck(data) {
   return request({
     // url: '/captcha/check',
-    url: '/admin-api/captcha/check', // 使用项目自定义的 /admin-api/ 前缀
+    url: '/admin-api/system/captcha/check', // 使用项目自定义的 /admin-api/ 前缀
     method: 'post',
     data
   })

+ 2 - 2
yudao-ui-admin/src/components/Verifition/api/index.js

@@ -9,7 +9,7 @@ import request from './../utils/axios' // 组件内部封装的axios
 export function reqGet(data) {
   return request({
     // url: '/captcha/get',
-    url: '/admin-api/captcha/get', // 使用项目自定义的 /admin-api/ 前缀
+    url: '/admin-api/system/captcha/get', // 使用项目自定义的 /admin-api/ 前缀
     method: 'post',
     data
   })
@@ -19,7 +19,7 @@ export function reqGet(data) {
 export function reqCheck(data) {
   return request({
     // url: '/captcha/check',
-    url: '/admin-api/captcha/check', // 使用项目自定义的 /admin-api/ 前缀
+    url: '/admin-api/system/captcha/check', // 使用项目自定义的 /admin-api/ 前缀
     method: 'post',
     data
   })