Commit 3fbb0b4c54bb1418a83976ac272fa0e95c7946cf
1 parent
93b8a2b6
修复滑块验证码,存在失败的情况
Showing
8 changed files
with
16 additions
and
13 deletions
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/captcha/CaptchaController.java
| 1 | package cn.iocoder.yudao.module.system.controller.admin.captcha; | 1 | package cn.iocoder.yudao.module.system.controller.admin.captcha; |
| 2 | 2 | ||
| 3 | +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | ||
| 3 | import com.anji.captcha.model.common.ResponseModel; | 4 | import com.anji.captcha.model.common.ResponseModel; |
| 4 | import com.anji.captcha.model.vo.CaptchaVO; | 5 | import com.anji.captcha.model.vo.CaptchaVO; |
| 5 | import io.swagger.annotations.Api; | 6 | import io.swagger.annotations.Api; |
| @@ -22,19 +23,21 @@ import javax.servlet.http.HttpServletRequest; | @@ -22,19 +23,21 @@ import javax.servlet.http.HttpServletRequest; | ||
| 22 | */ | 23 | */ |
| 23 | @Api(tags = "管理后台 - 验证码") | 24 | @Api(tags = "管理后台 - 验证码") |
| 24 | @RestController("adminCaptchaController") | 25 | @RestController("adminCaptchaController") |
| 25 | -@RequestMapping("/captcha") | 26 | +@RequestMapping("/system/captcha") |
| 26 | public class CaptchaController extends com.anji.captcha.controller.CaptchaController { | 27 | public class CaptchaController extends com.anji.captcha.controller.CaptchaController { |
| 27 | 28 | ||
| 28 | @PostMapping({"/get"}) | 29 | @PostMapping({"/get"}) |
| 29 | @ApiOperation("获得验证码") | 30 | @ApiOperation("获得验证码") |
| 30 | @PermitAll | 31 | @PermitAll |
| 32 | + @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 | ||
| 31 | public ResponseModel get(@RequestBody CaptchaVO data, HttpServletRequest request) { | 33 | public ResponseModel get(@RequestBody CaptchaVO data, HttpServletRequest request) { |
| 32 | return super.get(data, request); | 34 | return super.get(data, request); |
| 33 | } | 35 | } |
| 34 | 36 | ||
| 35 | - @PostMapping({"/check"}) | 37 | + @PostMapping("/check") |
| 36 | @ApiOperation("校验验证码") | 38 | @ApiOperation("校验验证码") |
| 37 | @PermitAll | 39 | @PermitAll |
| 40 | + @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 | ||
| 38 | public ResponseModel check(@RequestBody CaptchaVO data, HttpServletRequest request) { | 41 | public ResponseModel check(@RequestBody CaptchaVO data, HttpServletRequest request) { |
| 39 | return super.check(data, request); | 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,7 +673,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod | ||
| 673 | /***/ (function(module, exports, __webpack_require__) { | 673 | /***/ (function(module, exports, __webpack_require__) { |
| 674 | 674 | ||
| 675 | "use strict"; | 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,8 +109,8 @@ yudao: | ||
| 109 | enable: true | 109 | enable: true |
| 110 | ignore-urls: | 110 | ignore-urls: |
| 111 | - /admin-api/system/tenant/get-id-by-name # 基于名字获取租户,不许带租户编号 | 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 | - /admin-api/infra/file/*/get/** # 获取图片,和租户无关 | 114 | - /admin-api/infra/file/*/get/** # 获取图片,和租户无关 |
| 115 | - /admin-api/system/sms/callback/* # 短信回调接口,无法带上租户编号 | 115 | - /admin-api/system/sms/callback/* # 短信回调接口,无法带上租户编号 |
| 116 | - /app-api/pay/order/notify/* # 支付回调通知,不携带租户编号 | 116 | - /app-api/pay/order/notify/* # 支付回调通知,不携带租户编号 |
yudao-ui-admin-uniapp/components/verifition/verifyPoint/verifyPoint.vue
| @@ -142,7 +142,7 @@ | @@ -142,7 +142,7 @@ | ||
| 142 | } | 142 | } |
| 143 | myRequest({ | 143 | myRequest({ |
| 144 | // url: `/captcha/check`, | 144 | // url: `/captcha/check`, |
| 145 | - url: '/admin-api/captcha/check', // 使用项目自定义的 /admin-api/ 前缀 | 145 | + url: '/admin-api/system/captcha/check', // 使用项目自定义的 /admin-api/ 前缀 |
| 146 | data, | 146 | data, |
| 147 | method:"POST", | 147 | method:"POST", |
| 148 | }).then(result => { | 148 | }).then(result => { |
| @@ -213,7 +213,7 @@ | @@ -213,7 +213,7 @@ | ||
| 213 | } | 213 | } |
| 214 | myRequest({ | 214 | myRequest({ |
| 215 | // url: "/captcha/get", //仅为示例,并非真实接口地址。 | 215 | // url: "/captcha/get", //仅为示例,并非真实接口地址。 |
| 216 | - url: '/admin-api/captcha/get', // 使用项目自定义的 /admin-api/ 前缀 | 216 | + url: '/admin-api/system/captcha/get', // 使用项目自定义的 /admin-api/ 前缀 |
| 217 | data, | 217 | data, |
| 218 | method:"POST", | 218 | method:"POST", |
| 219 | }).then((result) => { | 219 | }).then((result) => { |
yudao-ui-admin-uniapp/components/verifition/verifySlider/verifySlider.vue
| @@ -231,7 +231,7 @@ | @@ -231,7 +231,7 @@ | ||
| 231 | } | 231 | } |
| 232 | myRequest({ | 232 | myRequest({ |
| 233 | // url: `/captcha/check`, | 233 | // url: `/captcha/check`, |
| 234 | - url: '/admin-api/captcha/check', // 使用项目自定义的 /admin-api/ 前缀 | 234 | + url: '/admin-api/system/captcha/check', // 使用项目自定义的 /admin-api/ 前缀 |
| 235 | data, | 235 | data, |
| 236 | method: "POST", | 236 | method: "POST", |
| 237 | }).then((result) => { | 237 | }).then((result) => { |
| @@ -319,7 +319,7 @@ | @@ -319,7 +319,7 @@ | ||
| 319 | } | 319 | } |
| 320 | myRequest({ | 320 | myRequest({ |
| 321 | // url: '/captcha/get', //仅为示例,并非真实接口地址。 | 321 | // url: '/captcha/get', //仅为示例,并非真实接口地址。 |
| 322 | - url: '/admin-api/captcha/get', // 使用项目自定义的 /admin-api/ 前缀 | 322 | + url: '/admin-api/system/captcha/get', // 使用项目自定义的 /admin-api/ 前缀 |
| 323 | data, | 323 | data, |
| 324 | method: "POST", | 324 | method: "POST", |
| 325 | }).then((result) => { | 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,7 +9,7 @@ import request from './../utils/axios' //组件内部封装的axios | ||
| 9 | export function reqGet(data) { | 9 | export function reqGet(data) { |
| 10 | return request({ | 10 | return request({ |
| 11 | // url: '/captcha/get', | 11 | // url: '/captcha/get', |
| 12 | - url: '/admin-api/captcha/get', // 使用项目自定义的 /admin-api/ 前缀 | 12 | + url: '/admin-api/system/captcha/get', // 使用项目自定义的 /admin-api/ 前缀 |
| 13 | method: 'post', | 13 | method: 'post', |
| 14 | data | 14 | data |
| 15 | }) | 15 | }) |
| @@ -19,7 +19,7 @@ export function reqGet(data) { | @@ -19,7 +19,7 @@ export function reqGet(data) { | ||
| 19 | export function reqCheck(data) { | 19 | export function reqCheck(data) { |
| 20 | return request({ | 20 | return request({ |
| 21 | // url: '/captcha/check', | 21 | // url: '/captcha/check', |
| 22 | - url: '/admin-api/captcha/check', // 使用项目自定义的 /admin-api/ 前缀 | 22 | + url: '/admin-api/system/captcha/check', // 使用项目自定义的 /admin-api/ 前缀 |
| 23 | method: 'post', | 23 | method: 'post', |
| 24 | data | 24 | data |
| 25 | }) | 25 | }) |
yudao-ui-admin/src/components/Verifition/api/index.js
| @@ -9,7 +9,7 @@ import request from './../utils/axios' // 组件内部封装的axios | @@ -9,7 +9,7 @@ import request from './../utils/axios' // 组件内部封装的axios | ||
| 9 | export function reqGet(data) { | 9 | export function reqGet(data) { |
| 10 | return request({ | 10 | return request({ |
| 11 | // url: '/captcha/get', | 11 | // url: '/captcha/get', |
| 12 | - url: '/admin-api/captcha/get', // 使用项目自定义的 /admin-api/ 前缀 | 12 | + url: '/admin-api/system/captcha/get', // 使用项目自定义的 /admin-api/ 前缀 |
| 13 | method: 'post', | 13 | method: 'post', |
| 14 | data | 14 | data |
| 15 | }) | 15 | }) |
| @@ -19,7 +19,7 @@ export function reqGet(data) { | @@ -19,7 +19,7 @@ export function reqGet(data) { | ||
| 19 | export function reqCheck(data) { | 19 | export function reqCheck(data) { |
| 20 | return request({ | 20 | return request({ |
| 21 | // url: '/captcha/check', | 21 | // url: '/captcha/check', |
| 22 | - url: '/admin-api/captcha/check', // 使用项目自定义的 /admin-api/ 前缀 | 22 | + url: '/admin-api/system/captcha/check', // 使用项目自定义的 /admin-api/ 前缀 |
| 23 | method: 'post', | 23 | method: 'post', |
| 24 | data | 24 | data |
| 25 | }) | 25 | }) |