web: support custom tweet image thumbnail argument in .env/.env.local

pull/166/head
Michael Li 2 years ago
parent 54fa8dc004
commit c3c956dcf5

@ -12,3 +12,10 @@ VITE_ALLOW_PHONE_BIND=true
# 局部参数 # 局部参数
VITE_DEFAULT_TWEET_VISIBILITY=public VITE_DEFAULT_TWEET_VISIBILITY=public
# 图片推文404参数
VITE_DEFAULT_TWEET_IMAGE_404="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png"
# AliOSS 图片thumbnail参数
VITE_TWEET_IMAGE_THUMBNAIL="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png"
# MinIOn 图片thumbnail参数
# VITE_TWEET_IMAGE_THUMBNAIL="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png"

@ -225,10 +225,8 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
const defaultImg = const defaultImg = import.meta.env.VITE_DEFAULT_TWEET_IMAGE_404;
'https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png'; const thumbnail = import.meta.env.VITE_TWEET_IMAGE_THUMBNAIL;
const thumbnail =
'?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png';
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
imgs: Item.PostItemProps[], imgs: Item.PostItemProps[],
}>(), { }>(), {

@ -12,6 +12,8 @@ interface ImportMetaEnv {
readonly VITE_ALLOW_TWEET_VISIBILITY: string readonly VITE_ALLOW_TWEET_VISIBILITY: string
readonly VITE_ALLOW_PHONE_BIND: string readonly VITE_ALLOW_PHONE_BIND: string
readonly VITE_DEFAULT_TWEET_VISIBILITY: string readonly VITE_DEFAULT_TWEET_VISIBILITY: string
readonly VITE_DEFAULT_TWEET_IMAGE_404: string
readonly VITE_TWEET_IMAGE_THUMBNAIL: string
} }
interface ImportMeta { interface ImportMeta {

Loading…
Cancel
Save