Browse Source

拆service

Leon 2 years ago
parent
commit
9fd7e2282a

File diff suppressed because it is too large
+ 0 - 175
dist/app-origin.wxss


+ 9 - 22
dist/app.js

@@ -1,5 +1,4 @@
 "use strict";
-require("./prebundle/vendors-node_modules_taro_weapp_prebundle_taro-ui_js.js");
 require("./prebundle/vendors-node_modules_taro_weapp_prebundle_chunk-2Y2U3MWF_js.js");
 require("./prebundle/vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js.js");
 require("./prebundle/vendors-node_modules_taro_weapp_prebundle_reduxjs_toolkit_js.js");
@@ -8,7 +7,7 @@ require("./prebundle/vendors-node_modules_taro_weapp_prebundle_react-redux_js.js
 require("./prebundle/vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js.js");
 require("./prebundle/vendors-node_modules_taro_weapp_prebundle_react-i18next_js.js");
 require("./prebundle/vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-framework-react_dist_runtime_js.js");
-require("./prebundle/vendors-node_modules_taro_weapp_prebundle_chunk-6GAVBEBQ_js.js");
+require("./prebundle/vendors-node_modules_taro_weapp_prebundle_tarojs_taro_js.js");
 require("./prebundle/vendors-node_modules_taro_weapp_prebundle_i18next-browser-languagedetector_js.js");
 require("./prebundle/node_modules_taro_weapp_prebundle_tarojs_runtime_js.js");
 require("./prebundle/vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-platform-weapp_dist_runtime_js.js");
@@ -17,7 +16,6 @@ require("./prebundle/remoteEntry.js");
 require("./prebundle/node_modules_taro_weapp_prebundle_react_jsx-runtime_js.js");
 require("./prebundle/node_modules_taro_weapp_prebundle_react_js.js");
 require("./prebundle/node_modules_taro_weapp_prebundle_react-dom_js.js");
-require("./prebundle/node_modules_taro_weapp_prebundle_tarojs_taro_js.js");
 
 require("./common");
 require("./vendors");
@@ -36,18 +34,18 @@ require("./runtime");
 /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-redux */ "webpack/container/remote/react-redux");
 /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./store/store */ "./src/store/store.tsx");
-/* harmony import */ var taro_ui_dist_style_index_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! taro-ui/dist/style/index.scss */ "./node_modules/taro-ui/dist/style/index.scss");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
 
 
 
 
 
+// import 'taro-ui/dist/style/index.scss'
 
 var App = function App(_ref) {
   var children = _ref.children;
-  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_redux__WEBPACK_IMPORTED_MODULE_1__.Provider, {
+  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_redux__WEBPACK_IMPORTED_MODULE_1__.Provider, {
     store: _store_store__WEBPACK_IMPORTED_MODULE_2__["default"],
     children: children
   });
@@ -316,8 +314,8 @@ function initLocale(strLocale) {
 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
 
 /* unused harmony exports increment, decrement, incrementByAmount, apple */
-/* harmony import */ var _Users_Work_taro_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js */ "./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js");
-/* harmony import */ var _Users_Work_taro_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
+/* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js */ "./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js");
+/* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
 /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @reduxjs/toolkit */ "webpack/container/remote/@reduxjs/toolkit");
 /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__);
 
@@ -347,9 +345,9 @@ var _counterSlice$actions = counterSlice.actions,
   incrementByAmount = _counterSlice$actions.incrementByAmount;
 
 var apple = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__.createAsyncThunk)('user/wxLogin', /*#__PURE__*/function () {
-  var _ref2 = (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/(0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__["default"])().mark(function _callee(payload, _ref) {
+  var _ref2 = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/(0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__["default"])().mark(function _callee(payload, _ref) {
     var dispatch;
-    return (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__["default"])().wrap(function _callee$(_context) {
+    return (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__["default"])().wrap(function _callee$(_context) {
       while (1) switch (_context.prev = _context.next) {
         case 0:
           dispatch = _ref.dispatch;
@@ -397,17 +395,6 @@ var store = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__.configureStore)({
 });
 /* harmony default export */ __webpack_exports__["default"] = (store);
 
-/***/ }),
-
-/***/ "./node_modules/taro-ui/dist/style/index.scss":
-/*!****************************************************!*\
-  !*** ./node_modules/taro-ui/dist/style/index.scss ***!
-  \****************************************************/
-/***/ (function() {
-
-// extracted by mini-css-extract-plugin
-
-
 /***/ })
 
 },

File diff suppressed because it is too large
+ 0 - 0
dist/app.js.map


+ 262 - 194
dist/common.js

@@ -10,7 +10,7 @@
 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
 /* harmony export */   "default": function() { return /* binding */ Buttons; }
 /* harmony export */ });
-/* harmony import */ var _Users_Work_taro_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ "./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
+/* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ "./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
 /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
 /* harmony import */ var _utils_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/types */ "./src/utils/types.ts");
 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
@@ -25,10 +25,10 @@ function Buttons(props) {
     opacity: 0.4
   } : {};
   return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_2__.View, {
-    style: (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3__["default"])({}, myStyle),
+    style: (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3__["default"])({}, myStyle),
     children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
       className: props.type == _utils_types__WEBPACK_IMPORTED_MODULE_0__.ButtonType.outline ? 'outline_btn' : 'btn',
-      style: (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3__["default"])({}, props.style),
+      style: (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3__["default"])({}, props.style),
       onClick: props.onClick,
       children: props.title
     })
@@ -163,7 +163,7 @@ function Rings(props) {
 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
 /* harmony export */   "default": function() { return /* binding */ Component; }
 /* harmony export */ });
-/* harmony import */ var _Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
+/* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
 /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
@@ -179,7 +179,7 @@ function Rings(props) {
 
 function Component(props) {
   var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(-1),
-    _useState2 = (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_useState, 2),
+    _useState2 = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_useState, 2),
     selIndex = _useState2[0],
     setSelIndex = _useState2[1];
   function isString(variable) {
@@ -318,8 +318,8 @@ var API_FAST_CALENDARS = "".concat(baseUrl, "/api/fast/calendars/");
 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
 /* harmony export */   request: function() { return /* binding */ request; }
 /* harmony export */ });
-/* harmony import */ var _Users_Work_taro_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js */ "./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js");
-/* harmony import */ var _Users_Work_taro_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
+/* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js */ "./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js");
+/* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
 /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
 /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__);
 
@@ -330,9 +330,9 @@ function getStorage(_x) {
   return _getStorage.apply(this, arguments);
 }
 function _getStorage() {
-  _getStorage = (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/(0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__["default"])().mark(function _callee(key) {
+  _getStorage = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/(0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__["default"])().mark(function _callee(key) {
     var res;
-    return (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__["default"])().wrap(function _callee$(_context) {
+    return (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__["default"])().wrap(function _callee$(_context) {
       while (1) switch (_context.prev = _context.next) {
         case 0:
           _context.prev = 0;
@@ -421,9 +421,9 @@ function request(_x2) {
 //     }
 // };
 function _request() {
-  _request = (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/(0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__["default"])().mark(function _callee2(param) {
+  _request = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/(0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__["default"])().mark(function _callee2(param) {
     var url, method, data, header, token, split, timeZoneFormatted;
-    return (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__["default"])().wrap(function _callee2$(_context2) {
+    return (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__["default"])().wrap(function _callee2$(_context2) {
       while (1) switch (_context2.prev = _context2.next) {
         case 0:
           url = param.url, method = param.method, data = param.data;
@@ -453,20 +453,31 @@ function _request() {
               success: function success(response) {
                 var statusCode = response.statusCode,
                   data = response.data;
-                if (statusCode == 204) {
-                  resolve({});
-                }
-                if (statusCode != 200) {
+                if (statusCode >= 200 && statusCode < 300) {
+                  var resp = {};
+                  if (response.data) {
+                    resp = response.data;
+                  }
+                  resolve(resp);
+                } else if (statusCode == 401) {} else {
                   reject(data);
                 }
-                var _ref = response.data || {},
-                  error_code = _ref.error_code;
-                if (error_code === 'NOT_LOGIN') {
-                  // new UserManager().logout();
-                }
-                var resp = response.data;
-                resolve(resp);
+                // if (statusCode == 204){
+                //     resolve({} as T);
+                // }
+                // if (statusCode != 200) {
+                //     reject(data);
+                // }
+                // const { error_code } = response.data || {};
+                // if (error_code === 'NOT_LOGIN') {
+                //     // new UserManager().logout();
+                // }
+
+                //200-299 正常resolve
+                //401 未登录
+                //400-499 业务错误 reject
               },
+
               fail: function fail(err) {
                 if (err.errMsg == 'request:fail timeout') {
                   // wx.showToast({
@@ -490,10 +501,10 @@ function _request() {
 
 /***/ }),
 
-/***/ "./src/store/user.tsx":
-/*!****************************!*\
-  !*** ./src/store/user.tsx ***!
-  \****************************/
+/***/ "./src/services/user.tsx":
+/*!*******************************!*\
+  !*** ./src/services/user.tsx ***!
+  \*******************************/
 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
 
 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -502,62 +513,142 @@ function _request() {
 /* harmony export */   register: function() { return /* binding */ register; },
 /* harmony export */   wxLogin: function() { return /* binding */ wxLogin; }
 /* harmony export */ });
-/* unused harmony exports loginSuccess, registerSuccess, logoutSuccess, getInfoSuccess, updateSuccess, clearSuccess, login, getInfo, update */
-/* harmony import */ var _Users_Work_taro_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js */ "./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js");
-/* harmony import */ var _Users_Work_taro_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
-/* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @reduxjs/toolkit */ "webpack/container/remote/@reduxjs/toolkit");
-/* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _services_http_request__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @services/http/request */ "./src/services/http/request.ts");
-/* harmony import */ var _services_http_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @services/http/api */ "./src/services/http/api.js");
-/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
-/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_3__);
-
+/* unused harmony exports login, getInfo, update */
+/* harmony import */ var _http_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http/api */ "./src/services/http/api.js");
+/* harmony import */ var _http_request__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./http/request */ "./src/services/http/request.ts");
+/* harmony import */ var _store_user__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/store/user */ "./src/store/user.tsx");
 
 
 
+var login = function login(username, password) {
+  return function (dispatch) {
+    (0,_http_request__WEBPACK_IMPORTED_MODULE_1__.request)({
+      url: _http_api__WEBPACK_IMPORTED_MODULE_0__.API_LOGIN,
+      method: 'POST',
+      data: {
+        username: username,
+        password: password
+      }
+    }).then(function (res) {
+      dispatch((0,_store_user__WEBPACK_IMPORTED_MODULE_2__.loginSuccess)(res));
+    });
+  };
+};
+var wxLogin = function wxLogin(code, encryptedData, iv) {
+  return function (dispatch) {
+    (0,_http_request__WEBPACK_IMPORTED_MODULE_1__.request)({
+      url: _http_api__WEBPACK_IMPORTED_MODULE_0__.API_LOGIN,
+      method: 'POST',
+      data: {
+        code: code,
+        type: 'WX_MP',
+        app_version: '1',
+        client_version: '1',
+        client_type: 'WX_MP',
+        extra: {
+          encryptedData: encryptedData,
+          iv: iv
+        }
+      }
+    }).then(function (res) {
+      dispatch((0,_store_user__WEBPACK_IMPORTED_MODULE_2__.loginSuccess)(res));
+    });
+  };
+};
 
+/*
+export const wxLogin = (code: string) => (dispatch: any) => {
+    
+    request({
+        url: API_LOGIN, method: 'POST', data: { code,type:'WX_MP',app_version:'1',client_version:'1',client_type:'WXP_MP' }
+    }).then(res => {
+        console.log(res);
+        dispatch(loginSuccess(res));
+    })
+}*/
 
