当前位置:网站首页>解决uni-app 打包H5网站 下载图片问题
解决uni-app 打包H5网站 下载图片问题
2022-08-02 03:24:00 【auspi12341】
接收一个H5打包app的项目,其中分享图片和H5网站不同域, 使用A标签download来下载图片因为存在跨域问题是直接打开新窗口,而不是下载图片
解决方案:
使用nginx反向代理功能
location ^~ /static/rcode/
{
proxy_pass http://xxx.com/static/rcode/;
proxy_set_header Host xxx.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
add_header X-Cache $upstream_cache_status;
#Set Nginx Cache
set $static_fileFRUN9puK 0;
if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )
{
set $static_fileFRUN9puK 1;
expires 12h;
}
if ( $static_fileFRUN9puK = 0 )
{
add_header Cache-Control no-cache;
}
}解决图片跨域问题,实现下载功能
边栏推荐
猜你喜欢
随机推荐
Circular linked list---------Joseph problem
如何根据地图上的两个坐标点来确定方向
6.27面试集
啃瓜记录又一天
一个结构体 = 另一个结构体(同类型结构体之间可直接赋值操作)
querystring模块
L1-043 阅览室 (20分)
js作用域与闭包
解决glob()返回文件排序不一致问题&onnx本地按照安装方法
vue3 访问数据库中的数据
FreeRTOS内核详解(1) —— 临界段保护原理
uniapp | 官方提供的map组件使用问题
三元判断再三元判断
canvas--饼状图
js takes the value of a feature at a certain position in the string, such as Huawei=> Huawei
1.6一些今日学习
环形链表---------约瑟夫问题
page load process
我的小笔记 =》其他东东
Amazon sellers how to improve the conversion








