lz.qaiu.top加入前端页面

This commit is contained in:
QAIU
2023-07-31 11:38:23 +08:00
parent 1e77b20e44
commit 6bd075e17c
10 changed files with 3071 additions and 42 deletions

View File

@@ -1,5 +1,5 @@
# nfd-web
当前页面修改自开源项目 https://github.com/HurryBy/CloudDiskAnalysis
## Project setup
```
npm install

File diff suppressed because it is too large Load Diff

View File

@@ -23,7 +23,10 @@
"@vue/cli-service": "~5.0.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
"vue-template-compiler": "^2.6.14"
"vue-template-compiler": "^2.6.14",
"compression-webpack-plugin": "^6.1.1",
"filemanager-webpack-plugin": "2.0.5"
},
"eslintConfig": {
"root": true,

BIN
web-front/public/avator.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

170
web-front/public/index.html Normal file
View File

@@ -0,0 +1,170 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Netdisk fast download</title>
<meta name="keywords"
content="">
<meta name="description"
content="">
<style>
.page-loading-wrap {
padding: 120px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.la-timer,
.la-timer>div {
position: relative;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.la-timer {
display: block;
font-size: 0;
color: #fff;
}
.la-timer.la-dark {
color: #333;
}
.la-timer>div {
display: inline-block;
float: none;
background-color: currentColor;
border: 0 solid currentColor;
}
.la-timer {
width: 32px;
height: 32px;
}
.la-timer>div {
width: 32px;
height: 32px;
background: transparent;
border-width: 2px;
border-radius: 100%;
}
.la-timer>div:before,
.la-timer>div:after {
position: absolute;
top: 14px;
left: 14px;
display: block;
width: 2px;
margin-top: -1px;
margin-left: -1px;
content: "";
background: currentColor;
border-radius: 2px;
-webkit-transform-origin: 1px 1px 0;
-moz-transform-origin: 1px 1px 0;
-ms-transform-origin: 1px 1px 0;
-o-transform-origin: 1px 1px 0;
transform-origin: 1px 1px 0;
-webkit-animation: timer-loader 1250ms infinite linear;
-moz-animation: timer-loader 1250ms infinite linear;
-o-animation: timer-loader 1250ms infinite linear;
animation: timer-loader 1250ms infinite linear;
-webkit-animation-delay: -625ms;
-moz-animation-delay: -625ms;
-o-animation-delay: -625ms;
animation-delay: -625ms;
}
.la-timer>div:before {
height: 12px;
}
.la-timer>div:after {
height: 8px;
-webkit-animation-duration: 15s;
-moz-animation-duration: 15s;
-o-animation-duration: 15s;
animation-duration: 15s;
-webkit-animation-delay: -7.5s;
-moz-animation-delay: -7.5s;
-o-animation-delay: -7.5s;
animation-delay: -7.5s;
}
@-webkit-keyframes timer-loader {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@-moz-keyframes timer-loader {
0% {
-moz-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-moz-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@-o-keyframes timer-loader {
0% {
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes timer-loader {
0% {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div id="app">
<div class="page-loading-wrap">
<div style="color: #4e9ff5" class="la-timer">
<div></div>
</div>
<h4 style="margin-top:20px;font-size:14px;font-weight:400;color: #515a6e;">正在加载资源...</h4>
</div>
</div>
<!-- built files will be auto injected -->
</body>
</html>

View File

@@ -7,30 +7,29 @@
<el-avatar :size="150" :src="avatar"></el-avatar>
</div>
</div>
<h3 style="text-align: center;">netdisk-fast-download网盘直链解析</h3>
<h3 style="text-align: center;">NFD网盘直链解析(API演示)</h3>
<div class="typo">
<p><strong>项目地址 </strong><a href="https://github.com/qaiu/netdisk-fast-download" target="_blank"
rel="nofollow"><u>点我跳转</u></a></p>
rel="nofollow"><u>点我跳转</u></a></p>
<p><strong>当前页面修改自开源项目</strong><a href="https://github.com/HurryBy/CloudDiskAnalysis" target="_blank"
rel="nofollow"><u>CloudDiskAnalysis</u></a></p>
<p><strong>目前支持 </strong>已支持蓝奏云/奶牛快传/移动云云空间/UC网盘(暂时失效)/小飞机盘/亿方云/123云盘</p>
</div>
<hr>
<div class="main" v-loading="isLoading">
<div class="grid-content">
<el-input placeholder="请粘贴分享链接" v-model="link" id="url" lass="input-with-select">
<el-select v-model="select" slot="prepend" placeholder="">
<el-option v-for="item in panList" :key="item.value" :value="item.value" :label="item.name"
:disabled="item.disabled"/>
</el-select>
<strong slot="prepend">分享链接</strong>
<el-button slot="append" @click="onSubmit">解析</el-button>
</el-input>
<el-input placeholder="请输入密码" v-model="password" id="url" lass="input-with-select"></el-input>
<el-input placeholder="解析地址" :value="getLink" id="url" lass="input-with-select">
<el-button slot="append" v-clipboard:copy="getLink"
<el-input v-show="respData.data" placeholder="解析地址" :value="getLink2" id="url" lass="input-with-select">
<el-button slot="append" v-clipboard:copy="getLink2"
v-clipboard:success="onCopy"
v-clipboard:error="onError">点我复制</el-button>
</el-input>
</div>
<div v-show="respData" style="margin-top: 10px">
<div v-show="respData.code" style="margin-top: 10px">
<strong>解析结果: </strong>
<json-viewer
:value="respData"
@@ -69,11 +68,11 @@ UC网盘 (uc)似乎已经失效,需要登录
登录, 上传, 下载, 分享
直链解析
123云盘 (ye)
登录, 上传, 下载,
登录, 上传, 下载,, 分享
*/
export default {
name: 'App',
data: function () {
data() {
return {
link: "",
password: "",
@@ -81,7 +80,7 @@ export default {
downUrl: null,
avatar: "https://q2.qlogo.cn/headimg_dl?dst_uin=736226400&spec=640",
select: "lz",
respData: null,
respData: {},
panList: [
{
name: "蓝奏云",
@@ -113,7 +112,8 @@ export default {
value: 'ye'
},
],
getLink: ''
getLink: '',
getLink2: ''
}
},
methods: {
@@ -124,24 +124,24 @@ export default {
}
this.isLoading = true
this.downUrl = ''
this.respData = ''
this.getLink = location.protocol + "//" + location.hostname + `:6400/json/parser?url=${this.link}`
this.respData = {}
this.getLink2 = `${location.protocol}//${location.host}/parser?url=${this.link}`
// this.getLink = `${location.protocol}//${location.host}/api/json/parser?url=${this.link}`
this.getLink = `${location.protocol}//${location.host}/json/parser?url=${this.link}`
if (this.password) {
this.getLink += `&pwd=${this.password}`
}
axios.get(this.getLink).then(
response => {
this.isLoading = false
this.respData = response.data
if (response.data.code === 200) {
this.$message({
message: response.data.msg,
type: 'success'
})
this.isLoading = false
this.downUrl = response.data.data
this.respData = response.data
} else {
this.isLoading = false
this.respData = response.data
this.$message.error(response.data.msg)
}
},
@@ -151,9 +151,6 @@ export default {
}
)
},
downloadFile(downloadUrl) {
window.location.href = downloadUrl
},
onCopy(){
this.$message.success('复制成功')
},
@@ -227,17 +224,6 @@ body:before {
margin-left: 0.5em;
}
.item {
padding: 5px;
break-inside: avoid;
}
.item img {
width: 100%;
margin-bottom: 10px;
}
.typo {
text-align: left;
}