-function getStorage(key) {
-  return _tarojs_taro__WEBPACK_IMPORTED_MODULE_3___default().getStorage({
-    key: key
-  }).then(function (res) {
-    return res.data;
-  }).catch(function () {
-    return '';
-  });
-}
-var getUserDataFromLocalStorage = /*#__PURE__*/function () {
-  var _ref = (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["default"])( /*#__PURE__*/(0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_5__["default"])().mark(function _callee() {
-    var userData;
-    return (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_5__["default"])().wrap(function _callee$(_context) {
-      while (1) switch (_context.prev = _context.next) {
-        case 0:
-          _context.next = 2;
-          return getStorage('userData');
-        case 2:
-          userData = _context.sent;
-          if (!userData) {
-            _context.next = 5;
-            break;
-          }
-          return _context.abrupt("return", JSON.parse(userData));
-        case 5:
-          return _context.abrupt("return", {
-            isLogin: false,
-            nickname: null,
-            avatar: null,
-            token: null
-          });
-        case 6:
-        case "end":
-          return _context.stop();
+var register = function register(name, email, password) {
+  return function (dispatch) {
+    (0,_http_request__WEBPACK_IMPORTED_MODULE_1__.request)({
+      url: _http_api__WEBPACK_IMPORTED_MODULE_0__.API_REGISTER,
+      method: 'POST',
+      data: {
+        client_type: 'IOS',
+        username: name,
+        email: email,
+        password: password
       }
-    }, _callee);
-  }));
-  return function getUserDataFromLocalStorage() {
-    return _ref.apply(this, arguments);
+    }).then(function (res) {
+      dispatch((0,_store_user__WEBPACK_IMPORTED_MODULE_2__.registerSuccess)(res));
+    });
+  };
+};
+var logout = function logout() {
+  return function (dispatch) {
+    (0,_http_request__WEBPACK_IMPORTED_MODULE_1__.request)({
+      url: _http_api__WEBPACK_IMPORTED_MODULE_0__.API_LOGOUT,
+      method: 'GET',
+      data: {}
+    }).then(function (_) {
+      dispatch((0,_store_user__WEBPACK_IMPORTED_MODULE_2__.logoutSuccess)());
+    });
+  };
+};
+var clear = function clear() {
+  return function (dispatch) {
+    (0,_http_request__WEBPACK_IMPORTED_MODULE_1__.request)({
+      url: _http_api__WEBPACK_IMPORTED_MODULE_0__.API_CLEAR_USER,
+      method: 'POST',
+      data: {}
+    }).then(function (_) {
+      dispatch((0,_store_user__WEBPACK_IMPORTED_MODULE_2__.clearSuccess)());
+    });
+  };
+};
+var getInfo = function getInfo() {
+  return function (dispatch) {
+    (0,_http_request__WEBPACK_IMPORTED_MODULE_1__.request)({
+      url: _http_api__WEBPACK_IMPORTED_MODULE_0__.API_USER_INFO,
+      method: 'GET',
+      data: {}
+    }).then(function (res) {
+      dispatch((0,_store_user__WEBPACK_IMPORTED_MODULE_2__.getInfoSuccess)(res));
+    });
   };
-}();
+};
+var update = function update() {
+  return function (dispatch) {
+    (0,_http_request__WEBPACK_IMPORTED_MODULE_1__.request)({
+      url: _http_api__WEBPACK_IMPORTED_MODULE_0__.API_USER_INFO,
+      method: 'POST',
+      data: {}
+    }).then(function (res) {
+      dispatch((0,_store_user__WEBPACK_IMPORTED_MODULE_2__.updateSuccess)(res));
+    });
+  };
+};
+
+/***/ }),
+
+/***/ "./src/store/user.tsx":
+/*!****************************!*\
+  !*** ./src/store/user.tsx ***!
+  \****************************/
+/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
+
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */   clearSuccess: function() { return /* binding */ clearSuccess; },
+/* harmony export */   getInfoSuccess: function() { return /* binding */ getInfoSuccess; },
+/* harmony export */   loginSuccess: function() { return /* binding */ loginSuccess; },
+/* harmony export */   logoutSuccess: function() { return /* binding */ logoutSuccess; },
+/* harmony export */   registerSuccess: function() { return /* binding */ registerSuccess; },
+/* harmony export */   updateSuccess: function() { return /* binding */ updateSuccess; }
+/* harmony export */ });
+/* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @reduxjs/toolkit */ "webpack/container/remote/@reduxjs/toolkit");
+/* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
+/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_1__);
+
 
 // const initialState: UserState = await getUserDataFromLocalStorage();
 var initialState = {
@@ -580,6 +671,10 @@ var userSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__.createSlice)({
       state.token = token;
       state.isLogin = true;
       __webpack_require__.g.token = token;
+      _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().setStorage({
+        key: 'userData',
+        data: JSON.stringify(action.payload)
+      });
     },
     registerSuccess: function registerSuccess(state, action) {
       var _action$payload2 = action.payload,
@@ -591,6 +686,10 @@ var userSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__.createSlice)({
       state.token = token;
       state.isLogin = true;
       __webpack_require__.g.token = token;
+      _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().setStorage({
+        key: 'userData',
+        data: JSON.stringify(action.payload)
+      });
     },
     logoutSuccess: function logoutSuccess(state) {
       state.nickname = null;
@@ -598,6 +697,7 @@ var userSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__.createSlice)({
       state.token = null;
       state.isLogin = false;
       __webpack_require__.g.token = '';
+      _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().clearStorage();
     },
     clearSuccess: function clearSuccess(state) {
       state.nickname = null;
@@ -605,6 +705,7 @@ var userSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__.createSlice)({
       state.token = null;
       state.isLogin = false;
       __webpack_require__.g.token = '';
+      _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().clearStorage();
     },
     getInfoSuccess: function getInfoSuccess(state, action) {
       var _action$payload3 = action.payload,
@@ -615,6 +716,11 @@ var userSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__.createSlice)({
       state.avatar = avatar;
       state.token = token;
       state.isLogin = true;
+      __webpack_require__.g.token = token;
+      _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().setStorage({
+        key: 'userData',
+        data: JSON.stringify(action.payload)
+      });
     },
     updateSuccess: function updateSuccess(state, action) {
       var _action$payload4 = action.payload,
@@ -625,6 +731,10 @@ var userSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__.createSlice)({
       state.avatar = avatar;
       state.token = token;
       state.isLogin = true;
+      _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().setStorage({
+        key: 'userData',
+        data: JSON.stringify(action.payload)
+      });
     }
   }
 });
@@ -637,127 +747,85 @@ var _userSlice$actions = userSlice.actions,
   clearSuccess = _userSlice$actions.clearSuccess;
 
 /* harmony default export */ __webpack_exports__["default"] = (userSlice.reducer);
-var login = function login(username, password) {
-  return function (dispatch) {
-    (0,_services_http_request__WEBPACK_IMPORTED_MODULE_1__.request)({
-      url: _services_http_api__WEBPACK_IMPORTED_MODULE_2__.API_LOGIN,
-      method: 'POST',
-      data: {
-        username: username,
-        password: password
-      }
-    }).then(function (res) {
-      dispatch(loginSuccess(res));
-    });
-  };
-};
-var wxLogin = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__.createAsyncThunk)('user/wxLogin', /*#__PURE__*/function () {
-  var _ref3 = (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["default"])( /*#__PURE__*/(0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_5__["default"])().mark(function _callee2(payload, _ref2) {
-    var dispatch;
-    return (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_5__["default"])().wrap(function _callee2$(_context2) {
-      while (1) switch (_context2.prev = _context2.next) {
-        case 0:
-          dispatch = _ref2.dispatch;
-          console.log(payload.code);
-          (0,_services_http_request__WEBPACK_IMPORTED_MODULE_1__.request)({
-            url: _services_http_api__WEBPACK_IMPORTED_MODULE_2__.API_LOGIN,
-            method: 'POST',
-            data: {
-              code: payload.code,
-              type: 'WX_MP',
-              app_version: '1',
-              client_version: '1',
-              client_type: 'WX_MP',
-              extra: {
-                encryptedData: payload.encryptedData,
-                iv: payload.iv
-              }
-            }
-          }).then(function (res) {
-            dispatch(loginSuccess(res));
-          });
-        case 3:
-        case "end":
-          return _context2.stop();
-      }
-    }, _callee2);
-  }));
-  return function (_x, _x2) {
-    return _ref3.apply(this, arguments);
-  };
-}());
 
-/*
-export const wxLogin = (code: string) => (dispatch: any) => {
-    
-    request({
-        url: API_LOGIN, method: 'POST', data: { code,type:'WX_MP',app_version:'1',client_version:'1',client_type:'WXP_MP' }
-    }).then(res => {
-        console.log(res);
-        dispatch(loginSuccess(res));
-    })
-}*/
+// export const login = (username: string, password: string) => (dispatch: any) => {
+//     request({
+//         url: API_LOGIN, method: 'POST', data: { username, password }
+//     }).then(res => {
+//         dispatch(loginSuccess(res));
+//     })
+// }
+
+// export const wxLogin = createAsyncThunk('user/wxLogin', async (payload: { code: string, encryptedData: string,iv:string }, { dispatch }) => {
+//     console.log(payload.code)
+//     request({
+//         url: API_LOGIN, method: 'POST',
+//         data: {
+//             code: payload.code,
+//             type: 'WX_MP',
+//             app_version: '1',
+//             client_version: '1',
+//             client_type: 'WX_MP',
+//             extra: {
+//                 encryptedData: payload.encryptedData,
+//                 iv: payload.iv
+//             }
+//         }
+//     }).then(res => {
+//         dispatch(loginSuccess(res));
+//     })
+// });
 
-var register = function register(name, email, password) {
-  return function (dispatch) {
-    (0,_services_http_request__WEBPACK_IMPORTED_MODULE_1__.request)({
-      url: _services_http_api__WEBPACK_IMPORTED_MODULE_2__.API_REGISTER,
-      method: 'POST',
-      data: {
-        client_type: 'IOS',
-        username: name,
-        email: email,
-        password: password
-      }
-    }).then(function (res) {
-      dispatch(registerSuccess(res));
-    });
-  };
-};
-var logout = function logout() {
-  return function (dispatch) {
-    (0,_services_http_request__WEBPACK_IMPORTED_MODULE_1__.request)({
-      url: _services_http_api__WEBPACK_IMPORTED_MODULE_2__.API_LOGOUT,
-      method: 'GET',
-      data: {}
-    }).then(function (res) {
-      dispatch(logoutSuccess());
-    });
-  };
-};
-var clear = function clear() {
-  return function (dispatch) {
-    (0,_services_http_request__WEBPACK_IMPORTED_MODULE_1__.request)({
-      url: _services_http_api__WEBPACK_IMPORTED_MODULE_2__.API_CLEAR_USER,
-      method: 'POST',
-      data: {}
-    }).then(function (res) {
-      dispatch(clearSuccess());
-    });
-  };
-};
-var getInfo = function getInfo() {
-  return function (dispatch) {
-    (0,_services_http_request__WEBPACK_IMPORTED_MODULE_1__.request)({
-      url: _services_http_api__WEBPACK_IMPORTED_MODULE_2__.API_USER_INFO,
-      method: 'GET',
-      data: {}
-    }).then(function (res) {
-      dispatch(getInfoSuccess(res));
-    });
-  };
-};
-var update = function update() {
-  return function (dispatch) {
-    (0,_services_http_request__WEBPACK_IMPORTED_MODULE_1__.request)({
-      url: _services_http_api__WEBPACK_IMPORTED_MODULE_2__.API_USER_INFO,
-      method: 'POST',
-      data: {}
-    }).then(function (res) {
-      dispatch(updateSuccess(res));
-    });
-  };
-};
+// /*
+// export const wxLogin = (code: string) => (dispatch: any) => {
+
+//     request({
+//         url: API_LOGIN, method: 'POST', data: { code,type:'WX_MP',app_version:'1',client_version:'1',client_type:'WXP_MP' }
+//     }).then(res => {
+//         console.log(res);
+//         dispatch(loginSuccess(res));
+//     })
+// }*/
+
+// export const register = (name: string,email:string, password: string) => (dispatch: any) => {
+//     request({
+//         url: API_REGISTER, method: 'POST', data: { client_type:'IOS',username:name,email:email, password:password }
+//     }).then(res => {
+//         dispatch(registerSuccess(res));
+//     })
+// }
+
+// export const logout = () => (dispatch: any) => {
+//     request({
+//         url: API_LOGOUT, method: 'GET', data: {}
+//     }).then(res => {
+//         dispatch(logoutSuccess());
+//     })
+// }
+
+// export const clear = () => (dispatch: any) => {
+//     request({
+//         url: API_CLEAR_USER, method: 'POST', data: {}
+//     }).then(res => {
+//         dispatch(clearSuccess());
+//     })
+// }
+
+// export const getInfo = () => (dispatch: any) => {
+//     request({
+//         url: API_USER_INFO, method: 'GET', data: {}
+//     }).then(res => {
+//         dispatch(getInfoSuccess(res));
+//     })
+// }
+
+// export const update = () => (dispatch: any) => {
+//     request({
+//         url: API_USER_INFO, method: 'POST', data: {}
+//     }).then(res => {
+//         dispatch(updateSuccess(res));
+//     })
+// }
 
 /***/ }),
 

