Explorar el Código

添加获取设备信息

xiaocao hace 7 meses
padre
commit
aaec1f1d8a
Se han modificado 1 ficheros con 13 adiciones y 9 borrados
  1. 13 9
      src/App.vue

+ 13 - 9
src/App.vue

@@ -1,25 +1,29 @@
 <script setup>
-import { ref } from 'vue'
+import {ref} from 'vue'
 import {onHide, onLaunch, onShow} from '@dcloudio/uni-app'
-
-
+import {initHttp} from '@/utils/request.js'
 
 onLaunch(async () => {
+	// 初始化HTTP拦截器
+	initHttp()
 
 
-
+	// 获取设备信息
+	uni.getSystemInfo({
+		success: res => {
+			console.log('设备信息:', res)
+		}
+	})
 })
 
-onHide(()=>{
-
+onHide(() => {
 })
-onShow(()=>{
-
+onShow(() => {
 })
 
 </script>
 
-<style  lang="scss">
+<style lang="scss">
 @import "uview-plus/index.scss";