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 个修改的文件
包含
154 行增加
和
135 行删除
+154
-135
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
+107
-101
http.dart
lib/services/http.dart
+29
-29
oss.dart
lib/utils/oss.dart
+10
-3
没有找到文件。
ios/Podfile.lock
浏览文件 @
c46ea472
...
@@ -27,6 +27,8 @@ PODS:
...
@@ -27,6 +27,8 @@ PODS:
- WechatOpenSDK-XCFramework (~> 2.0.2)
- WechatOpenSDK-XCFramework (~> 2.0.2)
- image_picker_ios (0.0.1):
- image_picker_ios (0.0.1):
- Flutter
- Flutter
- just_audio (0.0.1):
- Flutter
- OrderedSet (5.0.0)
- OrderedSet (5.0.0)
- package_info_plus (0.4.5):
- package_info_plus (0.4.5):
- Flutter
- Flutter
...
@@ -55,6 +57,7 @@ DEPENDENCIES:
...
@@ -55,6 +57,7 @@ DEPENDENCIES:
- flutter_tts (from `.symlinks/plugins/flutter_tts/ios`)
- flutter_tts (from `.symlinks/plugins/flutter_tts/ios`)
- fluwx (from `.symlinks/plugins/fluwx/ios`)
- fluwx (from `.symlinks/plugins/fluwx/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/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`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
...
@@ -86,6 +89,8 @@ EXTERNAL SOURCES:
...
@@ -86,6 +89,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/fluwx/ios"
:path: ".symlinks/plugins/fluwx/ios"
image_picker_ios:
image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios"
:path: ".symlinks/plugins/image_picker_ios/ios"
just_audio:
:path: ".symlinks/plugins/just_audio/ios"
package_info_plus:
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
path_provider_foundation:
...
@@ -108,6 +113,7 @@ SPEC CHECKSUMS:
...
@@ -108,6 +113,7 @@ SPEC CHECKSUMS:
flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d
flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d
fluwx: 3c7b6df42f83d444d4538f3eaeae079f12d30c37
fluwx: 3c7b6df42f83d444d4538f3eaeae079f12d30c37
image_picker_ios: 99dfe1854b4fa34d0364e74a78448a0151025425
image_picker_ios: 99dfe1854b4fa34d0364e74a78448a0151025425
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
...
...
lib/pages/user_info/controller.dart
浏览文件 @
c46ea472
...
@@ -12,8 +12,8 @@ class UserInfoController extends GetxController {
...
@@ -12,8 +12,8 @@ class UserInfoController extends GetxController {
OssTool
tool
=
OssTool
(
'zxts-user-file'
);
OssTool
tool
=
OssTool
(
'zxts-user-file'
);
print
(
'------path--------------------------
$path
'
);
print
(
'------path--------------------------
$path
'
);
final
response
=
await
tool
.
putObjectFile
(
path
);
final
response
=
await
tool
.
putObjectFile
(
path
);
print
(
'------response--------------------------
${response.
data
}
'
);
print
(
'------response--------------------------
${response.
realUri
}
'
);
// _changeInfo(result
);
_changeInfo
(
response
.
realUri
.
toString
()
);
}
}
/// 修改用用户信息
/// 修改用用户信息
...
...
lib/pages/user_info/view.dart
浏览文件 @
c46ea472
...
@@ -12,118 +12,124 @@ class UserInfoPage extends StatefulWidget {
...
@@ -12,118 +12,124 @@ class UserInfoPage extends StatefulWidget {
class
_UserInfoPageState
extends
State
<
UserInfoPage
>
{
class
_UserInfoPageState
extends
State
<
UserInfoPage
>
{
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
GetBuilder
<
UserInfoController
>(
return
WillPopScope
(
init:
UserInfoController
(
widget
.
userInfo
),
onWillPop:
()
async
{
builder:
(
controller
)
=>
context
.
pop
(
true
);
Scaffold
(
return
false
;
appBar:
AppBar
(
},
title:
const
Text
(
'个人信息'
),
child:
GetBuilder
<
UserInfoController
>(
centerTitle:
true
,
init:
UserInfoController
(
widget
.
userInfo
),
),
builder:
(
controller
)
=>
body:
Container
(
Scaffold
(
margin:
EdgeInsets
.
symmetric
(
appBar:
AppBar
(
horizontal:
AppTheme
.
margin
,
vertical:
AppTheme
.
margin
),
title:
const
Text
(
'个人信息'
),
decoration:
BoxDecoration
(
centerTitle:
true
,
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
const
Color
(
0xFFC7C7C7
).
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
),
child:
ClipRRect
(
body:
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
,
vertical:
AppTheme
.
margin
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Column
(
color:
Colors
.
white
,
mainAxisSize:
MainAxisSize
.
min
,
boxShadow:
[
children:
[
BoxShadow
(
color:
const
Color
(
0xFFC7C7C7
).
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
/// 头像
/// 头像
Container
(
Container
(
height:
52
.
w
,
height:
52
.
w
,
padding:
EdgeInsets
.
only
(
left:
18
.
w
,
right:
15
.
w
),
padding:
EdgeInsets
.
only
(
left:
18
.
w
,
right:
15
.
w
),
child:
GestureDetector
(
child:
GestureDetector
(
onTap:
()
async
{
onTap:
()
async
{
final
assets
=
await
AssetsPicker
.
image
(
final
assets
=
await
AssetsPicker
.
image
(
context:
context
,
context:
context
,
);
);
controller
.
upload
(
path:
assets
!.
path
);
controller
.
upload
(
path:
assets
!.
path
);
},
},
child:
Container
(
child:
Container
(
color:
Colors
.
transparent
,
color:
Colors
.
transparent
,
child:
Row
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
children:
[
Text
(
Text
(
'头像'
,
'头像'
,
style:
TextStyle
(
style:
TextStyle
(
color:
Colours
.
c3
,
color:
Colours
.
c3
,
fontSize:
14
.
w
,
fontSize:
14
.
w
,
height:
1.6
),
height:
1.6
),
),
),
Row
(
Row
(
children:
[
children:
[
Container
(
Container
(
width:
33
.
w
,
width:
33
.
w
,
height:
33
.
w
,
height:
33
.
w
,
decoration:
const
BoxDecoration
(
decoration:
const
BoxDecoration
(
shape:
BoxShape
.
circle
,
shape:
BoxShape
.
circle
,
color:
Colors
.
cyan
,
color:
Colors
.
cyan
,
),
child:
CustomImage
.
network
(
url:
controller
.
userInfo
.
headImg
??
''
,
radius:
16.5
,
),
),
),
child:
CustomImage
.
network
(
Gaps
.
hGaps10
,
url:
controller
.
userInfo
.
headImg
??
''
,
SizedBox
(
radius:
16.5
,
width:
5
.
w
,
),
height:
8
.
w
,
),
child:
Image
.
asset
(
Gaps
.
hGaps10
,
'assets/images/right_arrow.png'
),
SizedBox
(
)
width:
5
.
w
,
],
height:
8
.
w
,
)
child:
Image
.
asset
(
],
'assets/images/right_arrow.png'
),
),
)
],
)
],
),
),
),
),
),
),
),
Container
(
Container
(
color:
Colours
.
cLine
,
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
15
.
w
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
15
.
w
),
height:
1
.
w
,
height:
1
.
w
,
),
),
GestureDetector
(
GestureDetector
(
onTap:
()
{
context
.
pushNamed
(
Routes
.
nike
,
extra:
controller
.
userInfo
);
},
child:
_buildItem
(
'昵称'
,
widget
.
userInfo
.
name
??
''
,
)),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
15
.
w
),
height:
1
.
w
,
),
GestureDetector
(
onTap:
()
{
onTap:
()
{
context
.
pushNamed
(
Routes
.
nike
,
extra:
controller
.
userInfo
);
context
.
pushNamed
(
Routes
.
gender
,
extra:
controller
.
userInfo
);
},
},
child:
_buildItem
(
child:
_buildItem
(
'昵称'
,
'性别'
,
widget
.
userInfo
.
name
??
''
,
getGender
(
widget
.
userInfo
.
sex
)
)),
// widget.userInfo.sex == 1 ? '男' : '女',
Container
(
)),
color:
Colours
.
cLine
,
],
margin:
EdgeInsets
.
symmetric
(
horizontal:
15
.
w
),
),
height:
1
.
w
,
),
GestureDetector
(
onTap:
()
{
context
.
pushNamed
(
Routes
.
gender
,
extra:
controller
.
userInfo
);
},
child:
_buildItem
(
'性别'
,
getGender
(
widget
.
userInfo
.
sex
)
// widget.userInfo.sex == 1 ? '男' : '女',
)),
],
),
),
),
)),
),
)
),)
;
);
}
}
getGender
(
num
?
sex
)
{
getGender
(
num
?
sex
)
{
...
...
lib/services/http.dart
浏览文件 @
c46ea472
...
@@ -169,36 +169,36 @@ class HttpService extends GetxService {
...
@@ -169,36 +169,36 @@ class HttpService extends GetxService {
class
_RequestInterceptor
extends
Interceptor
{
class
_RequestInterceptor
extends
Interceptor
{
@override
@override
void
onResponse
(
Response
response
,
ResponseInterceptorHandler
handler
)
async
{
void
onResponse
(
Response
response
,
ResponseInterceptorHandler
handler
)
async
{
final
responseData
=
response
.
data
;
// final responseData = response.data;
if
(
responseData
is
Map
&&
responseData
.
containsKey
(
'code'
))
{
// if (responseData is Map && responseData.containsKey('code')) {
final
code
=
responseData
[
'code'
];
// final code = responseData['code'];
if
(
code
!=
200
)
{
// if (code != 200) {
handler
.
reject
(
// handler.reject(
DioException
(
// DioException(
requestOptions:
response
.
requestOptions
,
// requestOptions: response.requestOptions,
response:
response
,
// response: response,
type:
DioExceptionType
.
badResponse
,
// type: DioExceptionType.badResponse,
),
// ),
true
,
// true,
);
// );
return
;
// return;
}
// }
}
else
if
(
response
.
requestOptions
.
responseType
==
ResponseType
.
bytes
)
{
// } 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);
// }
// }
// 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
@override
...
...
lib/utils/oss.dart
浏览文件 @
c46ea472
...
@@ -12,7 +12,7 @@ class OssTool {
...
@@ -12,7 +12,7 @@ class OssTool {
void
initOss
(
String
bucketName
)
async
{
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 {
...
@@ -27,11 +27,18 @@ class OssTool {
}
}
// 本地文件上传
// 本地文件上传
Future
<
Response
<
dynamic
>>
putObjectFile
(
String
filePath
){
Future
<
Response
<
dynamic
>>
putObjectFile
(
String
filePath
)
async
{
print
(
'------------------222222222222222222222--------------
$filePath
'
);
print
(
'------------------222222222222222222222--------------'
);
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
,
filePath
,
fileKey:
'
$path
/
$fileName
'
);
);
print
(
'99999999999-------------
${resp.realUri}
---
${resp.extra}
--
${resp.data}
'
);
return
resp
;
}
}
// 批量本地文件上传
// 批量本地文件上传
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论