main
王文龙 2023-12-01 10:15:06 +08:00
parent a667af8e7d
commit fe47426b04
8 changed files with 89 additions and 44 deletions

4
.env
View File

@ -3,7 +3,7 @@ VITE_TOKEN_KEY=tokenKey
VITE_URL_PREFIX=/api VITE_URL_PREFIX=/api
# VITE_BASE_APP_ID='wx0fd5e237dba24ff4' # VITE_BASE_APP_ID='wx0fd5e237dba24ff4'
VITE_BASE_APP_ID='wxbad2e8a91c62a734' # VITE_BASE_APP_ID='wxbad2e8a91c62a734'
# VITE_BASE_APP_SECRET='14f1027251416b49734c36bf58d6a741' # VITE_BASE_APP_SECRET='14f1027251416b49734c36bf58d6a741'
VITE_BASE_APP_SECRET='e1b7fc425ca9cca05dd83609a6dc9c00' # VITE_BASE_APP_SECRET='e1b7fc425ca9cca05dd83609a6dc9c00'

View File

@ -7,3 +7,7 @@ VITE_USE_COMPRESS=false
VITE_USE_REPORT=false VITE_USE_REPORT=false
VITE_BASE_API_URL='http://139.224.10.234:8088' VITE_BASE_API_URL='http://139.224.10.234:8088'
VITE_BASE_APP_ID='wxbad2e8a91c62a734'
VITE_BASE_APP_SECRET='e1b7fc425ca9cca05dd83609a6dc9c00'

View File

@ -7,3 +7,7 @@ VITE_USE_COMPRESS=true
VITE_USE_REPORT=false VITE_USE_REPORT=false
VITE_BASE_API_URL='/' VITE_BASE_API_URL='/'
VITE_BASE_APP_ID='wx292995002b9476f3'
VITE_BASE_APP_SECRET='896202811f43b146123f8d3f9ad3c153'

View File

