本地日志下载调试linux中运行,修改读取失败问题
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | |
| | | // 判断客户端所在的操作系统平台 |
| | | isWindows() { |
| | | return navigator.platform.indexOf('Win') !== -1 |
| | | }, |
| | | // 根据操作系统平台返回相应的路径分隔符 |
| | | getPathSeparator() { |
| | | return this.isWindows() ? '\\' : '/' |
| | | }, |
| | | downLoadLogFile(row){ |
| | | this.downloadLoading = true; |
| | | let logPath = row.hasChildren ? row.logPath:row.logPath+"\\"+row.logName; |
| | | let logPath = row.hasChildren ? row.logPath:row.logPath+this.getPathSeparator()+row.logName; |
| | | downLoadLog(Object.assign({},row,{logFullPaths:logPath})).then(res=>{ |
| | | func.downloadFileByBlobHandler(res); |
| | | this.downloadLoading = false; |
| | |
| | | if(dir.getName().contains("ubcs_")){ |
| | | String fullPath = dir.getPath() + LOGPATH; |
| | | File file = new File(fullPath); |
| | | if(file.exists()){ |
| | | LocalLog localLog = new LocalLog(); |
| | | localLog.setLastModifier(getLastModifiedOrCreatTime(true,fullPath)); |
| | | localLog.setCreateTime(getLastModifiedOrCreatTime(false,fullPath)); |
| | |
| | | localLog.setHasChildren(true); |
| | | localLogs.add(localLog); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | return localLogs; |