Commit 7607ab7e by xinla

标除过时抓取素材功能等

1 parent 1a352923
<script> <script>
import { wxQrLogin } from '@/api/login' import { wxQrLogin } from '@/api/login'
import { getQueryValue } from '@/utils/index' import { getQueryValue } from '@/utils/index'
import { setToken } from '@/utils/auth' import { setToken } from '@/utils/auth'
export default { export default {
components: {}, components: {},
props: {}, props: {},
data() { data() {
return {} return {}
}, },
watch: {}, watch: {},
computed: {}, computed: {},
async beforeCreate() { async beforeCreate() {
// http://106.13.201.219/?auth_code=xxx#/authWehatCallback // http://106.13.201.219/?auth_code=xxx#/authWehatCallback
// console.log('routerbeforeCreate', this.$route); // console.log('routerbeforeCreate', this.$route);
let auth_code = getQueryValue('code') document.getElementById('loader-wrapper').classList.remove('loaded')
try { let auth_code = getQueryValue('code')
let { data } = await wxQrLogin(auth_code) try {
setToken(data.access_token) let { data } = await wxQrLogin(auth_code)
// 用以重置浏览器回调的url setToken(data.access_token)
history.replaceState({}, 'page', window.lwConfig.BASE_URL) // 用以重置浏览器回调的url
this.$router.replace('/') history.replaceState({}, 'page', window.lwConfig.BASE_URL)
// location.href = window.lwConfig.BASE_URL this.$router.replace('/')
} catch (error) { // location.href = window.lwConfig.BASE_URL
console.log(error) } catch (error) {
} console.log(error)
}, }
mounted() {}, },
methods: {} mounted() {},
} methods: {},
}
</script> </script>
<template> <template>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!