import Taro from '@tarojs/taro';
import store, { Provider } from '@/store';
import './app.less'

const App = (props) => {

  Taro.useLaunch(() => {
    Taro.login({
      success: (res) => {
        store.getState('user').login(res.code);
      }
    });

    store.getState('user').current();
  });

  return (
    <Provider>
      {props.children}
    </Provider>
  );
}

export default App
