Skip to content

Commit

Permalink
Merge pull request #15 from Enraged-Dun-Cookie-Development-Team/ablupi
Browse files Browse the repository at this point in the history
优化资源请求
  • Loading branch information
ablupi authored Nov 9, 2023
2 parents daef4f6 + 9b9cb4e commit 47975c3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
1 change: 0 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<meta name="description" content="明日方舟相关工具——小刻食堂,用于记录和推送明日方舟相关动态的工具">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-5V1G2BVSJ3"></script>
<script src="https://unpkg.com/ceobe-canteen-static/version.js"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
Expand Down
2 changes: 1 addition & 1 deletion src/request/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ axios.interceptors.response.use(
// }
if (response.status === 200) {
// 请求状态码为200,但接口状态码不为0或者其他正常响应码时可以在这里做一层过滤
switch (response.data?.code) {
switch (response.data?.code || '00000') {
case '00000':
// 有需要可以使用resetType(response)将所有字段类型全部转成string。
// return resetType(response)
Expand Down
22 changes: 18 additions & 4 deletions src/views/mobile/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
</div>
</div>
<div class="p-box">
<div class="donate-box" v-for="donate in state.donateList">
<div class="donate-box" v-for="donate in donateList">
<v-card>
<img class="w-100" :src="require('@/assets/image/detailsContent/donate/'+donate.img)">
<v-card-actions v-if="donate.link">
Expand All @@ -97,7 +97,7 @@
<box-title icon="icon-xiaoke-a-lianhe3" title="关于我们" ></box-title>
<div class="team-bar" id="mo-about-us">
<div class="member" v-for="(member, index) in teamData" :key="index">
<div class="head">
<div class="head" @click="toLink(member.link.length>0?member.link[0].value:'')">
<img :src="require('@/assets/image/detailsContent/team/'+member.coverImg)" alt="">
</div>
<span>{{ member.name }}</span>
Expand All @@ -121,7 +121,8 @@

<script lang="ts" setup>
import footers from './footers.vue'
import { ref, reactive, inject } from 'vue'
import { ref, reactive, inject, onMounted } from 'vue'
import axios from 'axios'
import MoModal from '@/components/mobile/modal.vue'
import { version_app } from '@/request/api'
import { APP_STRUCTURE } from '@/assets/constant/install'
Expand All @@ -134,11 +135,24 @@ const type = inject('type')
const state = reactive({
appStructure: APP_STRUCTURE,
installAppInfo: [] as any,
donateList: type === window.version ? FOLLOW_LIST : DONATE_LIST as Array<any>
})
const showModal = ref(false)
const teamData = ref<Array<any>>(TEAM_LIST)
const donateList = ref<Array<any>>(DONATE_LIST)
onMounted(() => {
if (type) {
donateList.value = []
axios({
method: 'get',
url: `https://unpkg.com/ceobe-canteen-static/version.json`
}).then((res: any) => {
const version = res.data.version
donateList.value = type === version ? FOLLOW_LIST : DONATE_LIST as Array<any>
})
}
})
const getVersionApp = (params?: any) => {
version_app(params)
Expand Down

0 comments on commit 47975c3

Please sign in to comment.