Commit c4e10e2b by MichaelJier

fix

1. 对于接口出现不确定情况加入JSON防错处理
2. 区分私有环境图片不加oss样式后缀
3. huaguangyun加入用户ws统计
parent aedad4fa
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</div> </div>
<div class="body"> <div class="body">
<div class="img-box"> <div class="img-box">
<img :src="`${info.real_img}?x-oss-process=style/commodity_cover`" alt="" /> <img :src="info.real_img + (isPrivate ? `` : `x-oss-process=style/commodity_cover`)" alt="" />
</div> </div>
<div class="content"> <div class="content">
<div class="name">{{ info.name }}</div> <div class="name">{{ info.name }}</div>
...@@ -33,7 +33,8 @@ export default { ...@@ -33,7 +33,8 @@ export default {
name: 'vertical-shop-hot', name: 'vertical-shop-hot',
data() { data() {
return { return {
info: {} info: {},
isPrivate: process.env.private
}; };
}, },
computed: { computed: {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<div class="list-item" v-for="(item, index) in sortList" :key="item.id"> <div class="list-item" v-for="(item, index) in sortList" :key="item.id">
<div class="img-box" v-show="value"> <div class="img-box" v-show="value">
<div class="no">{{ sortList.length - index }}</div> <div class="no">{{ sortList.length - index }}</div>
<img v-lazy="`${item.real_img}?x-oss-process=style/commodity_cover`" alt="" /> <img v-lazy="item.real_img + isPrivate ? `` : `x-oss-process=style/commodity_cover`" alt="" />
</div> </div>
<div class="content"> <div class="content">
<div class="name">{{ item.name }}</div> <div class="name">{{ item.name }}</div>
...@@ -75,7 +75,8 @@ export default { ...@@ -75,7 +75,8 @@ export default {
isAjax: true, isAjax: true,
count: 0, count: 0,
num: 10, num: 10,
list: [] list: [],
isPrivate: process.env.private
}; };
}, },
computed: { computed: {
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
<transition name="move-right-left" mode="out-in"> <transition name="move-right-left" mode="out-in">
<div class="shop-hot" v-if="info.id" :key="info.id"> <div class="shop-hot" v-if="info.id" :key="info.id">
<div class="img-box"> <div class="img-box">
<img :src="`${Array.isArray(info.real_img) ? info.real_img[0] : info.real_img}?x-oss-process=style/commodity_cover`" alt="" /> <img
:src="real_img"
alt="" />
</div> </div>
<div class="content"> <div class="content">
<div class="name">{{ info.name }}</div> <div class="name">{{ info.name }}</div>
...@@ -41,13 +43,18 @@ export default { ...@@ -41,13 +43,18 @@ export default {
}, },
data() { data() {
return { return {
info: {} info: {},
}; };
}, },
computed: { computed: {
...mapGetters({ ...mapGetters({
channelInfo: 'channelInfo' channelInfo: 'channelInfo'
}) }),
real_img() {
const {info} = this
const url = Array.isArray(info.real_img) ? info.real_img[0] : info.real_img
return process.env.private ? url : url + `?x-oss-process=style/commodity_cover`
}
}, },
mounted() { mounted() {
this.getRecommendGoods(); this.getRecommendGoods();
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<div class="list-item" v-for="(item, index) in sortList" :key="item.id"> <div class="list-item" v-for="(item, index) in sortList" :key="item.id">
<div class="img-box"> <div class="img-box">
<div class="no">{{ sortList.length - index }}</div> <div class="no">{{ sortList.length - index }}</div>
<img v-lazy="`${item.real_img}?x-oss-process=style/commodity_cover`" alt="" /> <img v-lazy="item.real_img + (isPrivate ? `` : `?x-oss-process=style/commodity_cover`)" alt="" />
</div> </div>
<div class="content"> <div class="content">
<div class="name">{{ item.name }}</div> <div class="name">{{ item.name }}</div>
...@@ -88,7 +88,8 @@ export default { ...@@ -88,7 +88,8 @@ export default {
isAjax: true, isAjax: true,
count: 0, count: 0,
num: 10, num: 10,
list: [] list: [],
isPrivate: process.env.private
}; };
}, },
computed: { computed: {
......
...@@ -67,7 +67,7 @@ export default { ...@@ -67,7 +67,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.real_img = JSON.parse(JSON.stringify(this.caseInfo.goodsInfo.real_img)) this.real_img = this.caseInfo.goodsInfo.real_img ? JSON.parse(JSON.stringify(this.caseInfo.goodsInfo.real_img)) : ''
this.$nextTick(() => { this.$nextTick(() => {
this._initSwiper(); this._initSwiper();
}); });
...@@ -115,7 +115,7 @@ export default { ...@@ -115,7 +115,7 @@ export default {
deep:true, deep:true,
handler(newVal){ handler(newVal){
if (newVal.goodsInfo.id){ if (newVal.goodsInfo.id){
this.real_img = JSON.parse(JSON.stringify(newVal.goodsInfo.real_img)) this.real_img = newVal.goodsInfo.real_img ? JSON.parse(JSON.stringify(newVal.goodsInfo.real_img)) : ''
this.$nextTick(() => { this.$nextTick(() => {
this._initSwiper(); this._initSwiper();
}); });
......
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
await this.get_userInfo({ refererId: this.$route.query.refererId }); await this.get_userInfo({ refererId: this.$route.query.refererId });
this.$Bus.$emit('bus-initWX'); this.$Bus.$emit('bus-initWX');
this.set_nowDate(); this.set_nowDate();
if (!process.env.private) { if (!process.env.private || process.env.privateName === 'huawei') {
this.timer = websocketHeartbeat.call(this) this.timer = websocketHeartbeat.call(this)
this.set_uuid(this.timer.uuid) this.set_uuid(this.timer.uuid)
// bus注册ws暂停和开始事件 // bus注册ws暂停和开始事件
......
...@@ -7,6 +7,7 @@ module.exports = { ...@@ -7,6 +7,7 @@ module.exports = {
HTTP_PORT: '', HTTP_PORT: '',
X_CA_STAGE: '', X_CA_STAGE: '',
private: true, private: true,
privateName: 'cbn',
sentryOptions: {}, sentryOptions: {},
uploaderName: 'tencent', uploaderName: 'tencent',
uploaderOptions: { uploaderOptions: {
......
...@@ -7,6 +7,7 @@ module.exports = { ...@@ -7,6 +7,7 @@ module.exports = {
HTTP_PORT: ':8680', HTTP_PORT: ':8680',
X_CA_STAGE: '', X_CA_STAGE: '',
private: true, private: true,
privateName: 'cm',
sentryOptions: {}, sentryOptions: {},
uploaderName: 'cmecloud', uploaderName: 'cmecloud',
uploaderOptions: { uploaderOptions: {
......
...@@ -9,6 +9,7 @@ module.exports = { ...@@ -9,6 +9,7 @@ module.exports = {
private: true, private: true,
sentryOptions: {}, sentryOptions: {},
SERVE_PORT: 33000, SERVE_PORT: 33000,
privateName: 'huawei',
uploaderName: 'huaweicloud', uploaderName: 'huaweicloud',
uploaderOptions: { uploaderOptions: {
accessKeyId: 'GOQ82NEHQYDQCHMW5GZT', accessKeyId: 'GOQ82NEHQYDQCHMW5GZT',
......
...@@ -7,6 +7,7 @@ module.exports = { ...@@ -7,6 +7,7 @@ module.exports = {
private: true, private: true,
sentryOptions: {}, sentryOptions: {},
uploaderName: 'aws', uploaderName: 'aws',
privateName: 'vvku',
uploaderOptions: { uploaderOptions: {
accessKeyId: 'AKIA27QSGT2TTSQLUVUN', accessKeyId: 'AKIA27QSGT2TTSQLUVUN',
accessKeySecret: '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', accessKeySecret: 'eTRl4PmPGViZD/cvTRSSBDU2NZQvO3SF5fQjVtaN',
......
...@@ -10,6 +10,9 @@ if (!process.env.X_CA_STAGE) { ...@@ -10,6 +10,9 @@ if (!process.env.X_CA_STAGE) {
} else if (process.env.X_CA_STAGE === 'TEST') { } else if (process.env.X_CA_STAGE === 'TEST') {
watchTime = `wss://bapidev.guangdianyun.tv/v1/stats/channel/watchTime` watchTime = `wss://bapidev.guangdianyun.tv/v1/stats/channel/watchTime`
} }
if (process.env.privateName === 'huawei') {
watchTime = `wss://bapi.guangdianyun.tv/v1/stats/channel/watchTime`
}
export {watchTime} export {watchTime}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment