mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-04-06 09:16:39 +08:00
fix: 加载优化、vip状态优化、apikey优化
This commit is contained in:
@@ -3,7 +3,7 @@ import { CircleCheck } from '@element-plus/icons-vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { applyApiKey, getApiKey, getRechargeLog } from '@/api/model/index.ts';
|
||||
import { applyApiKey, getApiKey } from '@/api/model/index.ts';
|
||||
import { isUserVip } from '@/utils/user';
|
||||
|
||||
const apiKey = ref('');
|
||||
@@ -29,8 +29,6 @@ const router = useRouter();
|
||||
async function fetchApiKey() {
|
||||
try {
|
||||
const res = await getApiKey();
|
||||
const res2 = await getRechargeLog();
|
||||
console.log('re2', res2);
|
||||
if (res.data?.apiKey) {
|
||||
apiKey.value = res.data.apiKey;
|
||||
displayedKey.value = res.data.apiKey;
|
||||
@@ -43,7 +41,7 @@ async function fetchApiKey() {
|
||||
|
||||
// 领取密钥
|
||||
async function handleClaim() {
|
||||
if (!isUserVip) {
|
||||
if (!isUserVip()) {
|
||||
ElMessageBox.confirm(
|
||||
`
|
||||
<div class="text-center leading-relaxed">
|
||||
@@ -172,7 +170,7 @@ onMounted(async () => {
|
||||
element-loading-background="rgba(122, 122, 122, 0.8)"
|
||||
>
|
||||
<!-- 未领取状态 -->
|
||||
<div v-if="!apiKey " class="unclaimed-state">
|
||||
<div v-if="!apiKey" class="unclaimed-state">
|
||||
<div class="gift-container" @click="handleClaim">
|
||||
<div class="gift-box" :class="{ opening: isOpening }">
|
||||
<div class="gift-lid" />
|
||||
@@ -239,7 +237,7 @@ onMounted(async () => {
|
||||
</div>
|
||||
</div>
|
||||
<!-- 使用说明 -->
|
||||
<div class="usage-guide">
|
||||
<div v-if="apiKey" class="usage-guide">
|
||||
<el-divider />
|
||||
<h3>使用说明</h3>
|
||||
<div class="guide-content">
|
||||
|
||||
Reference in New Issue
Block a user