├── php-api/ # 改造后的PHP接口层 ├── java-ad-service/ # 若依框架微服务(广告+VIP+分账) ├── uniapp-reader/ # UniApp前端项目 │ ├── pages/ # 各端页面 │ └──
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

App.vue 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <view :class="['app-container', `theme-${themeStore.currentTheme}`]">
  3. <router-view />
  4. </view>
  5. </template>
  6. <script>
  7. import config from './config'
  8. import { getToken } from '@/utils/auth'
  9. import { useThemeStore } from '@/stores/theme'
  10. import { onLaunch } from '@dcloudio/uni-app'
  11. // 初始化主题
  12. onLaunch(() => {
  13. const themeStore = useThemeStore()
  14. themeStore.initTheme()
  15. })
  16. export default {
  17. onLaunch: function() {
  18. this.initApp()
  19. },
  20. methods: {
  21. // 初始化应用
  22. initApp() {
  23. // 初始化应用配置
  24. this.initConfig()
  25. // 检查用户登录状态
  26. //#ifdef H5
  27. this.checkLogin()
  28. //#endif
  29. },
  30. initConfig() {
  31. this.globalData.config = config
  32. },
  33. checkLogin() {
  34. if (!getToken()) {
  35. this.$tab.reLaunch('/pages/login')
  36. }
  37. }
  38. }
  39. }
  40. </script>
  41. <style lang="scss">
  42. @import '@/static/scss/index.scss'
  43. @import '@/styles/themes/default.scss';
  44. @import '@/styles/themes/aydz-blue.scss';
  45. .app-container {
  46. font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  47. height: 100vh;
  48. background-color: var(--bg-color);
  49. color: var(--text-color);
  50. }
  51. </style>