mi
This commit is contained in:
21
miniprogram/src/app.ts
Normal file
21
miniprogram/src/app.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { PropsWithChildren } from 'react'
|
||||
import { useLaunch } from '@tarojs/taro'
|
||||
import { login } from './utils/request'
|
||||
import './app.scss'
|
||||
|
||||
function App({ children }: PropsWithChildren<any>) {
|
||||
|
||||
useLaunch(() => {
|
||||
console.log('App launched.')
|
||||
// Auto login
|
||||
login().then(res => {
|
||||
console.log('Logged in as:', res?.nickname)
|
||||
}).catch(err => {
|
||||
console.log('Auto login failed', err)
|
||||
})
|
||||
})
|
||||
|
||||
return children
|
||||
}
|
||||
|
||||
export default App
|
||||
Reference in New Issue
Block a user