Vue_ Error in v-on handler (Promise_async)_ “Error_ Request failed with status code 404

本文探讨如何处理前端发送的JSON数据,当其键值对与后端自定义对象不匹配,以及类型转换错误的情况,提供调优和适配策略。

后端使用了JSON接收,当接收的@responseBody是使用自定义对象时

1、前端传输的key对应不上自定义的对象的key(后端找不到key)

2、或者是key所对应的value的数据类型出错(后端定义为String前端传值为Integer)

PS C:\fcube-app\W11.F-CUBE-A-APP\CL_CSM\src\main\webapp> npm install Debugger attached. npm warn deprecated lodash.template@4.5.0: This package is deprecated. Use https://socket.dev/npm/package/eta instead. npm warn deprecated shvl@2.0.3: older versions vulnerable to prototype pollution npm warn deprecated docsearch.js@2.6.3: This package has been deprecated and is no longer maintained. Please use @docsearch/js. npm warn deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility npm warn deprecated q@1.5.1: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other. npm warn deprecated npm warn deprecated (For a CapTP with native promises, see @endo/eventual-send and @endo/captp) npm warn deprecated figgy-pudding@3.5.2: This module is no longer supported. npm warn deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm warn deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm warn deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated npm warn deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm warn deprecated har-validator@5.1.5: this library is no longer supported npm warn deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x. npm warn deprecated gauge@2.7.4: This package is no longer supported. npm warn deprecated osenv@0.1.5: This package is no longer supported. npm warn deprecated are-we-there-yet@1.1.7: This package is no longer supported. npm warn deprecated npmlog@4.1.2: This package is no longer supported. npm warn deprecated fstream@1.0.12: This package is no longer supported. npm warn deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap. npm warn deprecated fs-write-stream-atomic@1.0.10: This package is no longer supported. npm warn deprecated copy-concurrently@1.0.5: This package is no longer supported. npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm warn deprecated move-concurrently@1.0.1: This package is no longer supported. npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated consolidate@0.15.1: Please upgrade to consolidate v1.0.0+ as it has been modernized with several long-awaited fixes implemented. Maintenance is supported by Forward Email at https://forwardemail.net ; follow/watch https://github.com/ladjs/consolidate for updates and release changelog npm warn deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained npm warn deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained npm warn deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142 npm warn deprecated @hapi/joi@15.1.1: Switch to 'npm install joi' npm warn deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained npm warn deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm warn deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address' npm warn deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated npm warn deprecated webpack-chain@4.12.1: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm warn deprecated html-webpack-plugin@3.2.0: 3.x is no longer supported npm warn deprecated highlight.js@9.18.5: Support has ended for 9.x series. Upgrade to @latest npm warn deprecated @babel/plugin-proposal-async-generator-functions@7.20.7: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead. npm warn deprecated @babel/plugin-proposal-optional-catch-binding@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-catch-binding instead. npm warn deprecated @babel/plugin-proposal-json-strings@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-json-strings instead. npm warn deprecated @babel/plugin-proposal-unicode-property-regex@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-unicode-property-regex instead. npm warn deprecated @babel/plugin-proposal-object-rest-spread@7.20.7: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead. npm warn deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead. npm warn deprecated vuex-persistedstate@3.2.1: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm warn deprecated vue-i18n@8.28.2: Vue I18n v8.x has reached EOL and is no longer actively maintained. About maintenance status, see https://vue-i18n.intlify.dev/guide/maintenance.html npm warn deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates. npm warn deprecated eslint-loader@3.0.4: This loader has been deprecated. Please use eslint-webpack-plugin npm warn deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. npm warn deprecated node-sass@4.14.1: Node Sass is no longer supported. Please use `sass` or `sass-embedded` instead. npm warn deprecated axios@0.19.2: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410 npm warn deprecated eslint@5.16.0: This version is no longer supported. Please see https://eslint.org/version-support for other options. npm warn deprecated iscroll@5.2.0: deprecated npm warn deprecated mkdirp@0.3.0: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.) npm warn deprecated webpack-chain@6.5.1: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm warn deprecated glob@7.1.7: Glob versions prior to v9 are no longer supported npm warn deprecated vue@2.7.16: Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details. npm warn deprecated rimraf@2.6.3: Rimraf versions prior to v4 are no longer supported npm warn deprecated webpack-chain@6.5.1: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm warn cleanup Failed to remove some directories [ npm warn cleanup [ npm warn cleanup '\\\\?\\C:\\fcube-app\\W11.F-CUBE-A-APP\\CL_CSM\\src\\main\\webapp\\node_modules', npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\fcube-app\W11.F-CUBE-A-APP\CL_CSM\src\main\webapp\node_modules\@hapi'] { npm warn cleanup errno: -4048, npm warn cleanup code: 'EPERM', npm warn cleanup syscall: 'rmdir', npm warn cleanup path: 'C:\\fcube-app\\W11.F-CUBE-A-APP\\CL_CSM\\src\\main\\webapp\\node_modules\\@hapi' npm warn cleanup } npm warn cleanup ], npm warn cleanup [ npm warn cleanup '\\\\?\\C:\\fcube-app\\W11.F-CUBE-A-APP\\CL_CSM\\src\\main\\webapp\\node_modules\\@vue', npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\fcube-app\W11.F-CUBE-A-APP\CL_CSM\src\main\webapp\node_modules\@vue\compiler-core\node_modules'] { npm warn cleanup errno: -4048, npm warn cleanup code: 'EPERM', npm warn cleanup syscall: 'rmdir', npm warn cleanup path: 'C:\\fcube-app\\W11.F-CUBE-A-APP\\CL_CSM\\src\\main\\webapp\\node_modules\\@vue\\compiler-core\\node_modules' npm warn cleanup } npm warn cleanup ], npm warn cleanup [ npm warn cleanup '\\\\?\\C:\\fcube-app\\W11.F-CUBE-A-APP\\CL_CSM\\src\\main\\webapp\\node_modules\\@vuepress', npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\fcube-app\W11.F-CUBE-A-APP\CL_CSM\src\main\webapp\node_modules\@vuepress'] { npm warn cleanup errno: -4048, npm warn cleanup code: 'EPERM', npm warn cleanup syscall: 'rmdir', npm warn cleanup path: 'C:\\fcube-app\\W11.F-CUBE-A-APP\\CL_CSM\\src\\main\\webapp\\node_modules\\@vuepress' npm warn cleanup } npm warn cleanup ] npm warn cleanup ] npm error code 1 npm error path C:\fcube-app\W11.F-CUBE-A-APP\CL_CSM\src\main\webapp\node_modules\node-sass npm error command failed npm error command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js npm error Building: C:\Program Files\nodejs\node.exe C:\fcube-app\W11.F-CUBE-A-APP\CL_CSM\src\main\webapp\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library= npm error Debugger attached. npm error Debugger attached. npm error gyp info it worked if it ends with ok npm error gyp verb cli [ npm error gyp verb cli 'C:\\Program Files\\nodejs\\node.exe', npm error gyp verb cli 'C:\\fcube-app\\W11.F-CUBE-A-APP\\CL_CSM\\src\\main\\webapp\\node_modules\\node-gyp\\bin\\node-gyp.js', npm error gyp verb cli 'rebuild', npm error gyp verb cli '--verbose', npm error gyp verb cli '--libsass_ext=', npm error gyp verb cli '--libsass_cflags=', npm error gyp verb cli '--libsass_ldflags=', npm error gyp verb cli '--libsass_library=' npm error gyp verb cli ] npm error gyp info using node-gyp@3.8.0 npm error gyp info using node@24.3.0 | win32 | x64 npm error gyp verb command rebuild [] npm error gyp verb command clean [] npm error gyp verb clean removing "build" directory npm error gyp verb command configure [] npm error gyp verb check python checking for Python executable "python2" in the PATH npm error gyp verb `which` failed Error: not found: python2 npm error gyp verb `which` failed at getNotFoundError (C:\fcube-app\W11.F-CUBE-A-APP\CL_CSM\src\main\webapp\node_modules\which\which.js:13:12) npm error gyp verb `which` failed at F (C:\fcube-app\W11.F-CUBE-A-APP\CL_CSM\src\main\webapp\node_modules\which\which.js:68:19) npm error gyp verb `which` failed at E (C:\fcube-app\W11.F-CUBE-A-APP\CL_CSM\src\main\webapp\node_modules\which\which.js:80:29) npm error gyp verb `which` failed at C:\fcube-app\W11.F-CUBE-A-APP\CL_CSM\src\main\webapp\node_modules\which\which.js:89:16 npm error gyp verb `which` failed at C:\fcube-app\W11.F-CUBE-A-APP\CL_CSM\src\main\webapp\node_modules\isexe\index.js:42:5 npm error gyp verb `which` failed at C:\fcube-app\W11.F-CUBE-A-APP\CL_CSM\src\main\webapp\node_modules\isexe\windows.js:36:5 npm error gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:189:21) npm error gyp verb `which` failed python2 Error: not found: python2 npm error gyp verb `which` failed at getNotFoundError (C:\fcube-app\W11.F-CUBE-A-APP\CL_CSM\src\main\webapp\node_modules\which\which.js:13:12) npm error gyp verb `which` failed at F (C:\fcube-app\W11.F-CUBE-A-APP\CL_CSM\src\main\webapp\node_modules\which\which.js:68:19) npm error gyp verb `which` failed at E (C:\fcube-app\W11.F-CUBE-A-APP\CL_CSM\src\main\webapp\node_modules\which\which.js:80:29) npm error gyp verb `which` failed at C:\fcube-app\W11.F-CUBE-A-APP\CL_CSM\src\main\webapp\node_modules\which\which.js:89:16 npm error gyp verb `which` failed at C:\fcube-app\W11.F-CUBE-A-APP\CL_CSM\src\main\webapp\node_modules\isexe\index.js:42:5 npm error gyp verb `which` failed at C:\fcube-app\W11.F-CUBE-A-APP\CL_CSM\src\main\webapp\node_modules\isexe\windows.js:36:5 npm error gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:189:21) { npm error gyp verb `which` failed code: 'ENOENT' npm error gyp verb `which` failed } npm error gyp verb check python checking for Python executable "python" in the PATH npm error gyp verb `which` succeeded python C:\Python313\python.EXE npm error (node:3656) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead. npm error (Use `node --trace-deprecation ...` to show where the warning was created) npm error gyp ERR! configure error npm error gyp ERR! stack Error: Command failed: C:\Python313\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3]; npm error gyp ERR! stack File "<string>", line 1 npm error gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3]; npm error gyp ERR! stack ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ npm error gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)? npm error gyp ERR! stack npm error gyp ERR! stack at genericNodeError (node:internal/errors:983:15) npm error gyp ERR! stack at wrappedFn (node:internal/errors:537:14) npm error gyp ERR! stack at ChildProcess.exithandler (node:child_process:415:12) npm error gyp ERR! stack at ChildProcess.emit (node:events:507:28) npm error gyp ERR! stack at maybeClose (node:internal/child_process:1101:16) npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:305:5) npm error gyp ERR! System Windows_NT 10.0.26100 npm error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\fcube-app\\W11.F-CUBE-A-APP\\CL_CSM\\src\\main\\webapp\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" npm error gyp ERR! cwd C:\fcube-app\W11.F-CUBE-A-APP\CL_CSM\src\main\webapp\node_modules\node-sass npm error gyp ERR! node -v v24.3.0 npm error gyp ERR! node-gyp -v v3.8.0 npm error gyp ERR! not ok npm error Waiting for the debugger to disconnect... npm error Build failed with error code: 1 npm error Waiting for the debugger to disconnect... npm error A complete log of this run can be found in: D:\node\node_cache\_logs\2025-08-22T05_02_59_796Z-debug-0.log Waiting for the debugger to disconnect...
最新发布
08-23
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值