File diff suppressed because it is too large
+ 0 - 0
dist/common.js.map


+ 248 - 124
dist/pages/Auth.js

@@ -67,7 +67,7 @@ function Component(props) {
 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
 /* harmony export */   "default": function() { return /* binding */ Component; }
 /* harmony export */ });
-/* harmony import */ var _Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
+/* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
 /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
@@ -85,11 +85,11 @@ function Component(_ref) {
     disabled = _ref.disabled,
     isSecure = _ref.isSecure;
   var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(value ? value : ''),
-    _useState2 = (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_useState, 2),
+    _useState2 = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_useState, 2),
     inputValue = _useState2[0],
     setInputValue = _useState2[1];
   var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
-    _useState4 = (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_useState3, 2),
+    _useState4 = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_useState3, 2),
     isFocus = _useState4[0],
     setIsFocus = _useState4[1];
   var handleInputChange = function handleInputChange(e) {
@@ -126,111 +126,118 @@ function Component(_ref) {
 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
 /* harmony export */   "default": function() { return /* binding */ Auth; }
 /* harmony export */ });
-/* harmony import */ var _Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
-/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
-/* harmony import */ var _components_Texts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @components/Texts */ "./src/components/Texts.tsx");
-/* harmony import */ var _utils_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @utils/types */ "./src/utils/types.ts");
-/* harmony import */ var _components_Box__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @components/Box */ "./src/components/Box.tsx");
-/* harmony import */ var _components_Inputs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @components/Inputs */ "./src/components/Inputs.tsx");
-/* harmony import */ var _components_Buttons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @components/Buttons */ "./src/components/Buttons.tsx");
-/* harmony import */ var _assets_svg_check_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @assets/svg/check.svg */ "./src/assets/svg/check.svg");
-/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-i18next */ "webpack/container/remote/react-i18next");
-/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_6__);
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_7__);
-/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react-redux */ "webpack/container/remote/react-redux");
-/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_8__);
-/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
-/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_9__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__);
+/* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _Login__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Login */ "./src/features/auth/components/Login.tsx");
+/* harmony import */ var _CreateAccount__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CreateAccount */ "./src/features/auth/components/CreateAccount.tsx");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
 
 
 
 
 
 
+function Auth() {
+  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),
+    _useState2 = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(_useState, 2),
+    isSignup = _useState2[0],
+    setIsSignup = _useState2[1];
+  if (isSignup) return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_CreateAccount__WEBPACK_IMPORTED_MODULE_2__["default"], {
+    login: function login() {
+      return setIsSignup(false);
+    }
+  });
+  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_Login__WEBPACK_IMPORTED_MODULE_1__["default"], {
+    register: function register() {
+      return setIsSignup(true);
+    }
+  });
+}
 
+/***/ }),
 
+/***/ "./src/features/auth/components/CreateAccount.tsx":
+/*!********************************************************!*\
+  !*** ./src/features/auth/components/CreateAccount.tsx ***!
+  \********************************************************/
+/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
 
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */   "default": function() { return /* binding */ Component; }
+/* harmony export */ });
+/* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
+/* harmony import */ var _components_Box__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/Box */ "./src/components/Box.tsx");
+/* harmony import */ var _components_Buttons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/Buttons */ "./src/components/Buttons.tsx");
+/* harmony import */ var _components_Inputs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/Inputs */ "./src/components/Inputs.tsx");
+/* harmony import */ var _components_Texts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/Texts */ "./src/components/Texts.tsx");
+/* harmony import */ var _utils_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/utils/types */ "./src/utils/types.ts");
+/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
+/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
+/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_5__);
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_6__);
+/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-i18next */ "webpack/container/remote/react-i18next");
+/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_7__);
+/* harmony import */ var _assets_svg_check_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @assets/svg/check.svg */ "./src/assets/svg/check.svg");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__);
 
 
 
 
 
 
-function Auth() {
-  var _useTranslation = (0,react_i18next__WEBPACK_IMPORTED_MODULE_6__.useTranslation)(),
+
+
+
+
+
+
+
+
+function Component(props) {
+  var _useTranslation = (0,react_i18next__WEBPACK_IMPORTED_MODULE_7__.useTranslation)(),
     t = _useTranslation.t;
-  var dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_8__.useDispatch)();
-  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(true),
-    _useState2 = (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_11__["default"])(_useState, 2),
-    isSignup = _useState2[0],
-    setIsSignup = _useState2[1];
-  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(''),
-    _useState4 = (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_11__["default"])(_useState3, 2),
-    name = _useState4[0],
-    setName = _useState4[1];
-  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(''),
-    _useState6 = (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_11__["default"])(_useState5, 2),
-    email = _useState6[0],
-    setEmail = _useState6[1];
-  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(''),
-    _useState8 = (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_11__["default"])(_useState7, 2),
-    password = _useState8[0],
-    setPassword = _useState8[1];
+  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(''),
+    _useState2 = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_10__["default"])(_useState, 2),
+    name = _useState2[0],
+    setName = _useState2[1];
+  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(''),
+    _useState4 = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_10__["default"])(_useState3, 2),
+    email = _useState4[0],
+    setEmail = _useState4[1];
   var handleNameChange = function handleNameChange(value) {
     setName(value);
   };
   var handleEmailChange = function handleEmailChange(value) {
     setEmail(value);
   };
-  var handlePasswordChange = function handlePasswordChange(value) {
-    setPassword(value);
-  };
   var isButtonDisabled = name === '' || email === '';
-  var isLoginButtonDisabled = email === '' || password === '';
   function signupComponent() {
-    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.View, {
-      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_Inputs__WEBPACK_IMPORTED_MODULE_3__["default"], {
+    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.View, {
+      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_Inputs__WEBPACK_IMPORTED_MODULE_2__["default"], {
         value: name,
         onChange: handleNameChange,
         placeholder: t('feature.auth.create_account.input_username_placeholder')
-      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.View, {
+      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.View, {
         style: {
           height: 20
         }
-      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_Inputs__WEBPACK_IMPORTED_MODULE_3__["default"], {
+      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_Inputs__WEBPACK_IMPORTED_MODULE_2__["default"], {
         value: email,
         onChange: handleEmailChange,
         placeholder: t('feature.auth.create_account.input_email_placeholder')
       })]
     });
   }
-  function loginComponent() {
-    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.View, {
-      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_Inputs__WEBPACK_IMPORTED_MODULE_3__["default"], {
-        value: email,
-        onChange: handleEmailChange,
-        placeholder: t('feature.auth.login.input_account_placeholder')
-      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.View, {
-        style: {
-          height: 20
-        }
-      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_Inputs__WEBPACK_IMPORTED_MODULE_3__["default"], {
-        value: password,
-        isSecure: true,
-        onChange: handlePasswordChange,
-        placeholder: t('feature.auth.login.input_password_placeholder')
-      })]
-    });
-  }
   function registerF() {
     if (isButtonDisabled) {
       return;
     }
     setTimeout(function () {
-      _tarojs_taro__WEBPACK_IMPORTED_MODULE_9___default().navigateTo({
+      _tarojs_taro__WEBPACK_IMPORTED_MODULE_5___default().navigateTo({
         url: "/pages/Auth?type=createPassword&name=".concat(name, "&email=").concat(email)
       });
     }, 1000);
@@ -243,11 +250,7 @@ function Auth() {
     // },1000)
   }
 
-  function changeLogin() {
-    setIsSignup(false);
-    console.log(isSignup);
-  }
-  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.View, {
+  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.View, {
     style: {
       backgroundColor: '#000',
       flex: 1,
@@ -256,25 +259,15 @@ function Auth() {
       width: '100vw',
       height: '100vh'
     },
-    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_Texts__WEBPACK_IMPORTED_MODULE_0__["default"], {
+    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_Texts__WEBPACK_IMPORTED_MODULE_3__["default"], {
       text: t('feature.auth.create_account.title'),
-      type: _utils_types__WEBPACK_IMPORTED_MODULE_1__.TextType.primary
-    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_Texts__WEBPACK_IMPORTED_MODULE_0__["default"], {
+      type: _utils_types__WEBPACK_IMPORTED_MODULE_4__.TextType.primary
+    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_Texts__WEBPACK_IMPORTED_MODULE_3__["default"], {
       text: t('feature.auth.create_account.sub_title'),
-      type: _utils_types__WEBPACK_IMPORTED_MODULE_1__.TextType.secondary
-    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_Box__WEBPACK_IMPORTED_MODULE_2__["default"], {
-      child: isSignup ? signupComponent() : loginComponent()
-    }), isSignup ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_Buttons__WEBPACK_IMPORTED_MODULE_4__["default"], {
-      onClick: registerF,
-      title: t('feature.auth.create_account.btn_next'),
-      style: {
-        marginLeft: 23,
-        marginRight: 23,
-        marginTop: 20,
-        marginBottom: 20
-      },
-      status: isButtonDisabled ? _utils_types__WEBPACK_IMPORTED_MODULE_1__.ComponentStatus.disable : _utils_types__WEBPACK_IMPORTED_MODULE_1__.ComponentStatus.enable
-    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_Buttons__WEBPACK_IMPORTED_MODULE_4__["default"], {
+      type: _utils_types__WEBPACK_IMPORTED_MODULE_4__.TextType.secondary
+    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_Box__WEBPACK_IMPORTED_MODULE_0__["default"], {
+      child: signupComponent()
+    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_Buttons__WEBPACK_IMPORTED_MODULE_1__["default"], {
       onClick: registerF,
       title: t('feature.auth.create_account.btn_next'),
       style: {
@@ -283,29 +276,29 @@ function Auth() {
         marginTop: 20,
         marginBottom: 20
       },
-      status: isLoginButtonDisabled ? _utils_types__WEBPACK_IMPORTED_MODULE_1__.ComponentStatus.disable : _utils_types__WEBPACK_IMPORTED_MODULE_1__.ComponentStatus.enable
-    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.View, {
+      status: isButtonDisabled ? _utils_types__WEBPACK_IMPORTED_MODULE_4__.ComponentStatus.disable : _utils_types__WEBPACK_IMPORTED_MODULE_4__.ComponentStatus.enable
+    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.View, {
       className: "agree_view",
-      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.Image, {
+      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.Image, {
         style: "width:12px;height:12px;",
-        src: _assets_svg_check_svg__WEBPACK_IMPORTED_MODULE_5__
-      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.Text, {
+        src: _assets_svg_check_svg__WEBPACK_IMPORTED_MODULE_8__
+      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.Text, {
         className: "agree_text",
         children: t('page.auth.agreement')
       })]
-    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.View, {
+    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.View, {
       style: {
         flex: 1
       }
-    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.View, {
+    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.View, {
       className: "footer",
-      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.Text, {
+      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.Text, {
         className: "have_account",
         children: t('feature.auth.create_account.footer_desc')
-      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.Text, {
+      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.Text, {
         className: "login",
         onClick: function onClick() {
-          return setIsSignup(!isSignup);
+          return props.login();
         },
         children: t('feature.auth.create_account.footer_login')
       })]
@@ -324,23 +317,23 @@ function Auth() {
 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
 /* harmony export */   "default": function() { return /* binding */ Component; }
 /* harmony export */ });
-/* harmony import */ var _Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
+/* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
 /* harmony import */ var _components_Box__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/Box */ "./src/components/Box.tsx");
 /* harmony import */ var _components_Buttons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/Buttons */ "./src/components/Buttons.tsx");
 /* harmony import */ var _components_Inputs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/Inputs */ "./src/components/Inputs.tsx");
 /* harmony import */ var _components_Texts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/Texts */ "./src/components/Texts.tsx");
-/* harmony import */ var _store_user__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/store/user */ "./src/store/user.tsx");
-/* harmony import */ var _utils_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/types */ "./src/utils/types.ts");
+/* harmony import */ var _utils_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/utils/types */ "./src/utils/types.ts");
 /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_6__);
-/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-i18next */ "webpack/container/remote/react-i18next");
-/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_7__);
-/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react-redux */ "webpack/container/remote/react-redux");
-/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_8__);
-/* harmony import */ var _assets_svg_check_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @assets/svg/check.svg */ "./src/assets/svg/check.svg");
-/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
-/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_10__);
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);
+/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-i18next */ "webpack/container/remote/react-i18next");
+/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_6__);
+/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-redux */ "webpack/container/remote/react-redux");
+/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_7__);
+/* harmony import */ var _assets_svg_check_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @assets/svg/check.svg */ "./src/assets/svg/check.svg");
+/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
+/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_9__);
+/* harmony import */ var _services_user__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/services/user */ "./src/services/user.tsx");
 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__);
 
