Merge pull request #166 from alimy/jc/alimy

web: support custom tweet image thumbnail argument in .env/.env.local
pull/167/head
Michael Li 2 years ago committed by GitHub
commit aa34122a91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -12,3 +12,10 @@ VITE_ALLOW_PHONE_BIND=true
# 局部参数
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">
import { ref, onMounted } from 'vue';
const defaultImg =
'https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png';
const thumbnail =
'?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png';
const defaultImg = import.meta.env.VITE_DEFAULT_TWEET_IMAGE_404;
const thumbnail = import.meta.env.VITE_TWEET_IMAGE_THUMBNAIL;
const props = withDefaults(defineProps<{
imgs: Item.PostItemProps[],
}>(), {

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

Loading…
Cancel
Save