摘要: 使用 encodeURIComponent() 对 URI 进行编码: 对URL不进行编码的情况下: window.location.href= '{% url 'b' %}?num=aaa&aa' num 的值就会为 aaa,因为&是拼接参数 对URL进行编码: var url = encodeU 阅读全文
posted @ 2021-12-31 16:02 小渔儿 阅读(317) 评论(0) 推荐(0)
摘要: 在Django项目中: 用到 MEDIA_URL = "/media/" 如何下载文件 一、如果保存的时候更改了上传的文件名字,下载时想要和上传的时名字一样,需要编写下载函数。 接下来编写的是下载文件的函数: from django.http import FileResponse def down 阅读全文
posted @ 2021-12-31 15:18 小渔儿 阅读(788) 评论(0) 推荐(0)