refactor: 移除内嵌皮肤站页面
Sync source to CNB / Sync Git ref (push) Skipped

主页已改为原生界面,整页内嵌网页不再需要:

- 删除 SkinSiteFrame.vue 与 StarlightSkin.vue。
- 移除 /starlight-skin 路由。
- 删除不再使用的 skinSiteFrameUrl 导出。
- 实例玩家弹窗的"去皮肤站登录"改为直接打开登录弹窗,不再跳转页面。
This commit is contained in:
AxTps committed 2026-10-17 19:19:05 +08:00
1 parent 8599a014ad
commit 86306b8ddd
5 files changed
+4 -51

No files matched your search

@@ -1,11 +1,10 @@
<script setup lang="ts"> <script setup lang="ts">
import { ButtonStyled, NewModal, useVIntl } from '@modrinth/ui' import { ButtonStyled, NewModal, useVIntl } from '@modrinth/ui'
import { computed, onUnmounted, ref, watch } from 'vue' import { computed, onUnmounted, ref, watch } from 'vue'
import { useRouter } from 'vue-router'
import MinecraftLoginModal from '@/components/ui/MinecraftLoginModal.vue' import MinecraftLoginModal from '@/components/ui/MinecraftLoginModal.vue'
import SkinSiteLoginModal from '@/components/ui/skin-site/SkinSiteLoginModal.vue'
import { import {
openSkinSiteLogin,
requestSkinSitePlayers, requestSkinSitePlayers,
skinSitePlayers, skinSitePlayers,
skinSiteStatus, skinSiteStatus,
@@ -28,7 +27,7 @@ const { formatMessage } = useVIntl()
const modal = ref<InstanceType<typeof NewModal>>() const modal = ref<InstanceType<typeof NewModal>>()
const microsoftLogin = ref<InstanceType<typeof MinecraftLoginModal>>() const microsoftLogin = ref<InstanceType<typeof MinecraftLoginModal>>()
const router = useRouter() const skinSiteLoginModal = ref<InstanceType<typeof SkinSiteLoginModal>>()
const accounts = ref<PlayerChoice[]>([]) const accounts = ref<PlayerChoice[]>([])
const active = ref(false) const active = ref(false)
const loading = ref(false) const loading = ref(false)
@@ -137,9 +136,8 @@ function signInSkinSite() {
rejectSelection?.(new PlayerSelectionNavigatedAwayError()) rejectSelection?.(new PlayerSelectionNavigatedAwayError())
resolveSelection = undefined resolveSelection = undefined
rejectSelection = undefined rejectSelection = undefined
openSkinSiteLogin() skinSiteLoginModal.value?.show()
modal.value?.hide() modal.value?.hide()
void router.push('/starlight-skin')
} }
const unregister = registerInstancePlayerPicker((id, saved) => { const unregister = registerInstancePlayerPicker((id, saved) => {
@@ -246,5 +244,6 @@ onUnmounted(() => {
<p v-if="saving" class="m-0" role="status">{{ formatMessage(messages.saving) }}</p> <p v-if="saving" class="m-0" role="status">{{ formatMessage(messages.saving) }}</p>
</div> </div>
</NewModal> </NewModal>
<SkinSiteLoginModal ref="skinSiteLoginModal" @signed-in="refresh" />
<MinecraftLoginModal ref="microsoftLogin" @complete="refresh" /> <MinecraftLoginModal ref="microsoftLogin" @complete="refresh" />
</template> </template>
@@ -1,23 +0,0 @@
<script setup lang="ts">
import { defineMessages, useVIntl } from '@modrinth/ui'
import { skinSiteFrameUrl } from '@/composables/skin-site-session'
const { formatMessage } = useVIntl()
const messages = defineMessages({
frameTitle: {
id: 'app.starlight-skin.frame-title',
defaultMessage: 'StarLight Skin Site',
},
})
</script>
<template>
<iframe
:src="skinSiteFrameUrl"
allow="clipboard-write; clipboard-read"
:title="formatMessage(messages.frameTitle)"
class="block h-full min-h-0 w-full border-0"
/>
</template>
@@ -274,12 +274,6 @@ export async function requestSkinSiteLuck(): Promise<number> {
// Legacy compatibility // Legacy compatibility
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
/**
* @deprecated The home view renders the skin site natively now. Kept only so
* the transitional `SkinSiteFrame.vue` still compiles until it is replaced.
*/
export const skinSiteFrameUrl = readonly(ref(`${SKIN_SITE_ORIGIN}/`))
/** /**
* Replace a player's skin texture. * Replace a player's skin texture.
* *
@@ -1,9 +0,0 @@
<script setup lang="ts">
import SkinSiteFrame from '@/components/ui/SkinSiteFrame.vue'
</script>
<template>
<div class="h-full min-h-0">
<SkinSiteFrame />
</div>
</template>
-8
View File
@@ -93,14 +93,6 @@ export default new createRouter({
discordActivity: 'Changing skins...', discordActivity: 'Changing skins...',
}, },
}, },
{
path: '/starlight-skin',
name: 'Starlight skin',
component: () => import('@/pages/StarlightSkin.vue'),
meta: {
breadcrumb: [{ name: 'Starlight skin' }],
},
},
{ {
path: '/screenshots', path: '/screenshots',
name: 'Screenshots', name: 'Screenshots',