app.js 393B

123456789101112131415161718192021222324
  1. import Taro from '@tarojs/taro';
  2. import store, { Provider } from '@/store';
  3. import './app.less'
  4. const App = (props) => {
  5. Taro.useLaunch(() => {
  6. Taro.login({
  7. success: (res) => {
  8. store.getState('user').login(res.code);
  9. }
  10. });
  11. store.getState('user').current();
  12. });
  13. return (
  14. <Provider>
  15. {props.children}
  16. </Provider>
  17. );
  18. }
  19. export default App