Explorar o código

提示百度网盘上传的路径

onecold hai 8 meses
pai
achega
d7df18cda6
Modificáronse 1 ficheiros con 8 adicións e 2 borrados
  1. 8 2
      entry/src/main/ets/pages/WebDavMainPage.ets

+ 8 - 2
entry/src/main/ets/pages/WebDavMainPage.ets

@@ -12,7 +12,7 @@ import { FileInfo } from '../viewmodel/FileInfo';
 import { emitter } from '@kit.BasicServicesKit';
 import { EventConstants } from '../common/constants/EventConstants';
 import { LazyDataSource } from '../common/util/LazyDataSource';
-import { ArrayUtil, PreferencesUtil, StrUtil } from '@pura/harmony-utils';
+import { ArrayUtil, PreferencesUtil, StrUtil, ToastUtil } from '@pura/harmony-utils';
 import { DialogHelper } from '@pura/harmony-dialog';
 import { ButtonFancyModifier,
   MenuModifier,
@@ -79,6 +79,7 @@ function decodeUrlEncodedString(encodedStr: string): string {
 @Entry
 @Component
 export struct WebDavMainPage {
+  @State appName: string = ''
   @State isShowUploadFile: boolean = false
   @State isShowTitleBar: boolean = true //是否显示分类导航条
   private prevOffsetY: number = 0; // 记录上一次的Y轴偏移量
@@ -361,7 +362,9 @@ export struct WebDavMainPage {
     this.autoHideTitle = PreferencesUtil.getBooleanSync('autoHideTitle', true)
   }
   aboutToAppear(): void {
-
+    Utility.getAppName(getContext(this)).then((appName: string) => {
+      this.appName = appName
+    })
     this.initSetting()
     let eventSetting: emitter.InnerEvent = { eventId: 333 }
     // 监听广播事件(通用设置配置更新)
@@ -1119,6 +1122,9 @@ export struct WebDavMainPage {
             console.info("heanup onResult,上传成功,刷新列表")
             if(result){
               // 上传文件成功后刷新当前路径的列表
+              if(this.selectedAccount.webType==RemoteDriveType.Baidu){
+                ToastUtil.showToast(`由于百度网盘限制,百度网盘的上传路径是apps/${this.appName}`)
+              }
               this.refreshFileListAfterUpload()
             }
           },