19 lines
611 B
TypeScript
19 lines
611 B
TypeScript
App<IAppOption>({
|
|
globalData: {
|
|
/** 当前已连接设备的蓝牙状态,页面可读取 */
|
|
connectState: '' as string,
|
|
},
|
|
|
|
onLaunch() {
|
|
// 已登录则跳过登录页
|
|
const userInfo = wx.getStorageSync('userInfo')
|
|
if (userInfo) {
|
|
const connectDeviceInfo = wx.getStorageSync('connectDeviceInfo')
|
|
const hasDevice = connectDeviceInfo && Object.keys(connectDeviceInfo).length > 0
|
|
wx.reLaunch({
|
|
url: hasDevice ? '/pages/home/home' : '/pages/connectedDevice/connectedDevice'
|
|
})
|
|
}
|
|
},
|
|
})
|