View File

@@ -1,5 +1,59 @@
const { defineConfig } = require('@vue/cli-service')
const path = require("path");
module.exports = defineConfig({
transpileDependencies: true,
lintOnSave: false
})
function resolve(dir) {
return path.join(__dirname, dir)
}
const CompressionPlugin = require('compression-webpack-plugin');
const FileManagerPlugin = require('filemanager-webpack-plugin')
module.exports = {
outputDir: 'nfd-front',
devServer: {
host: '127.0.0.1',
port: 6444,
proxy: {
'/api': {
target: 'http://127.0.0.1:6400', // 请求本地
changeOrigin: true,
pathRewrite: {
'^/api': '/' //本身的接口地址没有 '/api' 这种通用前缀所以要rewrite如果本身有则去掉
},
ws: true
},
}
},
configureWebpack: {
// provide the app's title in webpack's name field, so that
// it can be accessed in index.html to inject the correct title.
name: 'Netdisk fast download',
resolve: {
alias: {
'@': resolve('src')
}
},
plugins: [
new CompressionPlugin({
test: /\.js$|\.html$|\.css/, // 匹配文件
threshold: 10240 // 对超过10k文件压缩
}),
new FileManagerPlugin({ //初始化 filemanager-webpack-plugin 插件实例
onEnd: {
mkdir: ['./nfd-front'],
delete: [ //首先需要删除项目根目录下的dist.zip
'./nfd-front.zip',
],
archive: [ //然后我们选择dist文件夹将之打包成dist.zip并放在根目录
{source: './nfd-front', destination: './nfd-front.zip'},
]
}
})
]
},
}

