Skip to content

Commit ff6aaad

Browse files
committed
feat:细节调整
1 parent bf63f19 commit ff6aaad

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

electron/main/file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ export function openDirectory(path: string) {
3838

3939
// 保存文件
4040
export async function writeFile(filePath: string, buf: NodeJS.ArrayBufferView) {
41-
writeFileSync(filePath, buf);
41+
return writeFileSync(filePath, buf);
4242
}

src/page/video/parse.tsx

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { openUrl } from "@/helper";
2+
import { isUrl } from "@/helper/validate";
23
import { message } from "@/service/common";
34
import { circuits, videoList } from "@/service/video";
45
import { NButton, NInput, NInputGroup, NInputGroupLabel, NSelect, NTooltip } from "naive-ui";
@@ -14,11 +15,15 @@ export default defineComponent({
1415
const iptEl = ref<HTMLInputElement>();
1516

1617
function handleParse(check = true) {
17-
if (!url.value) {
18-
if (check) {
18+
if (check) {
19+
if (!url.value) {
1920
message.error("请先输入播放地址");
21+
return;
22+
}
23+
if (!isUrl(url.value)) {
24+
message.error("播放地址输入错误");
25+
return;
2026
}
21-
return;
2227
}
2328
iframeSrc.value = circuit.value.replace("__URL__", url.value);
2429
}
@@ -28,7 +33,7 @@ export default defineComponent({
2833
});
2934

3035
return () => (
31-
<div class="content">
36+
<div>
3237
<div class="mar-b-5-item">
3338
<NInputGroup>
3439
<NInputGroupLabel size="large">播放地址</NInputGroupLabel>
@@ -96,11 +101,13 @@ export default defineComponent({
96101
))}
97102
</div>
98103
</div>
99-
{iframeSrc.value ? (
100-
<div style="background-color: #000; margin-bottom: 100px">
101-
<iframe src={iframeSrc.value} frameborder="0" class="full-width" style="height: calc(100vh - 300px)" scrolling="no"></iframe>
102-
</div>
103-
) : null}
104+
<div class="content">
105+
{iframeSrc.value ? (
106+
<div style="background-color: #000; margin-bottom: 100px">
107+
<iframe src={iframeSrc.value} frameborder="0" class="full-width" style="height: calc(100vh - 300px)" scrolling="no"></iframe>
108+
</div>
109+
) : null}
110+
</div>
104111
</div>
105112
);
106113
},

0 commit comments

Comments
 (0)