openimsdk / open-im-flutter-demo

Demo developed based on flutter open IM SDK.
https://openim.io
Apache License 2.0
310 stars 208 forks source link

[BUG] Flutter interface reports an error (the backend has been started and works normally on the web) #127

Closed samtake closed 1 month ago

samtake commented 1 month ago

OpenIM Server Version

3.8.1

Operating System and CPU Architecture

macOS (AMD)

Deployment Method

Source Code Deployment

Bug Description and Steps to Reproduce

1、先在本地源碼部署open-im-server&chat。

2、啟動openim-electron-demo後,接口正常。

shopssnap

3、啟動open-im-flutter-demo後,登錄報錯

nnnn
D/EGL_emulation( 5353): app_time_stats: avg=507.36ms min=503.91ms max=510.81ms count=2
I/flutter ( 5353): ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 5353): │ [http-request] [POST] http://localhost:10008/account/login
I/flutter ( 5353): │ Data: {
I/flutter ( 5353): │   "areaCode": "+86",
I/flutter ( 5353): │   "phoneNumber": "16624764738",
I/flutter ( 5353): │   "password": "500a32772f1bc403d3f3041225b97f61",
I/flutter ( 5353): │   "platform": 5
I/flutter ( 5353): │ }
I/flutter ( 5353): │ Headers: {
I/flutter ( 5353): │   "operationID": "1729148873189",
I/flutter ( 5353): │   "content-type": "application/json"
I/flutter ( 5353): │ }
I/flutter ( 5353): └──────────────────────────────────────────────────────────────────────────────────────────────────────────────
D/EGL_emulation( 5353): app_time_stats: avg=548.33ms min=481.97ms max=656.89ms count=3
I/flutter ( 5353): ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 5353): │ [http-error] [POST] http://localhost:10008/account/login
I/flutter ( 5353): │ Message: The connection errored: Connection refused
I/flutter ( 5353): │ Headers: {
I/flutter ( 5353): │   "operationID": "1729148873189",
I/flutter ( 5353): │   "content-type": "application/json",
I/flutter ( 5353): │   "content-length": "105"
I/flutter ( 5353): │ }
I/flutter ( 5353): └──────────────────────────────────────────────────────────────────────────────────────────────────────────────
[OpenIM-App] ** e:接口:http://localhost:10008/account/login  信息:The connection errored: Connection refused s:, isError [false]
[OpenIM-App] ** login e: 接口:http://localhost:10008/account/login  信息:The connection errored: Connection refused , isError [false]

Screenshots Link

No response

std-s commented 1 month ago

Try using IP.

samtake commented 1 month ago

Fixed, set IP to 10.0.2.2 on Android emulator to make request