@@ -360,15 +353,15 @@ function Auth() {
 
 
 function Component(prop) {
-  var _useTranslation = (0,react_i18next__WEBPACK_IMPORTED_MODULE_7__.useTranslation)(),
+  var _useTranslation = (0,react_i18next__WEBPACK_IMPORTED_MODULE_6__.useTranslation)(),
     t = _useTranslation.t;
-  var dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_8__.useDispatch)();
-  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(''),
-    _useState2 = (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_12__["default"])(_useState, 2),
+  var dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_7__.useDispatch)();
+  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(''),
+    _useState2 = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_12__["default"])(_useState, 2),
     password = _useState2[0],
     setPassword = _useState2[1];
-  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(''),
-    _useState4 = (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_12__["default"])(_useState3, 2),
+  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(''),
+    _useState4 = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_12__["default"])(_useState3, 2),
     repeat = _useState4[0],
     setRepeat = _useState4[1];
   var handlePasswordChange = function handlePasswordChange(value) {
@@ -401,12 +394,12 @@ function Component(prop) {
     if (isButtonDisabled) {
       return;
     }
-    dispatch((0,_store_user__WEBPACK_IMPORTED_MODULE_4__.register)(prop.name, prop.email, password));
+    dispatch((0,_services_user__WEBPACK_IMPORTED_MODULE_10__.register)(prop.name, prop.email, password));
     setTimeout(function () {
-      _tarojs_taro__WEBPACK_IMPORTED_MODULE_10___default().navigateBack({
+      _tarojs_taro__WEBPACK_IMPORTED_MODULE_9___default().navigateBack({
         delta: 2
       });
-      _tarojs_taro__WEBPACK_IMPORTED_MODULE_10___default().redirectTo({
+      _tarojs_taro__WEBPACK_IMPORTED_MODULE_9___default().redirectTo({
         url: '/pages/ChooseScenario'
       });
     }, 1000);
@@ -422,10 +415,10 @@ function Component(prop) {
     },
     children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_components_Texts__WEBPACK_IMPORTED_MODULE_3__["default"], {
       text: t('feature.auth.create_password.title'),
-      type: _utils_types__WEBPACK_IMPORTED_MODULE_5__.TextType.primary
+      type: _utils_types__WEBPACK_IMPORTED_MODULE_4__.TextType.primary
     }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_components_Texts__WEBPACK_IMPORTED_MODULE_3__["default"], {
       text: t('feature.auth.create_password.sub_title'),
-      type: _utils_types__WEBPACK_IMPORTED_MODULE_5__.TextType.secondary
+      type: _utils_types__WEBPACK_IMPORTED_MODULE_4__.TextType.secondary
     }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_components_Box__WEBPACK_IMPORTED_MODULE_0__["default"], {
       child: loginComponent()
     }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_components_Buttons__WEBPACK_IMPORTED_MODULE_1__["default"], {
@@ -437,12 +430,12 @@ function Component(prop) {
         marginTop: 20,
         marginBottom: 20
       },
-      status: isButtonDisabled ? _utils_types__WEBPACK_IMPORTED_MODULE_5__.ComponentStatus.disable : _utils_types__WEBPACK_IMPORTED_MODULE_5__.ComponentStatus.enable
+      status: isButtonDisabled ? _utils_types__WEBPACK_IMPORTED_MODULE_4__.ComponentStatus.disable : _utils_types__WEBPACK_IMPORTED_MODULE_4__.ComponentStatus.enable
     }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_13__.View, {
       className: "agree_view",
       children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_13__.Image, {
         style: "width:12px;height:12px;",
-        src: _assets_svg_check_svg__WEBPACK_IMPORTED_MODULE_9__
+        src: _assets_svg_check_svg__WEBPACK_IMPORTED_MODULE_8__
       }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_13__.Text, {
         className: "agree_text",
         children: t('page.auth.agreement')
@@ -466,6 +459,137 @@ function Component(prop) {
 
 /***/ }),
 
+/***/ "./src/features/auth/components/Login.tsx":
+/*!************************************************!*\
+  !*** ./src/features/auth/components/Login.tsx ***!
+  \************************************************/
+/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
+
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */   "default": function() { return /* binding */ Login; }
+/* harmony export */ });
+/* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
+/* harmony import */ var _components_Inputs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/Inputs */ "./src/components/Inputs.tsx");
+/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "webpack/container/remote/react-i18next");
+/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _assets_svg_check_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @assets/svg/check.svg */ "./src/assets/svg/check.svg");
+/* harmony import */ var _components_Texts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/Texts */ "./src/components/Texts.tsx");
+/* harmony import */ var _components_Box__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/Box */ "./src/components/Box.tsx");
+/* harmony import */ var _utils_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/utils/types */ "./src/utils/types.ts");
+/* harmony import */ var _components_Buttons__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/Buttons */ "./src/components/Buttons.tsx");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__);
+
+
+
+
+
+
+
+
+
+
+
+
+
+function Login(props) {
+  var _useTranslation = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)(),
+    t = _useTranslation.t;
+  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''),
+    _useState2 = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_9__["default"])(_useState, 2),
+    name = _useState2[0],
+    setName = _useState2[1];
+  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''),
+    _useState4 = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_9__["default"])(_useState3, 2),
+    password = _useState4[0],
+    setPassword = _useState4[1];
+  var handleNameChange = function handleNameChange(value) {
+    setName(value);
+  };
+  var handlePasswordChange = function handlePasswordChange(value) {
+    setPassword(value);
+  };
+  var isLoginButtonDisabled = name === '' || password === '';
+  function loginComponent() {
+    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_10__.View, {
+      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_components_Inputs__WEBPACK_IMPORTED_MODULE_0__["default"], {
+        value: name,
+        onChange: handleNameChange,
+        placeholder: t('feature.auth.login.input_account_placeholder')
+      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_10__.View, {
+        style: {
+          height: 20
+        }
+      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_components_Inputs__WEBPACK_IMPORTED_MODULE_0__["default"], {
+        value: password,
+        isSecure: true,
+        onChange: handlePasswordChange,
+        placeholder: t('feature.auth.login.input_password_placeholder')
+      })]
+    });
+  }
+  function registerF() {}
+  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_10__.View, {
+    style: {
+      backgroundColor: '#000',
+      flex: 1,
+      flexDirection: 'column',
+      display: 'flex',
+      width: '100vw',
+      height: '100vh'
+    },
+    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_components_Texts__WEBPACK_IMPORTED_MODULE_4__["default"], {
+      text: t('feature.auth.create_account.title'),
+      type: _utils_types__WEBPACK_IMPORTED_MODULE_6__.TextType.primary
+    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_components_Texts__WEBPACK_IMPORTED_MODULE_4__["default"], {
+      text: t('feature.auth.create_account.sub_title'),
+      type: _utils_types__WEBPACK_IMPORTED_MODULE_6__.TextType.secondary
+    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_components_Box__WEBPACK_IMPORTED_MODULE_5__["default"], {
+      child: loginComponent()
+    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_components_Buttons__WEBPACK_IMPORTED_MODULE_7__["default"], {
+      onClick: registerF,
+      title: t('feature.auth.create_account.btn_next'),
+      style: {
+        marginLeft: 23,
+        marginRight: 23,
+        marginTop: 20,
+        marginBottom: 20
+      },
+      status: isLoginButtonDisabled ? _utils_types__WEBPACK_IMPORTED_MODULE_6__.ComponentStatus.disable : _utils_types__WEBPACK_IMPORTED_MODULE_6__.ComponentStatus.enable
+    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_10__.View, {
+      className: "agree_view",
+      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_10__.Image, {
+        style: "width:12px;height:12px;",
+        src: _assets_svg_check_svg__WEBPACK_IMPORTED_MODULE_3__
+      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_10__.Text, {
+        className: "agree_text",
+        children: t('page.auth.agreement')
+      })]
+    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_10__.View, {
+      style: {
+        flex: 1
+      }
+    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_10__.View, {
+      className: "footer",
+      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_10__.Text, {
+        className: "have_account",
+        children: t('feature.auth.create_account.footer_desc')
+      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_10__.Text, {
+        className: "login",
+        onClick: function onClick() {
+          return props.register();
+        },
+        children: t('feature.auth.create_account.footer_login')
+      })]
+    })]
+  });
+}
+
+/***/ }),
+
 /***/ "./src/pages/Auth.tsx":
 /*!****************************!*\
   !*** ./src/pages/Auth.tsx ***!

File diff suppressed because it is too large
+ 0 - 0
dist/pages/Auth.js.map


+ 38 - 38
dist/pages/Auth.wxss

@@ -1,41 +1,3 @@
-/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************!*\
-  !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[2]!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[4]!./src/components/Box.scss ***!
-  \**********************************************************************************************************************************************************************************************************************************************************************************************************************/
-.box-container {
-  background-color: #1C1C1C;
-  border-radius: 56rpx;
-  padding: 80rpx 40rpx 80rpx 40rpx;
-  margin-left: 46rpx;
-  margin-right: 46rpx;
-  display: -webkit-flex;
-  display: -ms-flexbox;
-  display: flex;
-  -webkit-flex-direction: column;
-      -ms-flex-direction: column;
-          flex-direction: column;
-  position: relative;
-}
-/*!*************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
-  !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[2]!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[4]!./src/components/Inputs.scss ***!
-  \*************************************************************************************************************************************************************************************************************************************************************************************************************************/
-.input {
-  height: 112rpx;
-  background-color: #000;
-  border-radius: 36rpx;
-  padding-left: 40rpx;
-  padding-right: 40rpx;
-  color: #fff;
-  caret-color: #AAFF00;
-  border: solid 4rpx #000;
-}
-
-.input:focus {
-  border: solid 4rpx #AAFF00;
-}
-
-.input_focus {
-  border: solid 4rpx #AAFF00;
-}
 /*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
   !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[2]!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[4]!./src/features/auth/components/Auth.scss ***!
   \*************************************************************************************************************************************************************************************************************************************************************************************************************************************/
@@ -88,3 +50,41 @@
   font-size: 28rpx;
   color: #AAFF00;
 }
+/*!*************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
+  !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[2]!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[4]!./src/components/Inputs.scss ***!
+  \*************************************************************************************************************************************************************************************************************************************************************************************************************************/
+.input {
+  height: 112rpx;
+  background-color: #000;
+  border-radius: 36rpx;
+  padding-left: 40rpx;
+  padding-right: 40rpx;
+  color: #fff;
+  caret-color: #AAFF00;
+  border: solid 4rpx #000;
+}
+
+.input:focus {
+  border: solid 4rpx #AAFF00;
+}
+
+.input_focus {
+  border: solid 4rpx #AAFF00;
+}
+/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************!*\
+  !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[2]!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[4]!./src/components/Box.scss ***!
+  \**********************************************************************************************************************************************************************************************************************************************************************************************************************/
+.box-container {
+  background-color: #1C1C1C;
+  border-radius: 56rpx;
+  padding: 80rpx 40rpx 80rpx 40rpx;
+  margin-left: 46rpx;
+  margin-right: 46rpx;
+  display: -webkit-flex;
+  display: -ms-flexbox;
+  display: flex;
+  -webkit-flex-direction: column;
+      -ms-flex-direction: column;
+          flex-direction: column;
+  position: relative;
+}

