| New file |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { Component } from 'react'; |
| | | import { View, Text } from '@tarojs/components'; |
| | | import './index.less'; |
| | | import { createPage } from '../../../utils/page'; |
| | | import { checkOtp } from '../../../utils/tools'; |
| | | |
| | | // @ts-ignore |
| | | @createPage() |
| | | export default class Toolbox extends Component { |
| | | $app: any = Taro.getApp().$app; |
| | | |
| | | componentDidShow() { |
| | | this.$app.xpReportShow(); |
| | | |
| | | const autoLogin = false; // 设置为 true 以启用自动登录 |
| | | checkOtp(autoLogin).then(otp => { |
| | | if (otp) { |
| | | // 已登录 |
| | | console.log('用户已登录,otp:', otp); |
| | | } else { |
| | | // 没有登录 |
| | | console.log('用户未登录'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | componentDidHide() { |
| | | this.$app.xpReportHide(); |
| | | } |
| | | |
| | | render() { |
| | | |
| | | return ( |
| | | <View className='demo'> |
| | | <Text>Demo 页面</Text> |
| | | </View> |
| | | ) |
| | | } |
| | | } |