App.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <script>
  2. export default {
  3. onLaunch: function() {
  4. console.log('App Launch')
  5. // console.log(localStorage.getItem('token')=='null')
  6. if(localStorage.getItem('token')=='null' && localStorage.getItem('errorMsg')=='null') {
  7. window.location.href ='https://open.wecard.qq.com/connect/oauth/authorize?app_key=4FD5599032819781&response_type=code&scope=snsapi_userinfo&ocode=1015730314&redirect_uri=http%3A%2F%2Fchuanghai-dev.natapp1.cc%2Fihotel%2FhotelUser%2FweixiaoAuth&state=http%3A%2F%2Fchuanghai-dev.natapp1.cc%2Fihotel%2FhotelUser%2FweixiaoAuth';
  8. } else if (localStorage.getItem('token')=='null' && localStorage.getItem('errorMsg')=='获取用户信息失败') {
  9. uni.navigateTo({
  10. url:'pages/huoquanshibai/huoquanshibai'
  11. })
  12. }
  13. },
  14. onShow: function() {
  15. console.log('App Show')
  16. },
  17. onHide: function() {
  18. console.log('App Hide')
  19. }
  20. }
  21. </script>
  22. <style lang="scss">
  23. /*每个页面公共css */
  24. @import '@/uni_modules/uni-scss/index.scss';
  25. /* #ifndef APP-NVUE */
  26. @import '@/static/customicons.css';
  27. // 设置整个项目的背景色
  28. page {
  29. background-color: #f5f5f5;
  30. }
  31. /* #endif */
  32. .example-info {
  33. font-size: 14px;
  34. color: #333;
  35. padding: 10px;
  36. }
  37. </style>