Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加外部预览的变量种类 #4090

Closed
4 tasks
IFxmp opened this issue Apr 8, 2023 · 2 comments
Closed
4 tasks

增加外部预览的变量种类 #4090

IFxmp opened this issue Apr 8, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@IFxmp
Copy link

IFxmp commented Apr 8, 2023

Please make sure of the following things

  • I have read the documentation.
  • I'm sure there are no duplicate issues or discussions.
  • I'm sure this feature is not implemented.
  • I'm sure it's a reasonable and popular requirement.

Description of the feature / 需求描述

近期使用kkfileview搭建在线预览,发现提供的变量$url: the file url,在挂载阿里网盘时$url地址是https://cn-beijing-data.aliyundrive.net/***的下载地址,导致kkfileview无法预览文档。在挂载本地存储时$url地址是访问的浏览器网址(中间添加/d路径),此时,kkfileview可以预览文档。
对此,建议是否能够新提供一个变量url和base64的url,变量url其值就是访问浏览器的网址(或者中间添加/d路径的地址)

Suggested solution / 实现思路

No response

Additional context / 附件

No response

@IFxmp IFxmp added the enhancement New feature or request label Apr 8, 2023
@welcome
Copy link

welcome bot commented Apr 8, 2023

Thanks for opening your first issue here! Be sure to follow the issue template!

@xhofe
Copy link
Member

xhofe commented Apr 8, 2023

参加 https://github.com/alist-org/alist-web/blob/cc9661fd0adc686c1678957f34b099eef5b16bdb/src/utils/str.ts#L58

基础变量为$url(https://cn-beijing-data.aliyundrive.net/*** 这种)和$durl(https://al.nn.ci/d/xxx.docx 这种),在基础变量前[eb]_,即是对基础变量做转换,e表示encodeURIComponent,b标识base64。如:

  • $e_url: encodeURIComponent($url)
  • $b_url: btoa($url)
  • $eb_url: encodeURIComponent(btoa($url))
  • $e_durl: encodeURIComponent($durl)
  • $b_durl: btoa($durl)
  • $eb_durl: encodeURIComponent(btoa($durl))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants