App.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <script>
  2. export default {
  3. onLaunch: function() {
  4. console.log('App Launch')
  5. if(sessionStorage.getItem('token')=='null' ||sessionStorage.getItem('token')==null){
  6. window.location.href ='https://open.wecard.qq.com/connect/oauth/authorize?app_key=4AA7B3944BDF3739&response_type=code&scope=snsapi_userinfo&ocode=1015730314&redirect_uri=https://chtech.ncjti.edu.cn/kpi/api/sysUser/code&state=https://chtech.ncjti.edu.cn/kpi/api/sysUser/code';
  7. }
  8. else if((sessionStorage.getItem('token')=='null' && sessionStorage.getItem('errorMsg')=='null')||(sessionStorage.getItem('token')=='null' && sessionStorage.getItem('errorMsg')==null)) {
  9. window.location.href ='https://open.wecard.qq.com/connect/oauth/authorize?app_key=4AA7B3944BDF3739&response_type=code&scope=snsapi_userinfo&ocode=1015730314&redirect_uri=https://chtech.ncjti.edu.cn/kpi/api/sysUser/code&state=https://chtech.ncjti.edu.cn/kpi/api/sysUser/code';
  10. } else if (sessionStorage.getItem('token')=='null' && sessionStorage.getItem('errorMsg')=='获取用户信息失败') {
  11. // uni.navigateTo({
  12. // url:'pages/huoquanshibai/huoquanshibai'
  13. // })
  14. }
  15. // if((!localStorage.getItem('openId2')&&localStorage.getItem('code')) || (localStorage.getItem('openId2')=='null'&&localStorage.getItem('code'))){
  16. // this.getOpenId()
  17. // }else if(localStorage.getItem('code')=='null'|| localStorage.getItem('code')=='undefined' || localStorage.getItem('code')==null){
  18. // window.location.href ='https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxd87cbe1db0437303&redirect_uri=https%3A%2F%2Fchtech.ncjti.edu.cn%2Fhotel%2Fh5%2F&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect';
  19. // }
  20. },
  21. onShow: function() {
  22. console.log('App Show')
  23. },
  24. onHide: function() {
  25. console.log('App Hide')
  26. }
  27. }
  28. </script>
  29. <style>
  30. /* 全局引入iconfont */
  31. @import 'static/css/iconfont.css';
  32. /*每个页面公共css */
  33. page{
  34. background-color: #F2F3F5;
  35. }
  36. uni-page-body,html,body{
  37. height: 100%;
  38. }
  39. </style>