@ -1,7 +1,29 @@
server { server {
listen 4399; listen 80;
listen [::]:80;
server_name admin.swfc.store; server_name admin.swfc.store;
# 配置HTTP到HTTPS的重定向可选
return 301 https://admin.swfc.store$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name admin.swfc.store;
ssl_certificate /etc/nginx/ssl/admin.swfc.store/admin.swfc.store.pem;
ssl_certificate_key /etc/nginx/ssl/admin.swfc.store/admin.swfc.store.key;
# 配置SSL参数
ssl_protocols TLSv1.2 TLSv1.3; # 指定支持的SSL/TLS协议版本
ssl_prefer_server_ciphers on; # 使用服务器端加密套件顺序
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; # 指定加密套件
# 配置其他SSL选项
ssl_session_timeout 1d; # SSL会话过期时间
ssl_session_cache shared:SSL:10m; # SSL会话缓存大小
ssl_session_tickets off; # 禁用SSL会话票据
gzip on; gzip on;
# 定义要压缩的文件类型 # 定义要压缩的文件类型
gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
@ -21,13 +43,9 @@ server {
gzip_static on; gzip_static on;
root /usr/share/nginx/html/admin/dist; root /usr/share/nginx/html/admin/dist;
location / {
index index.html index.htm; index index.html index.htm;
# try_files $uri $uri/ @router; location / {
} try_files $uri $uri/ /index.html;
location @router {
rewrite ^.*$ /index.html break;
} }
location /api{ location /api{

48
h5.conf
View File

@ -1,13 +1,28 @@
# server{
# listen 80;
# listen [::]:80;
# server_name www.swfc.store swfc.store;
# # 重定向到 HTTPS
# # return 301 https://swfc.store$request_uri;
# # return 301 https://$host$request_uri;
# # 配置HTTP到HTTPS的重定向可选
# # if ($scheme != "https") {
# # return 301 https://swfc.store;
# # }
# }
server { server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
server_name swfc.flameby.com; server_name www.swfc.store swfc.store;
listen 443 ssl; listen 443 ssl http2;
server_name swfc.flameby.com; listen [::]:443 ssl http2;
server_name www.swfc.store swfc.store;
ssl_certificate /etc/nginx/ssl/swfc.flameby.com/swfc.flameby.com.pem; ssl_certificate /etc/nginx/ssl/swfc.store/swfc.store.pem;
ssl_certificate_key /etc/nginx/ssl/swfc.flameby.com/swfc.flameby.com.key; ssl_certificate_key /etc/nginx/ssl/swfc.store/swfc.store.key;
# 配置SSL参数 # 配置SSL参数
ssl_protocols TLSv1.2 TLSv1.3; # 指定支持的SSL/TLS协议版本 ssl_protocols TLSv1.2 TLSv1.3; # 指定支持的SSL/TLS协议版本
ssl_prefer_server_ciphers on; # 使用服务器端加密套件顺序 ssl_prefer_server_ciphers on; # 使用服务器端加密套件顺序
@ -18,11 +33,6 @@ server {
ssl_session_cache shared:SSL:10m; # SSL会话缓存大小 ssl_session_cache shared:SSL:10m; # SSL会话缓存大小
ssl_session_tickets off; # 禁用SSL会话票据 ssl_session_tickets off; # 禁用SSL会话票据
# 配置HTTP到HTTPS的重定向可选
if ($scheme != "https") {
return 301 https://swfc.flameby.com;
}
gzip on; gzip on;
# 定义要压缩的文件类型 # 定义要压缩的文件类型
gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
@ -42,13 +52,10 @@ server {
gzip_static on; gzip_static on;
root /usr/share/nginx/html/h5/dist; root /usr/share/nginx/html/h5/dist;
location / {
index index.html index.htm; index index.html index.htm;
try_files $uri $uri/ @router; location / {
} # try_files $uri $uri/ @router;
try_files $uri $uri/ /index.html;
location @router {
rewrite ^.*$ /index.html break;
} }
location /api{ location /api{
@ -62,4 +69,13 @@ server {
rewrite ^/api(.*)$ $1 break; rewrite ^/api(.*)$ $1 break;
proxy_pass http://localhost:8088; proxy_pass http://localhost:8088;
} }
location /mp/ {
alias /usr/share/nginx/html/mp/;
try_files $uri $uri/ =404;
}
location ~* \.txt$ {
allow all;
}
} }

View File

@ -41,7 +41,8 @@ const share = async (title: string, desc: string, link: string, imgUrl: string)
const shareData = { const shareData = {
title, title,
desc, desc,
link: link.replace(/\?time=\d+(#)/gi, '$1'), // link: link.replace(/\?time=\d+(#)/gi, '$1'),
link,
imgUrl, imgUrl,
success: function (res: any) { success: function (res: any) {
console.log('wx success', res); console.log('wx success', res);
@ -82,7 +83,8 @@ const share = async (title: string, desc: string, link: string, imgUrl: string)
const shareData = { const shareData = {
title, title,
desc, desc,
link: link.replace(/\?time=\d+(#)/gi, '$1'), // link: link.replace(/\?time=\d+(#)/gi, '$1'),
link,
imgUrl, imgUrl,
success: function (res: any) { success: function (res: any) {
console.log('wx share success', res); console.log('wx share success', res);

View File

@ -102,7 +102,9 @@
v-for="(l, i) in lang" v-for="(l, i) in lang"
:key="l.key" :key="l.key"
> >
<template v-if="shopDetail[selLang]">
<span <span
v-if="shopDetail[l.key]"
:style="l.key === 'introJap' ? { fontFamily: 'Arial, Helvetica, sans-serif' } : ''" :style="l.key === 'introJap' ? { fontFamily: 'Arial, Helvetica, sans-serif' } : ''"
:class="l.key === 'introJap' ? 'text-36px' : 'text-40px'" :class="l.key === 'introJap' ? 'text-36px' : 'text-40px'"
>{{ l.lang }}</span >{{ l.lang }}</span
@ -118,12 +120,13 @@
src="@/assets/imgs/shop-detail/hyqq@2x.png" src="@/assets/imgs/shop-detail/hyqq@2x.png"
alt="" alt=""
/> />
</template>
</div> </div>
</div> </div>
<div <div
class="box-border mx-auto transition-all px-30px py-70px text-32px content w-690px min-h-300px rounded-3xl" class="box-border mx-auto transition-all px-30px py-70px text-32px content w-690px min-h-300px rounded-3xl"
:class="[selLang === 'introChi' && 'rounded-tl-0px', selLang === 'introJap' && 'rounded-tr-0px']" :class="[selLang === 'introChi' && 'rounded-tl-0px', selLang === 'introJap' && 'rounded-tr-0px']"
:style="selLang === 'introJap' ? { fontFamily: 'Arial, Helvetica, sans-serif' } : ''" :style="selLang !== 'introEng' ? { fontFamily: 'Arial, Helvetica, sans-serif' } : '' "
> >
{{ shopDetail[selLang] }} {{ shopDetail[selLang] }}
</div> </div>
@ -281,6 +284,7 @@
showImgPreview.value = true; showImgPreview.value = true;
}; };
const handleSelLang = (key: string) => { const handleSelLang = (key: string) => {
if(!shopDetail.value[key]) return
selLang.value = key; selLang.value = key;
}; };

View File

@ -137,7 +137,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, nextTick, watch, onMounted } from 'vue'; import { ref, nextTick, watch } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { handleWxRedict, getQueryString } from '@/utils/util'; import { handleWxRedict, getQueryString } from '@/utils/util';
import shareWechat from '@/utils/wxH5Share'; import shareWechat from '@/utils/wxH5Share';
@ -196,8 +196,6 @@
const handleClick = async (item: any) => { const handleClick = async (item: any) => {
if (!token.value) return (location.href = handleWxRedict()); if (!token.value) return (location.href = handleWxRedict());
// 001Mol1000Yj4R1raU100kCKRM0Mol1G
console.log('🚀 ~ file: index.vue:197 ~ item:', item);
// state truefalse // state truefalse
if (item.state) { if (item.state) {
selId.value = item.id; selId.value = item.id;
@ -230,7 +228,7 @@
duration: 1000, duration: 1000,
}); });
try { try {
const req = { id: selId.value, checkCode: checkCode.value, openId: userInfo.value.openid }; const req = { id: selItem.value.id, checkCode: checkCode.value, openId: userInfo.value.openid };
const { code } = await queryVerification(req); const { code } = await queryVerification(req);
if (code === 200) { if (code === 200) {
checkCode.value = ''; checkCode.value = '';
@ -252,14 +250,15 @@
}); });
}; };
const handleShareWechat = async () => { const handleShareWechat = () => {
// if (token.value) { // if (token.value) {
shareWechat( return shareWechat(
'tit', 'SWFC寻味环球 共飨美馔',
'content', '',
`${window.location.origin}}`, `${window.location.origin}`,
'https://img10.360buyimg.com/ling/jfs/t1/181258/24/10385/53029/60d04978Ef21f2d42/92baeb21f907cd24.jpg', 'https://huanqiuzhongxin.oss-cn-shanghai.aliyuncs.com/shipin/logo.png',
); );
// window.location.origin
// } else location.href = handleWxRedict(); // } else location.href = handleWxRedict();
}; };
@ -299,9 +298,7 @@
init(); init();
onMounted(async () => {
handleShareWechat(); handleShareWechat();
});
watch(show, (val) => { watch(show, (val) => {
if (val) { if (val) {