10 Star 0 Fork 0

雪村/hui_uniapp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
App.vue 3.02 KB
一键复制 编辑 原始数据 按行查看 历史
<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>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sunhappy0318/hui_uniapp.git
git@gitee.com:sunhappy0318/hui_uniapp.git
sunhappy0318
hui_uniapp
hui_uniapp
master

搜索帮助