App.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <script>
  2. import Cookies from 'js-cookie'
  3. export default {
  4. onLaunch: function () {
  5. uni.$u.http.get('/api/blade-token/currentUser').then(res => {
  6. let {instType} = res.detail
  7. let isSingle = instType === 1
  8. this.$store.commit('setUser', {isSingle})
  9. const Yxtoken = Cookies.get('congress')
  10. const redirect = window.location.href;
  11. if (Yxtoken) {
  12. uni.redirectTo({url: isSingle ? '/pages/home/me' : '/pages/home/home'});
  13. } else {
  14. // 跳转到iam 用户端登陆
  15. window.location.href = `${window._CONFIG.VUE_APP_BASE_URLS}/account/#/login?redirect=${redirect}`;
  16. }
  17. })
  18. },
  19. onShow: function () {
  20. },
  21. onHide: function () {
  22. }
  23. }
  24. </script>
  25. <style lang="scss">
  26. /*每个页面公共css */
  27. @import "@/uni_modules/uview-ui/index.scss";
  28. @import "common/demo.scss";
  29. @import "common/tool.css";
  30. page {
  31. background-color: #f6f6f6;
  32. }
  33. .iframe {
  34. width: 100%;
  35. height: calc(100% - 176rpx);
  36. }
  37. .u-picker {
  38. .u-picker__view__column__item {
  39. font-weight: 500 !important;
  40. }
  41. }
  42. </style>