1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <template>
- <web-view
- v-if="authtoken"
- :src="dibootUrl">
- </web-view>
- </template>
- <script>
- import webview from './webview'
- export default {
- mixins: [webview],
- data() {
- return {
- dibootUrl: '',
- query: {},
- };
- },
- onLoad(query) {
- this.query = query
- this.initData(query)
- },
- watch: {
- authtoken: {
- immediate: false,
- deep: true,
- handler(newVal) {
- this.initData(this.query)
- }
- }
- },
- methods: {
- initData(routeQuery) {
- let protocol = 'https:'
- if (document.location.protocol) {
- protocol = document.location.protocol
- }
- let urlParams = ''
- for (let key in routeQuery) {
- if (key != 'routes') {
- urlParams += `&${key}=${routeQuery[key]}`
- }
- }
- urlParams += `&token=${this.authtoken}`
- if (process.env.NODE_ENV === 'development') {
- this.dibootUrl = `${protocol}//tq.5000v.com:8035${routeQuery.routes}?${urlParams}`
- } else {
- this.dibootUrl = `${protocol}//${window.location.host}${routeQuery.routes}?${urlParams}`
- }
- },
- getLocation() {
- },
- scanCode() {
- }
- }
- }
- </script>
- <style lang="scss"></style>
|