+ 12 - 17
dist/pages/ChooseAuth.js

@@ -10,8 +10,8 @@
 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
 /* harmony export */   "default": function() { return /* binding */ Page; }
 /* harmony export */ });
-/* harmony import */ var _Users_Work_taro_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js */ "./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js");
-/* harmony import */ var _Users_Work_taro_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
+/* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js */ "./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js");
+/* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
 /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
 /* harmony import */ var _components_Buttons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @components/Buttons */ "./src/components/Buttons.tsx");
 /* harmony import */ var _components_Texts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @components/Texts */ "./src/components/Texts.tsx");
@@ -20,7 +20,7 @@
 /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_3__);
 /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-redux */ "webpack/container/remote/react-redux");
 /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var _store_user__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/store/user */ "./src/store/user.tsx");
+/* harmony import */ var _services_user__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/services/user */ "./src/services/user.tsx");
 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
 
@@ -52,9 +52,9 @@ function Page() {
     return _login.apply(this, arguments);
   }
   function _login() {
-    _login = (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_7__["default"])( /*#__PURE__*/(0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_8__["default"])().mark(function _callee() {
-      var _yield$Taro$getUserPr, userInfo, encryptedData, iv;
-      return (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_8__["default"])().wrap(function _callee$(_context) {
+    _login = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_7__["default"])( /*#__PURE__*/(0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_8__["default"])().mark(function _callee() {
+      var _yield$Taro$getUserPr, encryptedData, iv;
+      return (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_8__["default"])().wrap(function _callee$(_context) {
         while (1) switch (_context.prev = _context.next) {
           case 0:
             _context.prev = 0;
@@ -64,14 +64,9 @@ function Page() {
             });
           case 3:
             _yield$Taro$getUserPr = _context.sent;
-            userInfo = _yield$Taro$getUserPr.userInfo;
             encryptedData = _yield$Taro$getUserPr.encryptedData;
             iv = _yield$Taro$getUserPr.iv;
-            dispatch((0,_store_user__WEBPACK_IMPORTED_MODULE_5__.wxLogin)({
-              code: code,
-              encryptedData: encryptedData,
-              iv: iv
-            }));
+            dispatch((0,_services_user__WEBPACK_IMPORTED_MODULE_5__.wxLogin)(code, encryptedData, iv));
             setTimeout(function () {
               _tarojs_taro__WEBPACK_IMPORTED_MODULE_3___default().redirectTo({
                 url: '/pages/ChooseScenario'
@@ -79,17 +74,17 @@ function Page() {
             }, 1000);
 
             // 在这里处理用户信息
-            _context.next = 14;
+            _context.next = 13;
             break;
-          case 11:
-            _context.prev = 11;
+          case 10:
+            _context.prev = 10;
             _context.t0 = _context["catch"](0);
             console.log('获取用户信息失败:', _context.t0);
-          case 14:
+          case 13:
           case "end":
             return _context.stop();
         }
-      }, _callee, null, [[0, 11]]);
+      }, _callee, null, [[0, 10]]);
     }));
     return _login.apply(this, arguments);
   }

File diff suppressed because it is too large
+ 0 - 0
dist/pages/ChooseAuth.js.map


+ 5 - 5
dist/pages/ChooseScenario.js

@@ -59,8 +59,8 @@ function Component(props) {
 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
 /* harmony export */   "default": function() { return /* binding */ Component; }
 /* harmony export */ });
-/* harmony import */ var _Users_Work_taro_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ "./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
-/* harmony import */ var _Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
+/* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ "./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
+/* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
 /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
 /* harmony import */ var _components_Buttons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @components/Buttons */ "./src/components/Buttons.tsx");
 /* harmony import */ var _components_Texts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @components/Texts */ "./src/components/Texts.tsx");
@@ -100,11 +100,11 @@ function Component() {
   var _useTranslation = (0,react_i18next__WEBPACK_IMPORTED_MODULE_6__.useTranslation)(),
     t = _useTranslation.t;
   var _useState = (0,react__WEBPACK_IMPORTED_MODULE_9__.useState)(0),
-    _useState2 = (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_12__["default"])(_useState, 2),
+    _useState2 = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_12__["default"])(_useState, 2),
     selIndex = _useState2[0],
     setSelIndex = _useState2[1];
   var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_9__.useState)([]),
-    _useState4 = (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_12__["default"])(_useState3, 2),
+    _useState4 = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_12__["default"])(_useState3, 2),
     scenarios = _useState4[0],
     setScenarios = _useState4[1];
   (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_10__.useReady)(function () {
@@ -146,7 +146,7 @@ function Component() {
       children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_components_Buttons__WEBPACK_IMPORTED_MODULE_0__["default"], {
         title: "Next",
         onClick: next,
-        style: (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_14__["default"])((0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_14__["default"])({}, style), {}, {
+        style: (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_14__["default"])((0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_14__["default"])({}, style), {}, {
           width: 320
         })
       })

+ 3 - 3
dist/pages/Second.js

@@ -11,8 +11,8 @@
 /* harmony export */   "default": function() { return /* binding */ Second; }
 /* harmony export */ });
 /* harmony import */ var _components_Buttons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/Buttons */ "./src/components/Buttons.tsx");
+/* harmony import */ var _services_user__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/services/user */ "./src/services/user.tsx");
 /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
-/* harmony import */ var _store_user__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/store/user */ "./src/store/user.tsx");
 /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-redux */ "webpack/container/remote/react-redux");
 /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_2__);
 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
@@ -26,10 +26,10 @@
 function Second() {
   var dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_2__.useDispatch)();
   function logoutF() {
-    dispatch((0,_store_user__WEBPACK_IMPORTED_MODULE_1__.logout)());
+    dispatch((0,_services_user__WEBPACK_IMPORTED_MODULE_1__.logout)());
   }
   function clearF() {
-    dispatch((0,_store_user__WEBPACK_IMPORTED_MODULE_1__.clear)());
+    dispatch((0,_services_user__WEBPACK_IMPORTED_MODULE_1__.clear)());
   }
   return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.View, {
     children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_components_Buttons__WEBPACK_IMPORTED_MODULE_0__["default"], {

+ 1 - 1
dist/pages/Second.js.map

@@ -1 +1 @@
-{"version":3,"file":"pages/Second.js","mappings":";;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AAAA;AAAA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;;;;;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["webpack://hola/._src_pages_Second.tsx","webpack://hola/./src/pages/Second.tsx?e2e5"],"sourcesContent":["import Buttons from \"@/components/Buttons\";\nimport { View,Text } from \"@tarojs/components\";\nimport { logout,clear } from \"@/store/user\";\nimport { useDispatch } from \"react-redux\";\n\nexport default function Second() {\n    const dispatch = useDispatch();\n    \n    function logoutF(){\n        dispatch(logout() as any);\n    }\n\n    function clearF(){\n        dispatch(clear() as any);\n    }\n    return <View>\n        <Buttons title='退出登录' onClick={logoutF} style={{ width: 289, marginBottom: 30 }} />\n        <Buttons title='注销账号' onClick={clearF} style={{ width: 289, marginBottom: 30 }} />\n    </View>\n}","import { createPageConfig } from '@tarojs/runtime'\nimport component from \"../../node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./Second.tsx\"\nvar config = {};\n\n\nvar inst = Page(createPageConfig(component, 'pages/Second', {root:{cn:[]}}, config || {}))\n\n\nexport default component\n"],"names":[],"sourceRoot":""}
+{"version":3,"file":"pages/Second.js","mappings":";;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AAAA;AAAA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;;;;;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["webpack://hola/._src_pages_Second.tsx","webpack://hola/./src/pages/Second.tsx?e2e5"],"sourcesContent":["import Buttons from \"@/components/Buttons\";\nimport { clear, logout } from \"@/services/user\";\nimport { View,Text } from \"@tarojs/components\";\nimport { useDispatch } from \"react-redux\";\n\nexport default function Second() {\n    const dispatch = useDispatch();\n    \n    function logoutF(){\n        dispatch(logout() as any);\n    }\n\n    function clearF(){\n        dispatch(clear() as any);\n    }\n    return <View>\n        <Buttons title='退出登录' onClick={logoutF} style={{ width: 289, marginBottom: 30 }} />\n        <Buttons title='注销账号' onClick={clearF} style={{ width: 289, marginBottom: 30 }} />\n    </View>\n}","import { createPageConfig } from '@tarojs/runtime'\nimport component from \"../../node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./Second.tsx\"\nvar config = {};\n\n\nvar inst = Page(createPageConfig(component, 'pages/Second', {root:{cn:[]}}, config || {}))\n\n\nexport default component\n"],"names":[],"sourceRoot":""}

+ 4 - 3
dist/pages/SetSchedule.js

@@ -47,7 +47,7 @@ function Page() {
 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
 /* harmony export */   "default": function() { return /* binding */ Component; }
 /* harmony export */ });
-/* harmony import */ var _Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
+/* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
 /* harmony import */ var _components_Buttons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/Buttons */ "./src/components/Buttons.tsx");
 /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
@@ -58,6 +58,7 @@ function Page() {
 
 
 
+// import { AtList, AtListItem } from 'taro-ui'
 
 
 
@@ -65,11 +66,11 @@ function Component(props) {
   console.log(props.scenario);
   var target = props.scenario.target;
   var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(target.fast_start),
-    _useState2 = (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_useState, 2),
+    _useState2 = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_useState, 2),
     startTime = _useState2[0],
     setStartTime = _useState2[1];
   var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(target.fast_end),
-    _useState4 = (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_useState3, 2),
+    _useState4 = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_useState3, 2),
     endTime = _useState4[0],
     setEndTime = _useState4[1];
   function start() {}

File diff suppressed because it is too large
+ 0 - 0
dist/pages/SetSchedule.js.map


+ 0 - 1
dist/pages/SetSchedule.wxss

@@ -1 +0,0 @@
-/* pages/SetSchedule.wxss */

+ 50 - 13
dist/pages/index/index.js

@@ -10,33 +10,70 @@
 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
 /* harmony export */   "default": function() { return /* binding */ IndexPage; }
 /* harmony export */ });
-/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
+/* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js */ "./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js");
+/* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
+/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
 /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
 /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__);
 /* harmony import */ var _components_Rings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @components/Rings */ "./src/components/Rings.weapp.tsx");
 /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-redux */ "webpack/container/remote/react-redux");
 /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _store_user__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/store/user */ "./src/store/user.tsx");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
+
+
 
 
 
 // import ComponentA from './component'
 
 
+
 // import TabBar from '../../components/Tabbar';
 
 
 function IndexPage() {
+  var dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_2__.useDispatch)();
   var array = [];
   var user = (0,react_redux__WEBPACK_IMPORTED_MODULE_2__.useSelector)(function (state) {
     return state.user;
   });
   array.push('ffff');
-  array.push( /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.Text, {
+  array.push( /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
     children: "ffff"
   }));
   // array.push(<Rings radius={50}/>)
+
+  (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__.useReady)( /*#__PURE__*/(0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_6__["default"])( /*#__PURE__*/(0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_7__["default"])().mark(function _callee() {
+    var userData;
+    return (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_7__["default"])().wrap(function _callee$(_context) {
+      while (1) switch (_context.prev = _context.next) {
+        case 0:
+          _context.next = 2;
+          return getStorage('userData');
+        case 2:
+          userData = _context.sent;
+          if (userData) {
+            dispatch((0,_store_user__WEBPACK_IMPORTED_MODULE_3__.getInfoSuccess)(JSON.parse(userData)));
+            // return JSON.parse(userData as string) as UserState;
+          }
+
+        case 4:
+        case "end":
+          return _context.stop();
+      }
+    }, _callee);
+  })));
+  function getStorage(key) {
+    return _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().getStorage({
+      key: key
+    }).then(function (res) {
+      return res.data;
+    }).catch(function () {
+      return '';
+    });
+  }
   function goDetail() {
     _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().navigateTo({
       // url: '/pages/index/detail'
@@ -55,33 +92,33 @@ function IndexPage() {
       });
     }
   }
