开启cdn,导致二维码生成失败,需要在阿里云cdn 添加自定义头

pull/5/head
youngS 4 years ago
parent c8465522f0
commit a5388cb9e7
  1. 35
      fir_client/src/components/FirAppInfosBase.vue
  2. 2
      fir_client/src/utils/index.js
  3. 4
      fir_ser/fir_ser/settings.py

@ -4,7 +4,7 @@
<div class="banner">
<div class="middle-wrapper">
<div @click="defaulttimeline">
<img :src="icon_url" class="appicon" style="width:100px; height:100px">
<img ref="icon_url" :src="icon_url" class="appicon" style="width:100px; height:100px" alt="">
</div>
<div class="badges">
<span class="bundleid">SHORT<b class="short">&nbsp;&nbsp;{{ appinfos.short }}</b></span>
@ -19,7 +19,7 @@
width="288">
<div style="text-align: center; margin: 0">
<vue-qr :margin="qrinfo.margin"
:logoSrc="b64_icon_url" :logoScale="qrinfo.logoScale"
:logoSrc="icon_url" :logoScale="qrinfo.logoScale"
:logoCornerRadius="qrinfo.logoCornerRadius"
:correctLevel="qrinfo.correctLevel"
:text="short_url()" :size="266"
@ -94,7 +94,6 @@
<script>
import {apputils} from "../restful";
import VueQr from 'vue-qr';
import {ImgToBase64} from "../utils"
export default {
name: "FirAppInfosBase",
@ -103,19 +102,6 @@
},
data() {
return {
save_qr() {
let dtype = "I";
if (this.master_release.release_type === 0) {
dtype = "A";
}
let a = document.createElement('a');
//
a.download = this.appinfos.name + '_' + dtype + "_下载码";
//url
a.href = this.$refs.qr.$el.src;
//
a.dispatchEvent(new MouseEvent('click'))
},
qrinfo: {
logoScale: 0.3,
logoCornerRadius: 12,
@ -123,7 +109,6 @@
margin: 20
},
icon_url: "",
b64_icon_url: '',
appinfos: {},
master_release: {},
allapp: [],
@ -133,6 +118,19 @@
}
},
methods: {
save_qr() {
let dtype = "I";
if (this.master_release.release_type === 0) {
dtype = "A";
}
let a = document.createElement('a');
//
a.download = this.appinfos.name + '_' + dtype + "_下载码";
//url
a.href = this.$refs.qr.$el.src;
//
a.dispatchEvent(new MouseEvent('click'))
},
short_url() {
return location.origin + '/' + this.appinfos.short;
},
@ -186,9 +184,6 @@
},
set_icon_url() {
this.icon_url = this.$store.state.currentapp.master_release.icon_url;
ImgToBase64(this.icon_url, dataURL => {
this.b64_icon_url = dataURL;
})
},
}, created() {

@ -276,7 +276,7 @@ export function ImgToBase64(url, callback) {
let Img = new Image(),
dataURL = '';
Img.src = url + '?v=' + Math.random();
Img.setAttribute('crossOrigin', 'Anonymous');
Img.crossOrigin = 'Anonymous';
Img.onload = function () {
let canvas = document.createElement('canvas'),
width = Img.width,

@ -196,7 +196,9 @@ THIRD_PART_CONFIG = {
'name': 'local',
'type': 0,
'auth': {
'domain_name': 'app.hehelucky.cn', # 正式环境需要填写正式的访问域名,如果配置cdn,可以填写cdn的域名,仅支持阿里云 cdn
'domain_name': 'app.hehelucky.cn',
# 正式环境需要填写正式的访问域名,如果配置cdn,可以填写cdn的域名,仅支持阿里云 cdn,
# 开启cdn之后,如果该域名和服务器域名不相同,需要设置阿里云cdn 缓存配置,自定义HTTP响应头 添加 Access-Control-Allow-Origin * 才可以
'is_https': True,
'download_auth_type': 0, # 0:不开启token 1:本地token 2:cdn 开启cdn,并且使用本地存储,使用阿里云cdn进行url鉴权,
'cnd_auth_key': '', # 当cdn为阿里云并且 download_auth_type=2 的时候 生效,需要 开启阿里云OSS私有Bucket回源

Loading…
Cancel
Save