Skip to content

Commit

Permalink
更新图片代理
Browse files Browse the repository at this point in the history
  • Loading branch information
jooooock committed Nov 16, 2024
1 parent 6e823ce commit 817c504
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 69 deletions.
11 changes: 0 additions & 11 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,13 @@ const isDev = !import.meta.env.PROD
const runtimeConfig = useRuntimeConfig()
const websiteID = runtimeConfig.public.umamiWebsiteID
console.log(websiteID)
if (!useLoginAccount().value) {
navigateTo('/login', {replace: true})
}
useHead({
meta: [
{
name: 'referrer',
content: 'no-referrer',
tagPriority: -20,
}
],
script: [
{
src: '/unregister.js',
},
websiteID ?
{
src: 'https://cloud.umami.is/script.js',
Expand Down
3 changes: 2 additions & 1 deletion components/ArticleItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<img v-if="isDeleted" src="~/assets/deleted.png" alt="" class="absolute z-10 size-[100px] right-0 top-64 translate-x-full drop-shadow-[-116px_0_red]">
<div v-if="cover" class="h-60 overflow-hidden" :style="{backgroundColor: themeColor(coverTheme!)}">
<img
:src="cover"
:src="IMAGE_REFERER_PROXY + '?url=' + cover"
loading="lazy"
alt=""
class="object-contain size-full group-hover:scale-110 ease-in-out transition duration-300">
Expand Down Expand Up @@ -46,6 +46,7 @@ import {saveAs} from 'file-saver'
import {Loader} from 'lucide-vue-next';
import {formatTimeStamp, downloadArticleHTML, packHTMLAssets, formatItemShowType} from "~/utils";
import type {AppMsgAlbumInfo, RGB} from "~/types/types";
import {IMAGE_REFERER_PROXY} from '~/config'
interface Props {
Expand Down
14 changes: 14 additions & 0 deletions components/DownloadSetting.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<template>
<UCard class="mx-4 mt-10">
<template #header>
<h3 class="text-2xl font-semibold">下载选项</h3>
<p class="text-sm text-slate-10 font-serif">配置文章下载选项</p>
</template>

<div class="flex space-x-10"></div>
</UCard>
</template>

<script setup lang="ts">
</script>
5 changes: 3 additions & 2 deletions components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</a>
</div>
<div v-if="loginAccount" class="flex flex-col sm:flex-row items-center sm:space-x-2 ml-5">
<img v-if="loginAccount.avatar" :src="loginAccount.avatar" alt="" class="rounded-full size-10">
<img v-if="loginAccount.avatar" :src="IMAGE_REFERER_PROXY + '?url=' + loginAccount.avatar" alt="" class="rounded-full size-10">
<span v-if="loginAccount.nickname">{{loginAccount.nickname}}</span>
</div>
</header>
Expand All @@ -45,7 +45,7 @@
:class="{active: account.fakeid === activeAccount?.fakeid}"
@click="selectAccount(account)"
>
<img v-if="account.type !== 'author'" class="size-20 mr-2" :src="account.round_head_img" alt="">
<img v-if="account.type !== 'author'" class="size-20 mr-2" :src="IMAGE_REFERER_PROXY + '?url=' + account.round_head_img" alt="">
<div class="flex-1">
<div class="flex justify-between">
<p class="font-semibold">{{ account.nickname }}</p>
Expand Down Expand Up @@ -80,6 +80,7 @@ import {Loader, ArrowRightLeft} from "lucide-vue-next";
import {packHTMLAssets} from "~/utils";
import {ACCOUNT_LIST_PAGE_SIZE, ACCOUNT_TYPE} from "~/config";
import {getAccountList} from "~/apis";
import {IMAGE_REFERER_PROXY} from '~/config'
const loginAccount = useLoginAccount()
Expand Down
2 changes: 1 addition & 1 deletion components/ProxySetting.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<UCard class="mx-4 mt-4">
<UCard class="mx-4 mt-10">
<template #header>
<h3 class="text-2xl font-semibold">私有代理</h3>
<p class="text-sm text-slate-10 font-serif">配置的私有代理地址仅供您本人使用</p>
Expand Down
2 changes: 2 additions & 0 deletions config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export const AVAILABLE_PROXY_LIST: string[] = [
'https://wproxy-10.deno.dev/',
]

export const IMAGE_REFERER_PROXY = 'https://clear-alligator-17.deno.dev'

/**
* 扫码状态
*/
Expand Down
3 changes: 2 additions & 1 deletion pages/dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<!-- footer -->
<footer v-if="loginAccount" class="flex flex-col space-y-2 pt-3 border-t">
<div class="flex items-center space-x-2">
<img v-if="loginAccount.avatar" :src="loginAccount.avatar" alt="" class="rounded-full size-10">
<img v-if="loginAccount.avatar" :src="IMAGE_REFERER_PROXY + '?url=' + loginAccount.avatar" alt="" class="rounded-full size-10">
<UTooltip v-if="loginAccount.nickname" class="flex-1 overflow-hidden"
:popper="{ placement: 'top-start', offsetDistance: 16 }">
<template #text>
Expand Down Expand Up @@ -86,6 +86,7 @@
import {Album, ChartNoAxesCombined, Download, Globe, Settings} from 'lucide-vue-next';
import {formatDistance} from "date-fns";
import type {LogoutResponse} from "~/types/types";
import {IMAGE_REFERER_PROXY} from '~/config'
const route = useRoute()
Expand Down
3 changes: 2 additions & 1 deletion pages/dashboard/album.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
</h3>
<time class="text-sm text-slate-10">{{ formatAlbumTime(+article.create_time) }}</time>
</div>
<img class="size-16 ml-4 flex-shrink-0" :src="article.cover_img_1_1" alt="">
<img class="size-16 ml-4 flex-shrink-0" :src="IMAGE_REFERER_PROXY + '?url=' + article.cover_img_1_1" alt="">
</li>
</ul>
<div v-element-visibility="onElementVisibility"></div>
Expand All @@ -131,6 +131,7 @@ import type {AppMsgAlbumResult, ArticleItem, BaseInfo} from "~/types/album";
import {vElementVisibility} from "@vueuse/components"
import {useDownloadAlbum} from '~/composables/useBatchDownload'
import {formatAlbumTime} from "~/utils/album";
import {IMAGE_REFERER_PROXY} from '~/config'
useHead({
Expand Down
2 changes: 2 additions & 0 deletions pages/dashboard/settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
<div class="flex-1 overflow-scroll">
<CredentialSetting />
<ProxySetting />
<DownloadSetting />
<div class="h-[30vh]"></div>
</div>
</div>
</template>

<script setup lang="ts">
useHead({
title: '设置 | 微信公众号文章导出'
});
Expand Down
20 changes: 0 additions & 20 deletions public/register.js

This file was deleted.

17 changes: 0 additions & 17 deletions public/sw.js

This file was deleted.

15 changes: 0 additions & 15 deletions public/unregister.js

This file was deleted.

0 comments on commit 817c504

Please sign in to comment.