-  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.View, {
+  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.View, {
     style: {
       backgroundColor: '#fff',
       flex: 1,
       flexDirection: 'column',
       display: 'flex'
     },
-    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.Text, {
+    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
       children: "homepage12234"
-    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.Text, {
+    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
       children: user.isLogin ? '已登录' : '未登录'
-    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.Text, {
+    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
       children: user.isLogin ? "\u7528\u6237\u6635\u79F0\uFF1A".concat(user.nickname) : ''
-    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.Button, {
+    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Button, {
       onClick: function onClick() {
         return goDetail();
       },
       children: "go detail"
-    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_components_Rings__WEBPACK_IMPORTED_MODULE_1__["default"], {
+    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_components_Rings__WEBPACK_IMPORTED_MODULE_1__["default"], {
       radius: 50
-    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.Input, {
+    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Input, {
       placeholder: "\u8BF7\u8F93\u5165\u7528\u6237\u540D1",
       style: {
         textAlign: 'left',
         backgroundColor: 'pink'
       }
-    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.Text, {
+    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
       className: "login",
       onClick: function onClick() {
         return login();
@@ -145,7 +182,7 @@ var inst = Page((0,_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__.createPageConfig
 },
 /******/ function(__webpack_require__) { // webpackRuntimeModules
 /******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
-/******/ __webpack_require__.O(0, ["taro","common"], function() { return __webpack_exec__("./src/pages/index/index.tsx"); });
+/******/ __webpack_require__.O(0, ["taro","vendors","common"], function() { return __webpack_exec__("./src/pages/index/index.tsx"); });
 /******/ var __webpack_exports__ = __webpack_require__.O();
 /******/ }
 ]);

File diff suppressed because it is too large
+ 0 - 0
dist/pages/index/index.js.map


+ 0 - 45
dist/prebundle/node_modules_taro_weapp_prebundle_tarojs_taro_js.js

@@ -1,45 +0,0 @@
-(wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["node_modules_taro_weapp_prebundle_tarojs_taro_js"],{
-
-/***/ "./node_modules/.taro/weapp/prebundle/@tarojs_taro.core.js":
-/*!*****************************************************************!*\
-  !*** ./node_modules/.taro/weapp/prebundle/@tarojs_taro.core.js ***!
-  \*****************************************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _chunk_6GAVBEBQ_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk-6GAVBEBQ.js */ "./node_modules/.taro/weapp/prebundle/chunk-6GAVBEBQ.js");
-/* harmony import */ var _chunk_3EXGJ5BE_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chunk-3EXGJ5BE.js */ "./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js");
-/* harmony import */ var _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./chunk-77KB62LY.js */ "./node_modules/.taro/weapp/prebundle/chunk-77KB62LY.js");
-/* harmony import */ var _chunk_SOUSFT7N_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./chunk-SOUSFT7N.js */ "./node_modules/.taro/weapp/prebundle/chunk-SOUSFT7N.js");
-/* harmony import */ var _chunk_P7VEE7PG_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./chunk-P7VEE7PG.js */ "./node_modules/.taro/weapp/prebundle/chunk-P7VEE7PG.js");
-
-
-
-
-
-// entry:@tarojs_taro
-var require_tarojs_taro = (0,_chunk_P7VEE7PG_js__WEBPACK_IMPORTED_MODULE_4__.__commonJS)({
-    "entry:@tarojs_taro" (exports, module) {
-        module.exports = (0,_chunk_6GAVBEBQ_js__WEBPACK_IMPORTED_MODULE_0__.require_taro)();
-    }
-});
-/* harmony default export */ __webpack_exports__["default"] = (require_tarojs_taro());
-
-
-/***/ }),
-
-/***/ "./node_modules/.taro/weapp/prebundle/@tarojs_taro.js":
-/*!************************************************************!*\
-  !*** ./node_modules/.taro/weapp/prebundle/@tarojs_taro.js ***!
-  \************************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-var m = __webpack_require__(/*! ./@tarojs_taro.core.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_taro.core.js");
-                   module.exports = m.default;
-                   exports["default"] = module.exports;
-                  
-
-/***/ })
-
-}]);

+ 7 - 13
dist/prebundle/remoteEntry.js

@@ -10,7 +10,7 @@ var taro_app_library;
 
 var moduleMap = {
 	"./@tarojs/taro": function() {
-		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-6GAVBEBQ_js"), __webpack_require__.e("node_modules_taro_weapp_prebundle_tarojs_taro_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_taro.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_taro.js")); }; });
+		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_tarojs_taro_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_taro.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_taro.js")); }; });
 	},
 	"./react-redux": function() {
 		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-LNJCN3VW_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-2Y2U3MWF_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_react-redux_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/react-redux.js */ "./node_modules/.taro/weapp/prebundle/react-redux.js")); }; });
@@ -18,9 +18,6 @@ var moduleMap = {
 	"./react": function() {
 		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-LNJCN3VW_js"), __webpack_require__.e("node_modules_taro_weapp_prebundle_react_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/react.js */ "./node_modules/.taro/weapp/prebundle/react.js")); }; });
 	},
-	"./taro-ui": function() {
-		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-LNJCN3VW_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-6GAVBEBQ_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_taro-ui_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/taro-ui.js */ "./node_modules/.taro/weapp/prebundle/taro-ui.js")); }; });
-	},
 	"./@reduxjs/toolkit": function() {
 		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_reduxjs_toolkit_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@reduxjs_toolkit.js */ "./node_modules/.taro/weapp/prebundle/@reduxjs_toolkit.js")); }; });
 	},
@@ -39,12 +36,12 @@ var moduleMap = {
 	"./@tarojs/runtime": function() {
 		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"), __webpack_require__.e("node_modules_taro_weapp_prebundle_tarojs_runtime_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_runtime.js")); }; });
 	},
-	"./@tarojs/plugin-platform-weapp/dist/runtime": function() {
-		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-platform-weapp_dist_runtime_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js")); }; });
-	},
 	"./@tarojs/plugin-framework-react/dist/runtime": function() {
 		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-framework-react_dist_runtime_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_plugin-framework-react_dist_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_plugin-framework-react_dist_runtime.js")); }; });
 	},
+	"./@tarojs/plugin-platform-weapp/dist/runtime": function() {
+		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-platform-weapp_dist_runtime_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js")); }; });
+	},
 	"./react-dom": function() {
 		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-LNJCN3VW_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-2Y2U3MWF_js"), __webpack_require__.e("node_modules_taro_weapp_prebundle_react-dom_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/react-dom.js */ "./node_modules/.taro/weapp/prebundle/react-dom.js")); }; });
 	}
@@ -86,9 +83,6 @@ var taroModuleMap = {
 	"./react": function() {
 		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/react.js */ "./node_modules/.taro/weapp/prebundle/react.js")); };
 	},
-	"./taro-ui": function() {
-		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/taro-ui.js */ "./node_modules/.taro/weapp/prebundle/taro-ui.js")); };
-	},
 	"./@reduxjs/toolkit": function() {
 		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@reduxjs_toolkit.js */ "./node_modules/.taro/weapp/prebundle/@reduxjs_toolkit.js")); };
 	},
@@ -107,12 +101,12 @@ var taroModuleMap = {
 	"./@tarojs/runtime": function() {
 		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_runtime.js")); };
 	},
-	"./@tarojs/plugin-platform-weapp/dist/runtime": function() {
-		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js")); };
-	},
 	"./@tarojs/plugin-framework-react/dist/runtime": function() {
 		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_plugin-framework-react_dist_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_plugin-framework-react_dist_runtime.js")); };
 	},
+	"./@tarojs/plugin-platform-weapp/dist/runtime": function() {
+		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js")); };
+	},
 	"./react-dom": function() {
 		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/react-dom.js */ "./node_modules/.taro/weapp/prebundle/react-dom.js")); };
 	}

File diff suppressed because it is too large
+ 0 - 4675
dist/prebundle/vendors-node_modules_taro_weapp_prebundle_taro-ui_js.js


+ 27 - 9
dist/prebundle/vendors-node_modules_taro_weapp_prebundle_chunk-6GAVBEBQ_js.js → dist/prebundle/vendors-node_modules_taro_weapp_prebundle_tarojs_taro_js.js

@@ -1,15 +1,13 @@
-"use strict";
-(wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["vendors-node_modules_taro_weapp_prebundle_chunk-6GAVBEBQ_js"],{
+(wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["vendors-node_modules_taro_weapp_prebundle_tarojs_taro_js"],{
 
-/***/ "./node_modules/.taro/weapp/prebundle/chunk-6GAVBEBQ.js":
-/*!**************************************************************!*\
-  !*** ./node_modules/.taro/weapp/prebundle/chunk-6GAVBEBQ.js ***!
-  \**************************************************************/
+/***/ "./node_modules/.taro/weapp/prebundle/@tarojs_taro.core.js":
+/*!*****************************************************************!*\
+  !*** ./node_modules/.taro/weapp/prebundle/@tarojs_taro.core.js ***!
+  \*****************************************************************/
 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
 
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   require_taro: function() { return /* binding */ require_taro; }
-/* harmony export */ });
+"use strict";
+__webpack_require__.r(__webpack_exports__);
 /* harmony import */ var _chunk_3EXGJ5BE_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk-3EXGJ5BE.js */ "./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js");
 /* harmony import */ var _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chunk-77KB62LY.js */ "./node_modules/.taro/weapp/prebundle/chunk-77KB62LY.js");
 /* harmony import */ var _chunk_SOUSFT7N_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./chunk-SOUSFT7N.js */ "./node_modules/.taro/weapp/prebundle/chunk-SOUSFT7N.js");
@@ -392,8 +390,27 @@ var require_taro = (0,_chunk_P7VEE7PG_js__WEBPACK_IMPORTED_MODULE_3__.__commonJS
         module.exports.default = module.exports;
     }
 });
+// entry:@tarojs_taro
+var require_tarojs_taro = (0,_chunk_P7VEE7PG_js__WEBPACK_IMPORTED_MODULE_3__.__commonJS)({
+    "entry:@tarojs_taro" (exports, module) {
+        module.exports = require_taro();
+    }
+});
+/* harmony default export */ __webpack_exports__["default"] = (require_tarojs_taro());
+
 
