Rabithua / memos_wmp

The WeChat Mini Program version of the open-source project "usememos/memos" can be converted into an app. memos的微信小程序版本,可以转化为app
https://memos.wowow.club/
MIT License
341 stars 44 forks source link

微信小程序图片无法展示,状态码:401。网页端图片可以正常显示 #70

Open BYFire opened 10 months ago

BYFire commented 10 months ago

memos docker方式部署。通过nginx-proxy-manager反向代理。浏览器访问正常。小程序访问文字可以显示,图片资源无法展示。

以下是微信开发调试访问图片资源请求及响应

General Request URL: https://sub.domain.com/o/r/4 Request Method: GET Status Code: 401 Remote Address: ...:443 Referrer Policy: unsafe-url

Request Headers :authority: :method: GET :path: /o/r/4 :scheme: https accept: image/avif,image/webp,image/apng,image/svg+xml,image/,/;q=0.8 accept-encoding: gzip, deflate, br referer: https://servicewechat.com/**/devtools/page-frame.html sec-fetch-dest: image sec-fetch-mode: no-cors sec-fetch-site: cross-site user-agent: Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.3 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1 wechatdevtools/1.06.2307260 MicroMessenger/8.0.5 Language/zh_CN webview/5 desktopapp miniprogram port/29181 token/f998a8657c2fb657ed9800bdb930f495 runtime/2

Response Headers access-control-allow-origin: * content-length: 111 content-type: application/json; charset=UTF-8 date: Tue, 23 Jan 2024 07:38:27 GMT server: openresty vary: Origin

Rabithua commented 10 months ago

1.需要在微信后台request域名添加图片的域名 2.还有图片托管防盗链设置添加servicewechat.com(如果有的话)

BYFire commented 10 months ago

1.需要在微信后台request域名添加图片的域名 域名配置正确 2.还有图片托管防盗链设置添加servicewechat.com(如果有的话)未配置

memos服务响应有点奇怪 私有笔记图片无法提示可见性异常。感觉少了用户信息 {"time":"2024-01-23T09:36:13Z","latency":"137.985µs","method":"GET","uri":"/api/v1/user/me","status":200,"error":""} {"time":"2024-01-23T09:36:13Z","latency":"303.903µs","method":"GET","uri":"/api/v1/tag","status":200,"error":""} {"time":"2024-01-23T09:36:13Z","latency":"602.574µs","method":"GET","uri":"/api/v1/memo/stats?creatorId=2","status":200,"error":""} {"time":"2024-01-23T09:36:14Z","latency":"4.552892ms","method":"GET","uri":"/api/v1/memo?rowStatus=NORMAL&limit=20&offset=0","status":200,"error":""} {"time":"2024-01-23T09:36:14Z","latency":"1.786138ms","method":"GET","uri":"/o/r/4","status":401,"error":"code=401, message=Resource visibility not match"} {"time":"2024-01-23T09:36:14Z","latency":"2.36757ms","method":"GET","uri":"/o/r/7","status":200,"error":""} {"time":"2024-01-23T09:36:14Z","latency":"3.579709ms","method":"GET","uri":"/o/r/5","status":401,"error":"code=401, message=Resource visibility not match"} {"time":"2024-01-23T09:36:14Z","latency":"17.234484ms","method":"GET","uri":"/o/r/8","status":401,"error":"code=401, message=Resource visibility not match"} {"time":"2024-01-23T09:36:14Z","latency":"1.395511ms","method":"GET","uri":"/o/r/4","status":401,"error":"code=401, message=Resource visibility not match"} {"time":"2024-01-23T09:36:14Z","latency":"3.901692ms","method":"GET","uri":"/o/r/5","status":401,"error":"code=401, message=Resource visibility not match"} {"time":"2024-01-23T09:36:14Z","latency":"15.013989ms","method":"GET","uri":"/o/r/8","status":401,"error":"code=401, message=Resource visibility not match"}

Rabithua commented 10 months ago

看样子是memo对图片也做了权限?我用的r2没遇到这个问题

674904341 commented 6 months ago

催更

Rabithua commented 6 months ago

@674904341 最近开了新坑,我自己写了一个类memos的应用,包括前后端,目前还在完善中,可能会在不久后开源出来,这个就暂时不更新了,可能会在后期重构成我这个新项目的小程序版本。

image