Jelajahi Sumber

✨ feat(client): 添加移动端路由支持

- 增加移动端路由判断条件,当路径以/mobile开头时加载移动端页面
- 优化路由判断逻辑的格式,添加适当的空格和缩进
yourname 5 bulan lalu
induk
melakukan
b765c36c37
1 mengubah file dengan 6 tambahan dan 4 penghapusan
  1. 6 4
      src/client/index.tsx

+ 6 - 4
src/client/index.tsx

@@ -1,6 +1,8 @@
 // 如果当前是在 /big 下
 if (window.location.pathname.startsWith('/admin')) {
-    import('./admin/index')
-  }else{
-    import('./home/index')
-  }
+  import('./admin/index')
+} else if (window.location.pathname.startsWith('/mobile')) {
+  import('./mobile/index')
+} else {
+  import('./home/index')
+}