+/***/ }),
+
+/***/ "./node_modules/.taro/weapp/prebundle/@tarojs_taro.js":
+/*!************************************************************!*\
+  !*** ./node_modules/.taro/weapp/prebundle/@tarojs_taro.js ***!
+  \************************************************************/
+/***/ (function(module, exports, __webpack_require__) {
 
+var m = __webpack_require__(/*! ./@tarojs_taro.core.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_taro.core.js");
+                   module.exports = m.default;
+                   exports["default"] = module.exports;
+                  
 
 /***/ }),
 
@@ -403,6 +420,7 @@ var require_taro = (0,_chunk_P7VEE7PG_js__WEBPACK_IMPORTED_MODULE_3__.__commonJS
   \**************************************************************/
 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
 
+"use strict";
 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
 /* harmony export */   _classCallCheck: function() { return /* binding */ _classCallCheck; },
 /* harmony export */   _createClass: function() { return /* binding */ _createClass; },

+ 1 - 3
dist/vendors.js

@@ -204,9 +204,7 @@ function _objectSpread2(e) {
 /* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
 
 function _regeneratorRuntime() {
-  "use strict";
-
-  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
+  "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
   _regeneratorRuntime = function _regeneratorRuntime() {
     return e;
   };

File diff suppressed because it is too large
+ 0 - 0
dist/vendors.js.map


+ 1 - 1
src/app.tsx

@@ -4,7 +4,7 @@ import './context/locales/index'
 import { Provider } from 'react-redux'
 import store from './store/store'
 
-import 'taro-ui/dist/style/index.scss'
+// import 'taro-ui/dist/style/index.scss'
 
 
 const App: React.FC<PropsWithChildren> = ({ children }) => {

+ 3 - 86
src/features/auth/components/Auth.tsx

@@ -9,99 +9,16 @@ import { useTranslation } from 'react-i18next'
 import './Auth.scss'
 import { useState } from "react";
 import { useDispatch, useSelector } from "react-redux";
-import { register } from "@/store/user";
 import Taro from "@tarojs/taro";
 
 import Login from './Login'
 import CreateAccount from './CreateAccount'
 
 export default function Auth() {
-    const { t } = useTranslation()
-    const dispatch = useDispatch();
 
     const [isSignup, setIsSignup] = useState(true);
-    const [name, setName] = useState('');
-    const [email, setEmail] = useState('');
-    const [password, setPassword] = useState('');
 
-    const handleNameChange = (value: string) => {
-        setName(value);
-    };
-    const handleEmailChange = (value: string) => {
-        setEmail(value);
-    };
-
-    const handlePasswordChange = (value: string) => {
-        setPassword(value);
-    }
-
-    const isButtonDisabled = name === '' || email === '';
-    const isLoginButtonDisabled = email === '' || password === '';
-
-    function signupComponent() {
-        return <View>
-            <Inputs value={name} onChange={handleNameChange} placeholder={t('feature.auth.create_account.input_username_placeholder')}></Inputs>
-            <View style={{ height: 20 }} />
-            <Inputs value={email} onChange={handleEmailChange} placeholder={t('feature.auth.create_account.input_email_placeholder')}></Inputs>
-        </View>
-    }
-
-    function loginComponent() {
-        return <View>
-            <Inputs value={email} onChange={handleEmailChange} placeholder={t('feature.auth.login.input_account_placeholder')}></Inputs>
-            <View style={{ height: 20 }} />
-            <Inputs value={password} isSecure={true} onChange={handlePasswordChange} placeholder={t('feature.auth.login.input_password_placeholder')}></Inputs>
-        </View>
-    }
-
-    function registerF() {
-        if (isButtonDisabled) {
-            return;
-        }
-        setTimeout(() => {
-            Taro.navigateTo({
-                url: `/pages/Auth?type=createPassword&name=${name}&email=${email}`
-            })
-        }, 1000)
-
-        // setTimeout(() => {
-        //     Taro.navigateBack()
-        //     Taro.redirectTo({
-        //         url: '/pages/ChooseScenario'
-        //     })
-        // },1000)
-    }
-
-    function changeLogin(){
-        setIsSignup(false)
-        console.log(isSignup)
-    }
-
-    return <View style={{ backgroundColor: '#000', flex: 1, flexDirection: 'column', display: 'flex', width: '100vw', height: '100vh' }}>
-        <Texts text={t('feature.auth.create_account.title')} type={TextType.primary}></Texts>
-        <Texts text={t('feature.auth.create_account.sub_title')} type={TextType.secondary}></Texts>
-        <Box child={isSignup ? signupComponent() : loginComponent()}></Box>
-        {
-            isSignup ?
-                <Buttons
-                    onClick={registerF}
-                    title={t('feature.auth.create_account.btn_next')}
-                    style={{ marginLeft: 23, marginRight: 23, marginTop: 20, marginBottom: 20 }}
-                    status={isButtonDisabled ? ComponentStatus.disable : ComponentStatus.enable}></Buttons> :
-                <Buttons
-                    onClick={registerF}
-                    title={t('feature.auth.create_account.btn_next')}
-                    style={{ marginLeft: 23, marginRight: 23, marginTop: 20, marginBottom: 20 }}
-                    status={isLoginButtonDisabled ? ComponentStatus.disable : ComponentStatus.enable}></Buttons>
-        }
-        <View className="agree_view">
-            <Image style='width:12px;height:12px;' src={check} />
-            <Text className='agree_text'>{t('page.auth.agreement')}</Text>
-        </View>
-        <View style={{ flex: 1 }} />
-        <View className="footer">
-            <Text className="have_account">{t('feature.auth.create_account.footer_desc')}</Text>
-            <Text className="login" onClick={() => setIsSignup(!isSignup)}>{t('feature.auth.create_account.footer_login')}</Text>
-        </View>
-    </View>
+    if (isSignup)
+        return <CreateAccount login={() => setIsSignup(false)}></CreateAccount>
+    return <Login register={() => setIsSignup(true)}></Login>
 }

+ 2 - 2
src/features/auth/components/CreateAccount.tsx

@@ -10,7 +10,7 @@ import { useTranslation } from "react-i18next";
 import check from '@assets/svg/check.svg'
 import './Auth.scss'
 
-export default function Component() {
+export default function Component(props:{login:()=>void}) {
   const { t } = useTranslation()
   const [name, setName] = useState('');
   const [email, setEmail] = useState('');
@@ -67,7 +67,7 @@ export default function Component() {
     <View style={{ flex: 1 }} />
     <View className="footer">
       <Text className="have_account">{t('feature.auth.create_account.footer_desc')}</Text>
-      <Text className="login" onClick={() => {}}>{t('feature.auth.create_account.footer_login')}</Text>
+      <Text className="login" onClick={() => props.login()}>{t('feature.auth.create_account.footer_login')}</Text>
     </View>
   </View>
 }

+ 1 - 1
src/features/auth/components/CreatePassword.tsx

@@ -2,7 +2,6 @@ import Box from "@/components/Box";
 import Buttons from "@/components/Buttons";
 import Inputs from "@/components/Inputs";
 import Texts from "@/components/Texts";
-import { register } from "@/store/user";
 import { ComponentStatus, TextType } from "@/utils/types";
 import { View, Image, Text } from "@tarojs/components";
 import { useState } from "react";
@@ -11,6 +10,7 @@ import { useDispatch, useSelector } from "react-redux";
 import check from '@assets/svg/check.svg'
 import './Auth.scss'
 import Taro from "@tarojs/taro";
+import { register } from "@/services/user";
 
 export default function Component(prop: { name: string, email: string }) {
   const { t } = useTranslation()

+ 2 - 2
src/features/auth/components/login.tsx

@@ -9,7 +9,7 @@ import { ComponentStatus, TextType } from "@/utils/types";
 import Buttons from "@/components/Buttons";
 import './Auth.scss'
 
-export default function Login() {
+export default function Login(props:{register:()=>void}) {
     const { t } = useTranslation()
     const [name, setName] = useState('');
     const [password, setPassword] = useState('');
@@ -52,7 +52,7 @@ export default function Login() {
         <View style={{ flex: 1 }} />
         <View className="footer">
             <Text className="have_account">{t('feature.auth.create_account.footer_desc')}</Text>
-            <Text className="login" onClick={() => { }}>{t('feature.auth.create_account.footer_login')}</Text>
+            <Text className="login" onClick={() => props.register()}>{t('feature.auth.create_account.footer_login')}</Text>
         </View>
     </View>
 }

+ 1 - 1
src/features/trackTimeDuration/components/SetSchedule.tsx

@@ -1,7 +1,7 @@
 import Buttons from "@/components/Buttons";
 import { View, Text } from "@tarojs/components";
 import { Picker } from '@tarojs/components'
-import { AtList, AtListItem } from 'taro-ui'
+// import { AtList, AtListItem } from 'taro-ui'
 import { useState } from "react";
 
 export default function Component(props:{ scenario: any }) {

+ 3 - 7
src/pages/ChooseAuth.tsx

@@ -5,8 +5,8 @@ import './ChooseAuth.scss'
 import { ButtonType, ComponentStatus, TextType } from "../utils/types";
 import Taro, { useReady } from "@tarojs/taro";
 import { useDispatch, useSelector } from "react-redux";
-import { wxLogin } from "@/store/user";
 import { useState } from "react";
+import { wxLogin } from "@/services/user";
 
 export default function Page() {
     const dispatch = useDispatch();
@@ -23,15 +23,11 @@ export default function Page() {
 
     async function login() {
         try {
-            const { userInfo, encryptedData, iv } = await Taro.getUserProfile({
+            const {  encryptedData, iv } = await Taro.getUserProfile({
                 desc: '获取用户信息',
             });
 
-            dispatch(wxLogin({
-                code: code,
-                encryptedData: encryptedData,
-                iv: iv
-            }) as any);
+            dispatch(wxLogin(code, encryptedData, iv) as any);
 
             setTimeout(() => {
                 Taro.redirectTo({

+ 1 - 1
src/pages/Second.tsx

@@ -1,6 +1,6 @@
 import Buttons from "@/components/Buttons";
+import { clear, logout } from "@/services/user";
 import { View,Text } from "@tarojs/components";
-import { logout,clear } from "@/store/user";
 import { useDispatch } from "react-redux";
 
 export default function Second() {

+ 46 - 31
src/pages/index/index.tsx

@@ -1,55 +1,70 @@
 import { Component, PropsWithChildren } from 'react'
 import { View, Text, Button, Input } from '@tarojs/components'
 import './index.scss'
-import Taro from '@tarojs/taro'
+import Taro, { useReady } from '@tarojs/taro'
 // import ComponentA from './component'
 import Rings from '@components/Rings';
 import SingleSelect from '@components/SingleSelect';
-import { useSelector } from 'react-redux';
+import { useDispatch, useSelector } from 'react-redux';
+import { getInfoSuccess } from '@/store/user';
 // import TabBar from '../../components/Tabbar';
 
 export default function IndexPage() {
+  const dispatch = useDispatch();
   const array: any[] = []
   const user = useSelector((state: any) => state.user);
   array.push('ffff');
   array.push(<Text>ffff</Text>)
   // array.push(<Rings radius={50}/>)
-  function goDetail() {
-    Taro.navigateTo({
-      // url: '/pages/index/detail'
-      //src/moduleA/pages/third.tsx
-      url: '../../moduleA/pages/third'
+
+  useReady(async () => {
+      const userData = await getStorage('userData');
+      if(userData) {
+        dispatch(getInfoSuccess(JSON.parse(userData as string)) as any);
+        // return JSON.parse(userData as string) as UserState;
+      }
     })
-  }
 
-  function login() {
-    if (user.isLogin) {
-      Taro.navigateTo({
-        url: '/pages/ChooseScenario'
-      })
+    function getStorage(key) {
+      return Taro.getStorage({ key }).then(res => res.data).catch(() => '')
     }
-    else {
+
+    function goDetail() {
       Taro.navigateTo({
-        url: '/pages/ChooseAuth'
+        // url: '/pages/index/detail'
+        //src/moduleA/pages/third.tsx
+        url: '../../moduleA/pages/third'
       })
     }
-    
+
+    function login() {
+      if (user.isLogin) {
+        Taro.navigateTo({
+          url: '/pages/ChooseScenario'
+        })
+      }
+      else {
+        Taro.navigateTo({
+          url: '/pages/ChooseAuth'
+        })
+      }
+
+    }
+    return (
+      <View style={{ backgroundColor: '#fff', flex: 1, flexDirection: 'column', display: 'flex' }}>
+        <Text>homepage12234</Text>
+        <Text>{user.isLogin ? '已登录' : '未登录'}</Text>
+        <Text>{user.isLogin ? `用户昵称:${user.nickname}` : ''}</Text>
+        {/* <ComponentA value="ABBBB" /> */}
+        <Button onClick={() => goDetail()}>go detail</Button>
+        {/* <SingleSelect items={array}></SingleSelect> */}
+        <Rings radius={50} />
+        <Input placeholder="请输入用户名1" style={{ textAlign: 'left', backgroundColor: 'pink' }} />
+        <Text className='login' onClick={() => login()}>sss</Text>
+        {/* <TabBar /> */}
+      </View>
+    )
   }
-  return (
-    <View style={{ backgroundColor: '#fff', flex: 1,flexDirection:'column',display:'flex' }}>
-      <Text>homepage12234</Text>
-      <Text>{user.isLogin?'已登录':'未登录'}</Text>
-      <Text>{user.isLogin?`用户昵称:${user.nickname}`:''}</Text>
-      {/* <ComponentA value="ABBBB" /> */}
-      <Button onClick={() => goDetail()}>go detail</Button>
-      {/* <SingleSelect items={array}></SingleSelect> */}
-      <Rings radius={50} />
-      <Input placeholder="请输入用户名1" style={{ textAlign: 'left', backgroundColor: 'pink' }} />
-      <Text className='login' onClick={() => login()}>sss</Text>
-      {/* <TabBar /> */}
-    </View>
-  )
-}
 
 // export default class Index extends Component<PropsWithChildren> {
 

+ 0 - 28
src/services/account.js

