上传图片组件报错问题

来源:5-2 新增期刊内容

早春暮春_酒暖花深

2023-12-04 17:57

上传图片前台报“服务器位置错误”,看后台日志报错


2023-12-04 17:56:40,660 ERROR 72759  --- [3c06302cde41] - nodejs.TypeError: Cannot read property 'path' of null

    at LocalUploader.upload (/Users/xx/Study/lin-cms-koa/app/extensions/file/local-uploader.js:56:23)

    at /Users/xx/Study/lin-cms-koa/app/api/cms/file.js:16:15

    at loginRequired (/Users/xx/Study/lin-cms-koa/app/middleware/jwt.js:73:5)

    at exports.log (/Users/xx/Study/lin-cms-koa/node_modules/lin-mizar/lin/middleware/log.js:14:9)

    at /Users/xx/Study/lin-cms-koa/node_modules/koa-mount/index.js:52:26

    at bodyParser (/Users/xx/Study/lin-cms-koa/node_modules/koa-bodyparser/index.js:78:5)


写回答 关注

1回答

  • 早春暮春_酒暖花深
    2023-12-04 18:02:26

    找到大佬回复了:

    local-uploader.js 修改第 56行代码为 saved.path

    https://img1.sycdn.imooc.com/656da3a900018b9317040728.jpg

0到1快速构建自己的后台管理系统

开源框架LIN-CMS+NodeJS+Vue 快速构建UI好看+功能便捷的后台管理系统

21499 学习 · 145 问题

查看课程

相似问题