Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
c46ea472
提交
c46ea472
authored
2月 08, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1、及时响应个人信息修改
2、oss 直传头像
上级
dcee668e
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
47 行增加
和
28 行删除
+47
-28
Podfile.lock
ios/Podfile.lock
+6
-0
controller.dart
lib/pages/user_info/controller.dart
+2
-2
view.dart
lib/pages/user_info/view.dart
+8
-2
http.dart
lib/services/http.dart
+21
-21
oss.dart
lib/utils/oss.dart
+10
-3
没有找到文件。
ios/Podfile.lock
浏览文件 @
c46ea472
...
...
@@ -27,6 +27,8 @@ PODS:
- WechatOpenSDK-XCFramework (~> 2.0.2)
- image_picker_ios (0.0.1):
- Flutter
- just_audio (0.0.1):
- Flutter
- OrderedSet (5.0.0)
- package_info_plus (0.4.5):
- Flutter
...
...
@@ -55,6 +57,7 @@ DEPENDENCIES:
- flutter_tts (from `.symlinks/plugins/flutter_tts/ios`)
- fluwx (from `.symlinks/plugins/fluwx/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- just_audio (from `.symlinks/plugins/just_audio/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
...
...
@@ -86,6 +89,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/fluwx/ios"
image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios"
just_audio:
:path: ".symlinks/plugins/just_audio/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
...
...
@@ -108,6 +113,7 @@ SPEC CHECKSUMS:
flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d
fluwx: 3c7b6df42f83d444d4538f3eaeae079f12d30c37
image_picker_ios: 99dfe1854b4fa34d0364e74a78448a0151025425
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
...
...
lib/pages/user_info/controller.dart
浏览文件 @
c46ea472
...
...
@@ -12,8 +12,8 @@ class UserInfoController extends GetxController {
OssTool
tool
=
OssTool
(
'zxts-user-file'
);
print
(
'------path--------------------------
$path
'
);
final
response
=
await
tool
.
putObjectFile
(
path
);
print
(
'------response--------------------------
${response.
data
}
'
);
// _changeInfo(result
);
print
(
'------response--------------------------
${response.
realUri
}
'
);
_changeInfo
(
response
.
realUri
.
toString
()
);
}
/// 修改用用户信息
...
...
lib/pages/user_info/view.dart
浏览文件 @
c46ea472
...
...
@@ -12,7 +12,12 @@ class UserInfoPage extends StatefulWidget {
class
_UserInfoPageState
extends
State
<
UserInfoPage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
GetBuilder
<
UserInfoController
>(
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
GetBuilder
<
UserInfoController
>(
init:
UserInfoController
(
widget
.
userInfo
),
builder:
(
controller
)
=>
Scaffold
(
...
...
@@ -123,7 +128,8 @@ class _UserInfoPageState extends State<UserInfoPage> {
],
),
),
)),);
)),),
);
}
getGender
(
num
?
sex
)
{
...
...
lib/services/http.dart
浏览文件 @
c46ea472
...
...
@@ -169,25 +169,10 @@ class HttpService extends GetxService {
class
_RequestInterceptor
extends
Interceptor
{
@override
void
onResponse
(
Response
response
,
ResponseInterceptorHandler
handler
)
async
{
final
responseData
=
response
.
data
;
if
(
responseData
is
Map
&&
responseData
.
containsKey
(
'code'
))
{
final
code
=
responseData
[
'code'
];
if
(
code
!=
200
)
{
handler
.
reject
(
DioException
(
requestOptions:
response
.
requestOptions
,
response:
response
,
type:
DioExceptionType
.
badResponse
,
),
true
,
);
return
;
}
}
else
if
(
response
.
requestOptions
.
responseType
==
ResponseType
.
bytes
)
{
}
super
.
onResponse
(
response
,
handler
);
// if (response.data['code'] != 200) {
// final responseData = response.data;
// if (responseData is Map && responseData.containsKey('code')) {
// final code = responseData['code'];
// if (code != 200) {
// handler.reject(
// DioException(
// requestOptions: response.requestOptions,
...
...
@@ -196,9 +181,24 @@ class _RequestInterceptor extends Interceptor {
// ),
// true,
// );
// }else {
// super.onResponse(response, handler);
// return;
// }
// } else if (response.requestOptions.responseType == ResponseType.bytes) {
//
// }
// super.onResponse(response, handler);
if
(
response
.
data
[
'code'
]
!=
200
)
{
handler
.
reject
(
DioException
(
requestOptions:
response
.
requestOptions
,
response:
response
,
type:
DioExceptionType
.
badResponse
,
),
true
,
);
}
else
{
super
.
onResponse
(
response
,
handler
);
}
}
@override
...
...
lib/utils/oss.dart
浏览文件 @
c46ea472
...
...
@@ -12,7 +12,7 @@ class OssTool {
void
initOss
(
String
bucketName
)
async
{
Client
.
init
(
ossEndpoint:
'
https://
oss-cn-beijing.aliyuncs.com'
,
bucketName:
bucketName
,
authGetter:
_authGetter
);
Client
.
init
(
ossEndpoint:
'oss-cn-beijing.aliyuncs.com'
,
bucketName:
bucketName
,
authGetter:
_authGetter
);
}
// 获取临时凭证
...
...
@@ -27,11 +27,18 @@ class OssTool {
}
// 本地文件上传
Future
<
Response
<
dynamic
>>
putObjectFile
(
String
filePath
){
Future
<
Response
<
dynamic
>>
putObjectFile
(
String
filePath
)
async
{
print
(
'------------------222222222222222222222--------------
$filePath
'
);
print
(
'------------------222222222222222222222--------------'
);
return
Client
().
putObjectFile
(
List
<
String
>
parts
=
filePath
.
split
(
'/'
);
String
fileName
=
parts
.
last
;
final
String
path
=
'
${DateTime.now().year}
/
${DateTime.now().month.toString().padLeft(2,'0')}
/
${DateTime.now().day.toString().padLeft(2,'0')}
'
;
final
Response
<
dynamic
>
resp
=
await
Client
().
putObjectFile
(
filePath
,
fileKey:
'
$path
/
$fileName
'
);
print
(
'99999999999-------------
${resp.realUri}
---
${resp.extra}
--
${resp.data}
'
);
return
resp
;
}
// 批量本地文件上传
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论