View File

@@ -11,6 +11,7 @@ import io.vertx.core.json.JsonObject;
import io.vertx.ext.web.client.WebClient;
import io.vertx.uritemplate.UriTemplate;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.openjdk.nashorn.api.scripting.ScriptObjectMirror;
@@ -39,7 +40,8 @@ public class YeTool implements IPanTool {
={authKey}";
*/
private static final String GET_FILE_INFO_URL="https://www.123pan.com/b/api/share/get?limit=100&next=1&orderBy=file_name&orderDirection=asc" +
private static final String GET_FILE_INFO_URL = "https://www.123pan.com/b/api/share/get?limit=100&next=1&orderBy" +
"=file_name&orderDirection=asc" +
"&shareKey={shareKey}&SharePwd={pwd}&ParentFileId=0&Page=1&event=homeListFile&operateType=1";
private static final String DOWNLOAD_API_URL = "https://www.123pan.com/b/api/share/download/info?{authK}={authV}";
@@ -106,7 +108,8 @@ public class YeTool implements IPanTool {
private static void getDownUrl(Promise<String> promise, WebClient client, JsonObject reqBodyJson) {
log.info(reqBodyJson.encodePrettily());
JsonObject jsonObject = new JsonObject();
// {"ShareKey":"iaKtVv-6OECd","FileID":2193732,"S3keyFlag":"1811834632-0","Size":4203111,"Etag":"69c94adbc0b9190cf23c4e958d8c7c53"}
// {"ShareKey":"iaKtVv-6OECd","FileID":2193732,"S3keyFlag":"1811834632-0","Size":4203111,
// "Etag":"69c94adbc0b9190cf23c4e958d8c7c53"}
jsonObject.put("ShareKey", reqBodyJson.getString("ShareKey"));
jsonObject.put("FileID", reqBodyJson.getInteger("FileId"));
jsonObject.put("S3keyFlag", reqBodyJson.getString("S3KeyFlag"));
@@ -122,9 +125,10 @@ public class YeTool implements IPanTool {
return;
}
if (getSign == null) {
promise.fail("getSign failed");
promise.fail(ArrayUtils.toString(getSign));
return;
}
log.info("ye getSign: {}={}", getSign.get("0").toString(), getSign.get("1").toString());
client.postAbs(UriTemplate.of(DOWNLOAD_API_URL))
.setTemplateParam("authK", getSign.get("0").toString())
@@ -139,7 +143,7 @@ public class YeTool implements IPanTool {
promise.fail("Ye: downURLJson返回值异常->" + downURLJson);
return;
}
} catch(Exception ignored) {
} catch (Exception ignored) {
promise.fail("Ye: downURLJson格式异常->" + downURLJson);
return;
}
@@ -158,7 +162,7 @@ public class YeTool implements IPanTool {
promise.fail("Ye: downUrl2返回值异常->" + res3Json);
return;
}
} catch(Exception ignored) {
} catch (Exception ignored) {
promise.fail("Ye: downUrl2格式异常->" + downURLJson);
return;
}
@@ -171,6 +175,7 @@ public class YeTool implements IPanTool {
} catch (MalformedURLException e) {
promise.fail("urlParams解析异常" + e.getMessage());
}
}).onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Ye", reqBodyJson.encodePrettily(), t)));
}).onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Ye",
reqBodyJson.encodePrettily(), t)));
}
}

View File

@@ -31,7 +31,6 @@ public class JsExecUtils {
throw new ScriptException("js resource path is null");
}
String path = resource.getPath();
System.out.println(path);
String reader = path + JS_PATH;
FileReader fReader = new FileReader(reader);
engine.eval(fReader);