forked from lxm_tools/flutter-picgo
fix:fix qiniu repo page item dir show name semantic error
This commit is contained in:
@@ -34,7 +34,7 @@ class _QiniuRepoPageState extends BaseLoadingPageState<QiniuRepoPage>
|
||||
|
||||
@override
|
||||
AppBar get appBar => AppBar(
|
||||
title: Text('图床仓库'),
|
||||
title: Text(this._prefix == '/' ? '图床仓库' : this._prefix),
|
||||
centerTitle: true,
|
||||
);
|
||||
|
||||
@@ -97,7 +97,7 @@ class _QiniuRepoPageState extends BaseLoadingPageState<QiniuRepoPage>
|
||||
onTap: () {
|
||||
if (contents[index].type == FileContentType.DIR) {
|
||||
Application.router.navigateTo(context,
|
||||
'${Routes.settingPbQiniuRepo}?path=${Uri.encodeComponent(contents[index].key)}',
|
||||
'${Routes.settingPbQiniuRepo}?path=${Uri.encodeComponent(contents[index].url)}',
|
||||
transition: TransitionType.cupertino);
|
||||
} else {
|
||||
launch(contents[index].url);
|
||||
|
||||
@@ -40,9 +40,9 @@ class QiniuRepoPagePresenter {
|
||||
c.type = FileContentType.FILE;
|
||||
c.url = pathlib.joinAll([
|
||||
config.url,
|
||||
prefix == '/' ? '' : prefix,
|
||||
c.key,
|
||||
]);
|
||||
c.key = '${c.key}'.replaceFirst(prefix == '/' ? '' : prefix, '');
|
||||
return c;
|
||||
}).toList();
|
||||
if (result['commonPrefixes'] != null) {
|
||||
@@ -50,7 +50,10 @@ class QiniuRepoPagePresenter {
|
||||
QiniuContent c = QiniuContent();
|
||||
c.type = FileContentType.DIR;
|
||||
c.url = element;
|
||||
c.key = element;
|
||||
/// 例如 xin/ax 去除 xin/ 只显示最后一个 ax
|
||||
List<String> keys = '$element'.split('/');
|
||||
print(keys);
|
||||
c.key = keys[keys.length -2];
|
||||
data.add(c);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user