Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 40 additions & 3 deletions src/components/card/Status.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,46 @@
<div class="my-5 bg-info/5 shadow-md px-4 py-5 flex flex-col relative rounded-lg">
<span class="font-bold text-2xl">欢迎来到可露希尔线上零售店</span>
<div class="mt-8">
<span class="font-bold text-2xl md:text-4xl">点击 ↓↓ 查看<span class="text-info">『托管详情』</span></span><br>
<img class="absolute right-0 bottom-0 w-28 md:w-36 opacity-10 md:opacity-50 rounded-t-full rounded-bl-full"
<div class="flex flex-col gap-2 font-bold text-xl md:text-2xl z-10 relative">
<span>当前版本:v{{ version }} <span class="text-sm opacity-60 font-normal">(居然还能跑)</span></span>
<div class="flex items-center gap-2 cursor-pointer group w-fit" @click="refreshVersion">
<span>最新版本:</span>
<span v-if="isLoading" class="loading loading-dots loading-md text-info"></span>
<span v-else class="text-info group-hover:underline decoration-wavy decoration-2 underline-offset-4">v{{
latestVersion }}</span>
<span v-if="!isLoading"
class="text-sm opacity-60 font-normal group-hover:text-info transition-colors">(点我看看新货)</span>
</div>
</div>
<img
class="absolute right-0 bottom-0 w-28 md:w-36 opacity-10 md:opacity-50 rounded-t-full rounded-bl-full pointer-events-none"
src="/assets/closure.ico" alt="start">
</div>
</div>
</template>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { checkVersion } from '../../checkVersion';

const version = import.meta.env.VITE_APP_VERSION;
const latestVersion = ref<number | string>('?');
const isLoading = ref(false);

const refreshVersion = async () => {
if (isLoading.value) return;
isLoading.value = true;
try {
const v = await checkVersion();
latestVersion.value = v;
} catch (e) {
latestVersion.value = '获取失败';
} finally {
isLoading.value = false;
}
};

onMounted(() => {
refreshVersion();
});
</script>
3 changes: 2 additions & 1 deletion src/views/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="flex flex-col lg:flex-row pt-6 lg:pt-12 px-2 lg:px-10w h-full">
<div class="flex flex-col justify-center items-start slide-in-bottom">
<div class="gap-2 mb-4 hidden md:flex">
<div class="badge bg-info/80 text-xl py-8 px-6 md:p-4">当前版本:V3.0.2</div>
<div class="badge bg-info/80 text-xl py-8 px-6 md:p-4">当前版本:V{{ version }}</div>
<div class="badge badge-info badge-outline text-xl py-8 px-6 md:p-4">游戏版本:2.1.01</div>
</div>
<div class="text-6xl font-extrabold md:text-7xl flex duration-200">
Expand Down Expand Up @@ -88,6 +88,7 @@ import { userStore } from "../store/user";
import { isNight } from "../plugins/common";
import APIStatusBoard from "../components/APIStatus/APIStatusBoard.vue";
import apiClient from "../plugins/axios/apiClient";
const version = import.meta.env.VITE_APP_VERSION;
const closure = ref(false); // Closure 图标动画
const textRef = ref();
const user = userStore();
Expand Down
2 changes: 1 addition & 1 deletion worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
export default {
async fetch(request) {
const corsHeaders = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Origin': 'closure.ltsc.vip',
'Access-Control-Allow-Methods': 'GET',
'Content-Type': 'application/json',
'Cache-Control': 'no-cache'
Expand Down
Loading