@@ -1,28 +0,0 @@
-import { API_LOGIN, API_LOGOUT } from './http/api'
-import { request } from './http/request'
-
-export function login(params) {
-    return new Promise((resolve, reject) => {
-        request({
-            url:API_LOGIN, method:'POST', data:{...params}
-        }).then(res => {
-            resolve(res)
-        })
-    })
-}
-
-// export function login(params) {
-//     return new Promise((resolve, reject) => {
-//         request(API_LOGIN, 'post', params).then(res => {
-//             resolve(res)
-//         })
-//     })
-// }
-
-// export function logout(params) {
-//     return new Promise((resolve, reject) => {
-//         request(api.API_LOGOUT, 'post', params).then(res => {
-//             resolve(res)
-//         })
-//     })
-// }

+ 25 - 10
src/services/http/request.ts

@@ -55,19 +55,34 @@ export async function request<T>(param: RequestParam): Promise<T> {
             data: data || {},
             success: (response: Resp | { [key: string]: any }) => {
                 const { statusCode, data } = response;
-                if (statusCode == 204){
-                    resolve({} as T);
+                if (statusCode >=200 && statusCode < 300){
+                    var resp = {} as T;
+                    if (response.data){
+                        resp = response.data as T;
+                    }
+                    
+                    resolve(resp);
                 }
-                if (statusCode != 200) {
-                    reject(data);
+                else if (statusCode == 401) {
+
                 }
-                const { error_code } = response.data || {};
-                if (error_code === 'NOT_LOGIN') {
-                    // new UserManager().logout();
+                else {
+                    reject(data);
                 }
-
-                const resp = response.data as T;
-                resolve(resp);
+                // if (statusCode == 204){
+                //     resolve({} as T);
+                // }
+                // if (statusCode != 200) {
+                //     reject(data);
+                // }
+                // const { error_code } = response.data || {};
+                // if (error_code === 'NOT_LOGIN') {
+                //     // new UserManager().logout();
+                // }
+
+                //200-299 正常resolve
+                //401 未登录
+                //400-499 业务错误 reject
             },
             fail: err => {
                 if (err.errMsg == 'request:fail timeout') {

+ 83 - 0
src/services/user.tsx

@@ -0,0 +1,83 @@
+import { API_LOGIN, API_REGISTER, API_LOGOUT, API_CLEAR_USER, API_USER_INFO } from './http/api'
+import { request } from './http/request'
+import { clearSuccess, getInfoSuccess, loginSuccess, logoutSuccess, registerSuccess, updateSuccess } from '@/store/user'
+
+export const login = (username: string, password: string) => (dispatch: any) => {
+    request({
+        url: API_LOGIN, method: 'POST', data: { username, password }
+    }).then(res => {
+        dispatch(loginSuccess(res));
+    })
+}
+
+export const wxLogin = (code: string, encryptedData: string, iv: string) => (dispatch: any)=> {
+    request({
+        url: API_LOGIN, method: 'POST',
+        data: {
+            code: code,
+            type: 'WX_MP',
+            app_version: '1',
+            client_version: '1',
+            client_type: 'WX_MP',
+            extra: {
+                encryptedData: encryptedData,
+                iv: iv
+            }
+        }
+    }).then(res => {
+        dispatch(loginSuccess(res));
+    })
+};
+
+/*
+export const wxLogin = (code: string) => (dispatch: any) => {
+    
+    request({
+        url: API_LOGIN, method: 'POST', data: { code,type:'WX_MP',app_version:'1',client_version:'1',client_type:'WXP_MP' }
+    }).then(res => {
+        console.log(res);
+        dispatch(loginSuccess(res));
+    })
+}*/
+
+export const register = (name: string, email: string, password: string) => (dispatch: any) => {
+    request({
+        url: API_REGISTER, method: 'POST', data: { client_type: 'IOS', username: name, email: email, password: password }
+    }).then(res => {
+        dispatch(registerSuccess(res));
+    })
+}
+
+export const logout = () => (dispatch: any) => {
+    request({
+        url: API_LOGOUT, method: 'GET', data: {}
+    }).then(_ => {
+        dispatch(logoutSuccess());
+    })
+}
+
+export const clear = () => (dispatch: any) => {
+    request({
+        url: API_CLEAR_USER, method: 'POST', data: {}
+    }).then(_ => {
+        dispatch(clearSuccess());
+    })
+}
+
+export const getInfo = () => (dispatch: any) => {
+    request({
+        url: API_USER_INFO, method: 'GET', data: {}
+    }).then(res => {
+        dispatch(getInfoSuccess(res));
+    })
+}
+
+
+export const update = () => (dispatch: any) => {
+    request({
+        url: API_USER_INFO, method: 'POST', data: {}
+    }).then(res => {
+        dispatch(updateSuccess(res));
+    })
+}
+

+ 85 - 98
src/store/user.tsx

@@ -1,6 +1,4 @@
 import { createAsyncThunk, createSlice, PayloadAction } from '@reduxjs/toolkit';
-import { request } from '@services/http/request'
-import { API_LOGIN, API_REGISTER, API_LOGOUT, API_CLEAR_USER, API_USER_INFO } from '@services/http/api'
 import Taro from '@tarojs/taro';
 interface UserState {
     nickname: string | null;
@@ -9,24 +7,6 @@ interface UserState {
     isLogin: boolean;
 }
 
-function getStorage(key) {
-    return Taro.getStorage({ key }).then(res => res.data).catch(() => '')
-}
-
-const getUserDataFromLocalStorage = async (): Promise<UserState> => {
-    const userData = await getStorage('userData');
-    if (userData) {
-        return JSON.parse(userData as string) as UserState;
-    }
-
-    return {
-        isLogin: false,
-        nickname: null,
-        avatar: null,
-        token: null,
-    }
-}
-
 
 // const initialState: UserState = await getUserDataFromLocalStorage();
 const initialState: UserState = {
@@ -47,6 +27,7 @@ const userSlice = createSlice({
             state.token = token;
             state.isLogin = true;
             global.token = token;
+            Taro.setStorage({ key: 'userData', data: JSON.stringify(action.payload) });
         },
         registerSuccess(state, action: PayloadAction<any>) {
             const { nickname, avatar, token } = action.payload;
@@ -55,6 +36,7 @@ const userSlice = createSlice({
             state.token = token;
             state.isLogin = true;
             global.token = token;
+            Taro.setStorage({ key: 'userData', data: JSON.stringify(action.payload) });
         },
         logoutSuccess(state) {
             state.nickname = null;
@@ -62,6 +44,7 @@ const userSlice = createSlice({
             state.token = null;
             state.isLogin = false;
             global.token = '';
+            Taro.clearStorage();
         },
         clearSuccess(state) {
             state.nickname = null;
@@ -69,6 +52,7 @@ const userSlice = createSlice({
             state.token = null;
             state.isLogin = false;
             global.token = '';
+            Taro.clearStorage();
         },
         getInfoSuccess(state, action: PayloadAction<any>) {
             const { nickname, avatar, token } = action.payload;
@@ -76,6 +60,8 @@ const userSlice = createSlice({
             state.avatar = avatar;
             state.token = token;
             state.isLogin = true;
+            global.token = token;
+            Taro.setStorage({ key: 'userData', data: JSON.stringify(action.payload) });
         },
         updateSuccess(state, action: PayloadAction<any>) {
             const { nickname, avatar, token } = action.payload;
@@ -83,6 +69,7 @@ const userSlice = createSlice({
             state.avatar = avatar;
             state.token = token;
             state.isLogin = true;
+            Taro.setStorage({ key: 'userData', data: JSON.stringify(action.payload) });
         }
     },
 });
@@ -91,83 +78,83 @@ export const { loginSuccess, registerSuccess, logoutSuccess, getInfoSuccess, upd
 export default userSlice.reducer;
 
 
-export const login = (username: string, password: string) => (dispatch: any) => {
-    request({
-        url: API_LOGIN, method: 'POST', data: { username, password }
-    }).then(res => {
-        dispatch(loginSuccess(res));
-    })
-}
-
-export const wxLogin = createAsyncThunk('user/wxLogin', async (payload: { code: string, encryptedData: string,iv:string }, { dispatch }) => {
-    console.log(payload.code)
-    request({
-        url: API_LOGIN, method: 'POST',
-        data: {
-            code: payload.code,
-            type: 'WX_MP',
-            app_version: '1',
-            client_version: '1',
-            client_type: 'WX_MP',
-            extra: {
-                encryptedData: payload.encryptedData,
-                iv: payload.iv
-            }
-        }
-    }).then(res => {
-        dispatch(loginSuccess(res));
-    })
-});
-
-/*
-export const wxLogin = (code: string) => (dispatch: any) => {
+// export const login = (username: string, password: string) => (dispatch: any) => {
+//     request({
+//         url: API_LOGIN, method: 'POST', data: { username, password }
+//     }).then(res => {
+//         dispatch(loginSuccess(res));
+//     })
+// }
+
+// export const wxLogin = createAsyncThunk('user/wxLogin', async (payload: { code: string, encryptedData: string,iv:string }, { dispatch }) => {
+//     console.log(payload.code)
+//     request({
+//         url: API_LOGIN, method: 'POST',
+//         data: {
+//             code: payload.code,
+//             type: 'WX_MP',
+//             app_version: '1',
+//             client_version: '1',
+//             client_type: 'WX_MP',
+//             extra: {
+//                 encryptedData: payload.encryptedData,
+//                 iv: payload.iv
+//             }
+//         }
+//     }).then(res => {
+//         dispatch(loginSuccess(res));
+//     })
+// });
+
+// /*
+// export const wxLogin = (code: string) => (dispatch: any) => {
     
-    request({
-        url: API_LOGIN, method: 'POST', data: { code,type:'WX_MP',app_version:'1',client_version:'1',client_type:'WXP_MP' }
-    }).then(res => {
-        console.log(res);
-        dispatch(loginSuccess(res));
-    })
-}*/
-
-export const register = (name: string,email:string, password: string) => (dispatch: any) => {
-    request({
-        url: API_REGISTER, method: 'POST', data: { client_type:'IOS',username:name,email:email, password:password }
-    }).then(res => {
-        dispatch(registerSuccess(res));
-    })
-}
-
-export const logout = () => (dispatch: any) => {
-    request({
-        url: API_LOGOUT, method: 'GET', data: {}
-    }).then(res => {
-        dispatch(logoutSuccess());
-    })
-}
-
-export const clear = () => (dispatch: any) => {
-    request({
-        url: API_CLEAR_USER, method: 'POST', data: {}
-    }).then(res => {
-        dispatch(clearSuccess());
-    })
-}
-
-export const getInfo = () => (dispatch: any) => {
-    request({
-        url: API_USER_INFO, method: 'GET', data: {}
-    }).then(res => {
-        dispatch(getInfoSuccess(res));
-    })
-}
-
-
-export const update = () => (dispatch: any) => {
-    request({
-        url: API_USER_INFO, method: 'POST', data: {}
-    }).then(res => {
-        dispatch(updateSuccess(res));
-    })
-}
+//     request({
+//         url: API_LOGIN, method: 'POST', data: { code,type:'WX_MP',app_version:'1',client_version:'1',client_type:'WXP_MP' }
+//     }).then(res => {
+//         console.log(res);
+//         dispatch(loginSuccess(res));
+//     })
+// }*/
+
+// export const register = (name: string,email:string, password: string) => (dispatch: any) => {
+//     request({
+//         url: API_REGISTER, method: 'POST', data: { client_type:'IOS',username:name,email:email, password:password }
+//     }).then(res => {
+//         dispatch(registerSuccess(res));
+//     })
+// }
+
+// export const logout = () => (dispatch: any) => {
+//     request({
+//         url: API_LOGOUT, method: 'GET', data: {}
+//     }).then(res => {
+//         dispatch(logoutSuccess());
+//     })
+// }
+
+// export const clear = () => (dispatch: any) => {
+//     request({
+//         url: API_CLEAR_USER, method: 'POST', data: {}
+//     }).then(res => {
+//         dispatch(clearSuccess());
+//     })
+// }
+
+// export const getInfo = () => (dispatch: any) => {
+//     request({
+//         url: API_USER_INFO, method: 'GET', data: {}
+//     }).then(res => {
+//         dispatch(getInfoSuccess(res));
+//     })
+// }
+
+
+// export const update = () => (dispatch: any) => {
+//     request({
+//         url: API_USER_INFO, method: 'POST', data: {}
+//     }).then(res => {
+//         dispatch(updateSuccess(res));
+//     })
+// }
 

Some files were not shown because too many files changed in this diff