代码拉取完成,页面将自动刷新
<script>
import {
getUrl
} from '@/api/userApi.js'
import {
mapActions
} from 'vuex';
export default {
onLaunch: function() {
this.clearWX();
// uni.setStorageSync('token','dfdbd1b0-bc2b-4916-8ed5-1acad1a02fe1');
// console.log('App Launch');
// this.token = uni.getStorageSync('token');
// if (!this.token) {
// uni.showLoading({
// title: '登录中'
// });
// this.getUrl()
// }
//this.token = "4e280a25-5c33-4492-9255-d390ccb9dfa9";
//uni.getStorageSync('token');
// let ptoken = this.getUrlKey('token');
//
// console.log(this.$route.path);
// console.log('------------');
// let atoken = uni.getStorageSync('token');
// this.token = '';
// if(ptoken != ''){
// this.token = ptoken;
// uni.setStorageSync('token',ptoken);
// }
// if (!this.token && atoken != '') {
// uni.showLoading({
// title: '登录中'
// });
// this.getUrl()
// }
// this.token = '';
// let ptoken = this.getUrlKey('token');
// console.log(this.$route.path);
// console.log('------------');
// let atoken = uni.getStorageSync('token');
// if(ptoken != ''){
// this.token = ptoken;
// uni.setStorageSync('token',ptoken);
// }
// if (!this.token && atoken != '') {
// uni.showLoading({
// title: '登录中'
// });
// this.getUrl()
// }
// setTimeout(() => {
// uni.setTabBarBadge({
// index: 1,
// text: '31'
// });
// uni.showTabBarRedDot({
// index: 3
// });
// }, 1000);
},
onShow: function() {
},
onHide: function() {
},
onLoad(options) {
// this.getUserInfoAll({path:this.$route.path})
},
methods: {
// ...mapActions(['getUserInfoAll']),
// getUrl() {
// let params = {};
// getUrl(params).then(res => {
// let url = res.data.url
// console.log("url:", url)
// window.location.href = url
// })
// }, // 获取url参数
// getUrlKey(name) {
// return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null
// },
clearWX(){
window.wx = null
const script1 = document.createElement('script')
script1.referrerpolicy="origin"
script1.src= 'https://res.wx.qq.com/open/js/jweixin-1.2.0.js'
document.head.appendChild(script1);
script1.onload = function() {
const script2 = document.createElement('script')
script2.referrerpolicy="origin"
script2.src= 'https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js'
document.head.appendChild(script2)
script2.onload = function() {
// TODO something
}
}
}
}
};
</script>
<style>
/*每个页面公共css */
.u-m-t-15 {
margin-top: 15rpx;
}
</style>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。