App.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 =
  8. 'https://open.wecard.qq.com/connect/oauth/authorize?app_key=4FD5599032819781&response_type=code&scope=snsapi_userinfo&ocode=1015730314&redirect_uri=https://chtech.ncjti.edu.cn/hotel/ihotel-api/ihotel/hotelUser/weixiaoAuth&state=https://chtech.ncjti.edu.cn/hotel/ihotel-api/ihotel/hotelUser/weixiaoAuth';
  9. } else if (localStorage.getItem('token') == 'null' && localStorage.getItem('errorMsg') == '获取用户信息失败') {
  10. uni.navigateTo({
  11. url: 'pages/huoquanshibai/huoquanshibai'
  12. })
  13. }
  14. },
  15. onShow: function() {
  16. console.log('App Show')
  17. },
  18. onHide: function() {
  19. console.log('App Hide')
  20. }
  21. }
  22. </script>
  23. <style lang="scss">
  24. /*每个页面公共css */
  25. @import '@/uni_modules/uni-scss/index.scss';
  26. /* #ifndef APP-NVUE */
  27. @import '@/static/customicons.css';
  28. // 设置整个项目的背景色
  29. page {
  30. background-color: #f5f5f5;
  31. }
  32. /* #endif */
  33. .example-info {
  34. font-size: 14px;
  35. color: #333;
  36. padding: 10px;
  37. }
  38. </style>