Commit 7cb846ea by MichaelJier

feature<traffic_driving>

1. 判断ua中是否包含webview关键词区分内嵌页环境
parent 7be060cf
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</div> </div>
</template> </template>
<script> <script>
import { getWatchLoginInfo, getDrainage } from '@/plugins/API/apiAll'; import { getWatchLoginInfo } from '@/plugins/API/apiAll';
import { mapGetters, mapMutations, mapActions } from 'vuex'; import { mapGetters, mapMutations, mapActions } from 'vuex';
import encrypt from '@/components/encrypt/index'; import encrypt from '@/components/encrypt/index';
import white from '@/components/white/index'; import white from '@/components/white/index';
...@@ -57,9 +57,15 @@ export default { ...@@ -57,9 +57,15 @@ export default {
isPeep() { isPeep() {
const peep = this.channelConfig.peep || {}; const peep = this.channelConfig.peep || {};
return !!peep.isEnable; return !!peep.isEnable;
},
isWebview() {
return navigator.userAgent.toLowerCase().includes('webview')
} }
}, },
async mounted() { async mounted() {
if (this.isWebview) {
this.set_drainage_state(0)
}
this.$Bus.$on('bus-showLogin', this._toggleLogin); this.$Bus.$on('bus-showLogin', this._toggleLogin);
this.get_userInfo({ refererId: this.$route.query.refererId }); this.get_userInfo({ refererId: this.$route.query.refererId });
this.set_nowDate(); this.set_nowDate();
...@@ -71,7 +77,8 @@ export default { ...@@ -71,7 +77,8 @@ export default {
PostInfo: 'PostInfo' PostInfo: 'PostInfo'
}), }),
...mapMutations({ ...mapMutations({
set_userInfo: 'set_userInfo' set_userInfo: 'set_userInfo',
set_drainage_state: 'set_drainage_state'
}), }),
async get_userInfo(obj) { async get_userInfo(obj) {
const res = await getWatchLoginInfo({ const res = await getWatchLoginInfo({
......
...@@ -8,6 +8,9 @@ const mutations = { ...@@ -8,6 +8,9 @@ const mutations = {
set_drainage(state, info) { set_drainage(state, info) {
state.drainage = info; state.drainage = info;
}, },
set_drainage_state(state, info) {
state.drainage['drainage_status'] = info;
},
set_welcomeInfo(state, info) { set_welcomeInfo(state, info) {
state.welcomeInfo = info; state.welcomeInfo = info;
}, },
......
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