ElyPrism ce51da9150
build(version): bump 4.30.0 (#102)
* chore(deps): bump actions/checkout from 4 to 6

Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Squashed commit of the following:

commit f73cbbeec37d40383e2b7d411e34048146776345
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Sun Feb 1 12:47:57 2026 +0000

    chore(deps): bump actions/download-artifact from 4 to 7

    Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 7.
    - [Release notes](https://github.com/actions/download-artifact/releases)
    - [Commits](https://github.com/actions/download-artifact/compare/v4...v7)

    ---
    updated-dependencies:
    - dependency-name: actions/download-artifact
      dependency-version: '7'
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

* Squashed commit of the following:

commit 4da2d5f3600f52c7087ea350e3ec87a3c7cac535
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Sun Feb 1 12:48:00 2026 +0000

    chore(deps): bump actions/github-script from 7 to 8

    Bumps [actions/github-script](https://github.com/actions/github-script) from 7 to 8.
    - [Release notes](https://github.com/actions/github-script/releases)
    - [Commits](https://github.com/actions/github-script/compare/v7...v8)

    ---
    updated-dependencies:
    - dependency-name: actions/github-script
      dependency-version: '8'
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

* Squashed commit of the following:

commit 9e65b176252a554decf5574ca6a3463838a7a32f
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Sun Feb 1 12:47:49 2026 +0000

    chore(deps): bump actions/setup-node from 4 to 6

    Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 6.
    - [Release notes](https://github.com/actions/setup-node/releases)
    - [Commits](https://github.com/actions/setup-node/compare/v4...v6)

    ---
    updated-dependencies:
    - dependency-name: actions/setup-node
      dependency-version: '6'
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

* Squashed commit of the following:

commit a060f3c4cc5c3a4baf9c4827163acde1589ef26d
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Sun Feb 1 12:47:53 2026 +0000

    chore(deps): bump actions/upload-artifact from 4 to 6

    Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 6.
    - [Release notes](https://github.com/actions/upload-artifact/releases)
    - [Commits](https://github.com/actions/upload-artifact/compare/v4...v6)

    ---
    updated-dependencies:
    - dependency-name: actions/upload-artifact
      dependency-version: '6'
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

* build(version): bump 4.30.0

* refactor: QR login and voice upload pages with improved UI and error handling

- Enhanced styling for better user experience on qrlogin-nocookie.html and qrlogin.html
- Added loading indicators and improved status messages during QR code login process
- Updated error handling for login status retrieval
- Refactored unblock_test.html for better layout and user interaction
- Improved voice upload page with a more intuitive design and better feedback for file uploads
- Added loading state management for voice list retrieval
- Enhanced accessibility and usability across all modified pages

* fix: Potential fix for code scanning alert no. 6: DOM text reinterpreted as HTML

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 15: DOM text reinterpreted as HTML

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* build: update utils

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-02-09 23:33:26 +08:00

327 lines
8.3 KiB
HTML

<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>播客上传声音</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
min-height: 100vh;
background: #f5f5f5;
padding: 20px;
}
.container {
max-width: 900px;
margin: 0 auto;
background: white;
border-radius: 12px;
padding: 32px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
h1 {
font-size: 24px;
font-weight: 600;
color: #333;
margin-bottom: 24px;
}
.login-link {
display: block;
margin-bottom: 24px;
color: #666;
font-size: 14px;
text-decoration: none;
}
.login-link:hover {
color: #333;
text-decoration: underline;
}
.content {
display: flex;
gap: 24px;
flex-wrap: wrap;
}
.voice-list {
flex: 1;
min-width: 300px;
}
.voice-item {
padding: 12px 16px;
border: 1px solid #eee;
border-radius: 6px;
margin-bottom: 8px;
cursor: pointer;
transition: all 0.2s ease;
}
.voice-item:hover {
border-color: #333;
background: #f9f9f9;
}
.voice-item.active {
border-color: #333;
background: #f0f0f0;
}
.voice-header {
display: flex;
align-items: center;
gap: 12px;
}
.voice-cover {
width: 50px;
height: 50px;
border-radius: 4px;
object-fit: cover;
}
.voice-name {
font-size: 14px;
font-weight: 500;
color: #333;
}
.voice-tracks {
margin-top: 8px;
padding-left: 62px;
}
.voice-track {
font-size: 13px;
color: #666;
padding: 4px 0;
}
.upload-section {
flex: 1;
min-width: 300px;
}
.form-group {
margin-bottom: 16px;
}
label {
display: block;
font-size: 14px;
font-weight: 500;
color: #555;
margin-bottom: 8px;
}
input[type="text"], input[type="file"] {
width: 100%;
padding: 10px 14px;
border: 1px solid #ddd;
border-radius: 6px;
font-size: 14px;
outline: none;
}
input[type="text"]:focus {
border-color: #333;
}
.btn {
width: 100%;
padding: 12px;
background: #333;
color: white;
font-size: 15px;
font-weight: 500;
border: none;
border-radius: 6px;
cursor: pointer;
transition: background 0.2s ease;
}
.btn:hover {
background: #555;
}
.empty-state {
text-align: center;
padding: 40px 20px;
color: #999;
font-size: 14px;
}
.loading {
text-align: center;
padding: 20px;
color: #666;
}
</style>
</head>
<body>
<div class="container">
<h1>播客上传声音</h1>
<a href="/qrlogin-nocookie.html" class="login-link">还没登录?点击登录</a>
<div class="content">
<div class="voice-list">
<h3 style="font-size: 16px; font-weight: 600; color: #333; margin-bottom: 16px;">选择播客列表</h3>
<div v-if="loading" class="loading">加载中...</div>
<div v-else-if="voicelist.length > 0">
<div
v-for="(item, index) in voicelist"
:key="index"
@click="currentVoiceIndex = index"
:class="{ active: currentVoiceIndex === index }"
class="voice-item"
>
<div class="voice-header">
<img :src="item.coverUrl" class="voice-cover" alt="cover" />
<span class="voice-name">{{ item.voiceListName }}</span>
</div>
<div class="voice-tracks" v-if="item.voiceListData">
<div
v-for="(item2, index2) in item.voiceListData"
:key="index2"
class="voice-track"
>
{{ item2.voiceName }}
</div>
</div>
</div>
</div>
<div v-else class="empty-state">暂无播客列表</div>
</div>
<div class="upload-section">
<h3 style="font-size: 16px; font-weight: 600; color: #333; margin-bottom: 16px;">上传声音</h3>
<div class="form-group">
<label for="songName">声音名称</label>
<input id="songName" v-model="songName" placeholder="请输入声音名称" />
</div>
<div class="form-group">
<label for="description">介绍</label>
<input id="description" v-model="description" placeholder="请输入介绍" />
</div>
<div class="form-group">
<label>选择文件</label>
<input type="file" name="songFile" accept="audio/*" />
</div>
<button class="btn" @click="submit">上传</button>
</div>
</div>
</div>
<script src="https://fastly.jsdelivr.net/npm/axios@0.26.1/dist/axios.min.js"></script>
<script src="https://fastly.jsdelivr.net/npm/vue@3"></script>
<script>
Vue.createApp({
data() {
return {
songName: '',
description: '',
voicelist: [],
cookieToken: '',
currentVoiceIndex: 0,
loading: false,
}
},
created() {
this.getData()
},
computed: {
currentVoice() {
return this.voicelist[this.currentVoiceIndex]
},
},
methods: {
submit() {
console.info('submit')
const file = document.querySelector('input[type=file]').files[0]
if (!file) {
alert('请选择文件')
return
}
this.upload(file)
},
async getData() {
this.loading = true
try {
const res = await axios({
url: `/voicelist/search?cookie=${localStorage.getItem('cookie')}`,
})
console.info(res.data.data)
this.voicelist = res.data.data.list || []
this.voicelist.forEach(async (i) => {
try {
const res2 = await axios({
url: `/voicelist/list?voiceListId=${i.voiceListId}&limit=5`,
})
i.voiceListData = res2.data.data.list || []
console.info(res2)
} catch (err) {
console.error('获取播客详情失败:', err)
}
})
} catch (err) {
console.error('获取播客列表失败:', err)
} finally {
this.loading = false
}
},
upload(file) {
if (!this.currentVoice) {
alert('请先选择播客列表')
return
}
var formData = new FormData()
formData.append('songFile', file)
axios({
method: 'post',
url: `/voice/upload?time=${Date.now()}&cookie=${localStorage.getItem(
'cookie',
)}&songName=${this.songName}&voiceListId=${
this.currentVoice.voiceListId
}&categoryId=${this.currentVoice.categoryId}&coverImgId=${
this.currentVoice.coverImgId
}&secondCategoryId=${
this.currentVoice.secondCategoryId
}&description=${this.description}&privacy=1`,
headers: {
'Content-Type': 'multipart/form-data',
},
data: formData,
})
.then((res) => {
alert(`${file.name} 上传成功`)
})
.catch((err) => {
console.error('上传失败:', err)
alert('上传失败,请重试')
})
},
},
}).mount('body')
</script>
</body>
</html>