web-backset.cn/apps/server/public/signup.js

99 lines
11 KiB
JavaScript
Raw Normal View History

2023-02-17 17:59:41 +08:00
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./view/page/signup/index.less":
/*!*************************************!*\
!*** ./view/page/signup/index.less ***!
\*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://@backset/server/./view/page/signup/index.less?");
/***/ }),
/***/ "./view/api/index.ts":
/*!***************************!*\
!*** ./view/api/index.ts ***!
\***************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.createUser = exports.getVerifyCode = exports.userLogin = void 0;\nconst request_1 = __webpack_require__(/*! ../lib/request */ \"./view/lib/request.ts\");\n/**\n * 用户登录\n */\nconst userLogin = (p) => request_1.axiosCommon.post('/auth/user/login', p);\nexports.userLogin = userLogin;\n/**\n * 获取验证码\n */\nconst getVerifyCode = (p) => request_1.axiosCommon.post('/sms/verifycode', p);\nexports.getVerifyCode = getVerifyCode;\n/**\n * 用户注册\n */\nconst createUser = (p) => request_1.axiosCommon.post('/user/create', p);\nexports.createUser = createUser;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi92aWV3L2FwaS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFFQSw0Q0FBd0Q7QUFFeEQ7O0dBRUc7QUFDSSxNQUFNLFNBQVMsR0FBRyxDQUFDLENBQW9CLEVBQUUsRUFBRSxDQUNoRCxxQkFBTyxDQUFDLElBQUksQ0FBQyxrQkFBa0IsRUFBRSxDQUFDLENBQUMsQ0FBQztBQUR6QixRQUFBLFNBQVMsYUFDZ0I7QUFFdEM7O0dBRUc7QUFDSSxNQUFNLGFBQWEsR0FBRyxDQUFDLENBQXFCLEVBQUUsRUFBRSxDQUNyRCxxQkFBTyxDQUFDLElBQUksQ0FBQyxpQkFBaUIsRUFBRSxDQUFDLENBQUMsQ0FBQztBQUR4QixRQUFBLGFBQWEsaUJBQ1c7QUFFckM7O0dBRUc7QUFDSSxNQUFNLFVBQVUsR0FBRyxDQUFDLENBQWUsRUFBRSxFQUFFLENBQUMscUJBQU8sQ0FBQyxJQUFJLENBQUMsY0FBYyxFQUFFLENBQUMsQ0FBQyxDQUFDO0FBQWxFLFFBQUEsVUFBVSxjQUF3RCJ9\n\n//# sourceURL=webpack://@backset/server/./view/api/index.ts?");
/***/ }),
/***/ "./view/lib/request.ts":
/*!*****************************!*\
!*** ./view/lib/request.ts ***!
\*****************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.axiosCommon = exports.sourceCommon = void 0;\nconst axios_1 = __webpack_require__(Object(function webpackMissingModule() { var e = new Error(\"Cannot find module 'axios'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }()));\nconst router_1 = __webpack_require__(Object(function webpackMissingModule() { var e = new Error(\"Cannot find module '../../config/router'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }()));\nconst CancelToken = axios_1.default.CancelToken;\nexports.sourceCommon = CancelToken.source();\nconst axiosCommon = axios_1.default.create({\n timeout: 6000 * 1000,\n cancelToken: exports.sourceCommon.token,\n baseURL: router_1.PREFIX.startsWith('/') ? router_1.PREFIX : '/' + router_1.PREFIX,\n});\nexports.axiosCommon = axiosCommon;\n// 请求拦截\naxiosCommon.interceptors.request.use((config) => {\n //TODO 一些拦截操作 here\n return config;\n}, (error) => {\n //TODO 一些提示...here\n return Promise.reject(error);\n});\n// 响应拦截\naxiosCommon.interceptors.response.use((response) => {\n const { code } = response.data;\n switch (code) {\n case 1000:\n if (window.location.pathname != '/login') {\n window.location.href = `/login`;\n }\n // message.warn('即将回到登录页');\n // setTimeout(() => {\n // }, 3000);\n break;\n default:\n break;\n }\n return response.data;\n}, (err) => Promise.reject(err));\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVxdWVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3ZpZXcvbGliL3JlcXVlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsaUNBQTBCO0FBQzFCLGdEQUE2QztBQUU3QyxNQUFNLFdBQVcsR0FBRyxlQUFLLENBQUMsV0FBVyxDQUFDO0FBQ3pCLFFBQUEsWUFBWSxHQUFHLFdBQVcsQ0FBQyxNQUFNLEVBQUUsQ0FBQztBQUVqRCxNQUFNLFdBQVcsR0FBRyxlQUFLLENBQUMsTUFBTSxDQUFDO0lBQy9CLE9BQU8sRUFBRSxJQUFJLEdBQUcsSUFBSTtJQUNwQixXQUFXLEVBQUUsb0JBQVksQ0FBQyxLQUFLO0lBQy9CLE9BQU8sRUFBRSxlQUFNLENBQUMsVUFBVSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxlQUFNLENBQUMsQ0FBQyxDQUFDLEdBQUcsR0FBRyxlQUFNO0NBQ3hELENBQUMsQ0FBQztBQW9DTSxrQ0FBVztBQWxDcEIsT0FBTztBQUNQLFdBQVcsQ0FBQyxZQUFZLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FDbEMsQ0FBQyxNQUFNLEVBQUUsRUFBRTtJQUNULGtCQUFrQjtJQUNsQixPQUFPLE1BQU0sQ0FBQztBQUNoQixDQUFDLEVBQ0QsQ0FBQyxLQUFLLEVBQUUsRUFBRTtJQUNSLGtCQUFrQjtJQUNsQixPQUFPLE9BQU8sQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUM7QUFDL0IsQ0FBQyxDQUNGLENBQUM7QUFFRixPQUFPO0FBQ1AsV0FBVyxDQUFDLFlBQVksQ0FBQyxRQUFRLENBQUMsR0FBRyxDQUNuQyxDQUFDLFFBQVEsRUFBRSxFQUFFO0lBQ1gsTUFBTSxFQUFFLElBQUksRUFBRSxHQUFHLFFBQVEsQ0FBQyxJQUFJLENBQUM7SUFDL0IsUUFBUSxJQUFJLEVBQUU7UUFDWixLQUFLLElBQUk7WUFDUCxJQUFJLE1BQU0sQ0FBQyxRQUFRLENBQUMsUUFBUSxJQUFJLFFBQVEsRUFBRTtnQkFDeEMsTUFBTSxDQUFDLFFBQVEsQ0FBQyxJQUFJLEdBQUcsUUFBUSxDQUFDO2FBQ2pDO1lBQ0QsMkJBQTJCO1lBQzNCLHFCQUFxQjtZQUVyQixZQUFZO1lBQ1osTUFBTTtRQUNSO1lBQ0UsTUFBTTtLQUNUO0lBQ0QsT0FBTyxRQUFRLENBQUMsSUFBSSxDQUFDO0FBQ3ZCLENBQUMsRUFDRCxDQUFDLEdBQUcsRUFBRSxFQUFFLENBQUMsT0FBTyxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FDN0IsQ0FBQyJ9\n\n//# sourceURL=webpack://@backset/server/./view/lib/request.ts?");
/***/ }),
/***/ "./view/page/signup/index.ts":
/*!***********************************!*\
!*** ./view/page/signup/index.ts ***!
\***********************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst api_1 = __webpack_require__(/*! ../../api */ \"./view/api/index.ts\");\n__webpack_require__(/*! ./index.less */ \"./view/page/signup/index.less\");\nconst cash_dom_1 = __webpack_require__(Object(function webpackMissingModule() { var e = new Error(\"Cannot find module 'cash-dom'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }()));\nconst { RegUtil, ValidateUtil } = __webpack_require__(Object(function webpackMissingModule() { var e = new Error(\"Cannot find module '@backset/util'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }()));\n(0, cash_dom_1.default)(function () {\n (0, cash_dom_1.default)('#signup-module').on('click', '#btn-signup', handleCreateUser);\n /**\n * 注册\n */\n function handleCreateUser() {\n const params = {\n user_login: '' + (0, cash_dom_1.default)('#username').val(),\n user_pass: '' + (0, cash_dom_1.default)('#password').val(),\n user_phone: '' + (0, cash_dom_1.default)('#tel').val(),\n };\n if (ValidateUtil.withEmpty(params))\n return;\n // return message.error({ text: '请补全表单' });\n if (!RegUtil.PHONE.test(params.user_phone))\n return;\n // return message.error({ text: '手机号格式错误' });\n (0, api_1.createUser)(params).then((res) => {\n console.log(res);\n });\n }\n});\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi92aWV3L3BhZ2Uvc2lnbnVwL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsbUNBQXVDO0FBQ3ZDLHdCQUFzQjtBQUN0Qix1Q0FBeUI7QUFDekIsTUFBTSxFQUFFLE9BQU8sRUFBRSxZQUFZLEVBQUUsR0FBRyxPQUFPLENBQUMsZUFBZSxDQUFDLENBQUE7QUFFMUQsSUFBQSxrQkFBQyxFQUFDO0lBQ0EsSUFBQSxrQkFBQyxFQUFDLGdCQUFnQixDQUFDLENBQUMsRUFBRSxDQUFDLE9BQU8sRUFBRSxhQUFhLEVBQUUsZ0JBQWdCLENBQUMsQ0FBQztJQUVqRTs7T0FFRztJQUNILFNBQVMsZ0JBQWdCO1FBQ3ZCLE1BQU0sTUFBTSxHQUFHO1lBQ2IsVUFBVSxFQUFFLEVBQUUsR0FBRyxJQUFBLGtCQUFDLEVBQUMsV0FBVyxDQUFDLENBQUMsR0FBRyxFQUFFO1lBQ3JDLFNBQVMsRUFBRSxFQUFFLEdBQUcsSUFBQSxrQkFBQyxFQUFDLFdBQVcsQ0FBQyxDQUFDLEdBQUcsRUFBRTtZQUNwQyxVQUFVLEVBQUUsRUFBRSxHQUFHLElBQUEsa0JBQUMsRUFBQyxNQUFNLENBQUMsQ0FBQyxHQUFHLEVBQUU7U0FDakMsQ0FBQztRQUNGLElBQUksWUFBWSxDQUFDLFNBQVMsQ0FBQyxNQUFNLENBQUM7WUFBRSxPQUFPO1FBQzNDLDJDQUEyQztRQUMzQyxJQUFJLENBQUMsT0FBTyxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLFVBQVUsQ0FBQztZQUFFLE9BQU87UUFDbkQsNkNBQTZDO1FBQzdDLElBQUEsZ0JBQVUsRUFBQyxNQUFNLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxHQUFHLEVBQUUsRUFBRTtZQUM5QixPQUFPLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxDQUFDO1FBQ25CLENBQUMsQ0FBQyxDQUFDO0lBQ0wsQ0FBQztBQUNILENBQUMsQ0FBQyxDQUFDIn0=\n\n//# sourceURL=webpack://@backset/server/./view/page/signup/index.ts?");
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = __webpack_require__("./view/page/signup/index.ts");
/******/
/******/ })()
;