-
+
反馈
-
+
源码
@@ -75,7 +75,7 @@
NFD网盘直链解析0.3.0
-
支持网盘:蓝奏云、蓝奏云优享、小飞机盘、123云盘、iCloud、移动云空间、联想乐云、QQ闪传等 >>
+
支持网盘:蓝奏云、蓝奏云优享、小飞机盘、123云盘、iCloud、移动云空间、联想乐云、QQ闪传等 >>
文件夹解析支持:蓝奏云、蓝奏云优享、小飞机盘、123云盘
@@ -714,6 +714,9 @@ export default {
}
},
computed: {
+ githubRepoUrl() {
+ return process.env.VUE_APP_GITHUB_REPO_URL
+ },
// 检查是否配置了认证信息(针对当前链接的网盘类型)
hasAuthConfig() {
const panType = this.getCurrentPanType()
@@ -1436,7 +1439,7 @@ export default {
错误信息:${JSON.stringify(this.errorDetail, null, 2)}`;
navigator.clipboard.writeText(text).then(() => {
this.$message.success('已复制分享信息和错误详情');
- window.open('https://github.com/yukaidi1220/netdisk-fast-download/issues/new', '_blank', 'noopener,noreferrer');
+ window.open(`${this.githubRepoUrl}/issues/new`, '_blank', 'noopener,noreferrer');
}).catch(() => {
this.$message.error('复制失败');
});
diff --git a/web-front/src/views/Playground.vue b/web-front/src/views/Playground.vue
index 58550fc..0d5159f 100644
--- a/web-front/src/views/Playground.vue
+++ b/web-front/src/views/Playground.vue
@@ -653,22 +653,22 @@
更多详细信息,请参考 GitHub 仓库文档:
-
-
+
JavaScript 解析器开发指南
-
-
+
自定义解析器扩展指南
-
-
+
快速开始教程
-
-
+
解析器模块文档
@@ -858,6 +858,7 @@ export default {
},
setup() {
const router = useRouter();
+ const githubRepoUrl = process.env.VUE_APP_GITHUB_REPO_URL;
// 语言常量
const LANGUAGE = {
@@ -2268,6 +2269,7 @@ curl "${baseUrl}/json/parser?url=${encodeURIComponent(exampleUrl)}"
});
return {
+ githubRepoUrl,
LANGUAGE,
editorRef,
jsCode,
diff --git a/web-front/vue.config.js b/web-front/vue.config.js
index 8a3a925..731ffdd 100644
--- a/web-front/vue.config.js
+++ b/web-front/vue.config.js
@@ -1,10 +1,23 @@
const path = require("path");
+const { execSync } = require("child_process");
+const webpack = require("webpack");
function resolve(dir) {
return path.join(__dirname, dir)
}
+// 从 git remote origin 自动识别 GitHub 仓库地址
+function getGitHubRepoUrl() {
+ try {
+ const remoteUrl = execSync('git remote get-url origin', { encoding: 'utf-8', cwd: path.resolve(__dirname, '..') }).trim();
+ const match = remoteUrl.match(/github\.com[:/]([^/]+\/[^/.]+?)(?:\.git)?$/);
+ if (match) return `https://github.com/${match[1]}`;
+ } catch (e) {}
+ return 'https://github.com/qaiu/netdisk-fast-download';
+}
+const GITHUB_REPO_URL = getGitHubRepoUrl();
+
const CompressionPlugin = require('compression-webpack-plugin');
const FileManagerPlugin = require('filemanager-webpack-plugin');
const MonacoEditorPlugin = require('monaco-editor-webpack-plugin');
@@ -55,6 +68,9 @@ module.exports = {
]
},
plugins: [
+ new webpack.DefinePlugin({
+ 'process.env.VUE_APP_GITHUB_REPO_URL': JSON.stringify(GITHUB_REPO_URL)
+ }),
new MonacoEditorPlugin({
languages: ['javascript', 'typescript', 'json'],
features: ['coreCommands', 'find', 'format', 'suggest', 'quickCommand'],