mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-12-03 03:12:51 +08:00
Integrate QQ renewal and enforce music account assignment rules
This commit is contained in:
commit
0808cde447
27 files changed
+1501
-76
No files matched your search
@@ -38,26 +38,25 @@
|
||||
|
||||
<p class="hint">
|
||||
<template v-if="status.source === 'granted'">
|
||||
这个账号是管理员分配给你的,搜索、歌单、每日推荐和播放都会用它。想换成自己的账号,直接扫码绑定即可 — 自己的账号优先。
|
||||
网页搜索、歌单和每日推荐默认使用管理员分配的账号。自己的绑定优先。
|
||||
</template>
|
||||
<template v-else-if="status.supportsQrLogin">
|
||||
绑定后,{{ PLATFORM_LABEL[current] ?? current }}的搜索、歌单、每日推荐和播放地址都按你自己的账号获取,
|
||||
看不到管理员的歌单和收藏。仅保存在服务器上,不会显示给任何人。
|
||||
管理员开启每用户独立账号后,可使用你绑定的{{ PLATFORM_LABEL[current] ?? current }}账号查看网页搜索、歌单和推荐。登录凭据保存在服务器。
|
||||
</template>
|
||||
<template v-else>
|
||||
该平台暂不支持在网页端自助绑定,需要账号请联系管理员分配。
|
||||
</template>
|
||||
</p>
|
||||
|
||||
<!-- 播放用哪个账号。只有真的持有个人/分配账号、且管理员开了这个功能时
|
||||
<!-- 网页用哪个账号。只有真的持有个人/分配账号、且管理员开了这个功能时
|
||||
才有得选;否则本来就走共享账号。 -->
|
||||
<div
|
||||
v-if="status.featureEnabled && status.linked"
|
||||
class="account-choice"
|
||||
role="radiogroup"
|
||||
aria-label="播放使用哪个账号"
|
||||
aria-label="网页端使用哪个账号"
|
||||
>
|
||||
<div class="account-choice-title">网页端播放使用哪个账号</div>
|
||||
<div class="account-choice-title">网页端使用哪个账号</div>
|
||||
|
||||
<div
|
||||
class="account-choice-option"
|
||||
@@ -73,8 +72,7 @@
|
||||
<span class="account-choice-text">
|
||||
<strong>我的账号</strong>
|
||||
<em>
|
||||
{{ status.source === 'granted' ? '管理员分配给我的那个' : '我自己扫码绑定的' }};
|
||||
播放不了时自动改用共享账号
|
||||
{{ status.source === 'granted' ? '管理员分配的账号' : '我扫码绑定的账号' }}
|
||||
</em>
|
||||
</span>
|
||||
</div>
|
||||
@@ -92,13 +90,12 @@
|
||||
<span class="account-choice-dot" :class="{ on: status.preferShared }" />
|
||||
<span class="account-choice-text">
|
||||
<strong>共享账号(管理员的)</strong>
|
||||
<em>会员曲目可以完整播放,但播放记录会记到管理员账号名下</em>
|
||||
<em>查看共享账号的歌单和推荐</em>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="account-choice-note">
|
||||
这个选择只影响本站的搜索、歌单和试听。房间里播歌
|
||||
(网页点歌后由机器人播放、<code>!play</code>)一直用共享账号,无论这里怎么选。
|
||||
这个选择影响网页端的搜索、歌单和推荐。房间播歌使用机器人共享账号。
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -444,6 +444,12 @@
|
||||
<div class="account-status" :class="{ logged: qqAuth.loggedIn }">
|
||||
{{ qqAuth.loggedIn ? `已登录: ${qqAuth.nickname}` : '未登录' }}
|
||||
</div>
|
||||
<div v-if="qqRenewalMessage" class="account-status">
|
||||
{{ qqRenewalMessage }}
|
||||
</div>
|
||||
<div v-if="qqAuth.renewalStatus" class="account-status">
|
||||
上次成功续期 {{ qqAuth.lastRefreshAt ? new Date(qqAuth.lastRefreshAt).toLocaleString() : '暂无记录' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -976,7 +982,7 @@
|
||||
<label v-if="session.isAdmin.value" class="profile-toggle behavior-toggle">
|
||||
<div class="profile-toggle-text">
|
||||
<div class="profile-toggle-label">每个成员使用自己的音乐账号</div>
|
||||
<div class="profile-toggle-hint">开启后,成员在「我的音乐账号」里绑定自己的网易云,<strong>网页端</strong>的搜索、歌单、每日推荐和试听地址都按他自己的账号获取,看不到管理员的歌单和收藏。未绑定、游客或未开启时沿用机器人的共享账号。默认关闭。目前仅网易云支持个人绑定。<br />房间里的播放(网页点歌后由机器人播放、<code>!play</code>、自动切歌)始终使用共享账号 —— 成员没有会员也能正常听歌,只是播放记录会集中到共享账号上。这就是「会员可共享、数据可隔离」的组合。</div>
|
||||
<div class="profile-toggle-hint">开启后,成员可用自己绑定或管理员分配的账号访问网页搜索、歌单和推荐。仅网易云支持成员扫码绑定。没有专属账号时使用机器人共享账号。房间播歌始终使用共享账号。</div>
|
||||
</div>
|
||||
<input
|
||||
v-model="perUserMusicAccounts"
|
||||
@@ -1445,7 +1451,22 @@ const kugouLoginMode = ref<'qr' | 'cookie' | null>(null);
|
||||
|
||||
// Auth status
|
||||
const neteaseAuth = reactive({ loggedIn: false, nickname: '', avatarUrl: '' });
|
||||
const qqAuth = reactive({ loggedIn: false, nickname: '', avatarUrl: '' });
|
||||
const qqAuth = reactive({
|
||||
loggedIn: false, nickname: '', avatarUrl: '',
|
||||
renewalStatus: '' as '' | 'cookie_only' | 'scheduled' | 'retrying' | 'reauth_required',
|
||||
nextRefreshAt: null as string | null,
|
||||
lastRefreshAt: null as string | null,
|
||||
});
|
||||
const qqRenewalMessage = computed(() => {
|
||||
const next = qqAuth.nextRefreshAt ? new Date(qqAuth.nextRefreshAt).toLocaleString() : '';
|
||||
switch (qqAuth.renewalStatus) {
|
||||
case 'cookie_only': return '没有续期凭据,请扫码授权';
|
||||
case 'reauth_required': return '续期已暂停,请重新扫码';
|
||||
case 'scheduled': return `下次自动续期 ${next}`;
|
||||
case 'retrying': return `续期将于 ${next} 重试`;
|
||||
default: return '';
|
||||
}
|
||||
});
|
||||
const bilibiliAuth = reactive({ loggedIn: false, nickname: '', avatarUrl: '' });
|
||||
const kugouAuth = reactive({ loggedIn: false, nickname: '', avatarUrl: '' });
|
||||
const jellyfinAuth = reactive({ loggedIn: false, nickname: '' });
|
||||
|
||||
Reference in new issue
Block a user