component-shipinlv 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +21 -0
- package/README.md +4 -0
- package/dist/AuthClient/index.d.ts +10 -0
- package/dist/AuthClient/index.js +24 -0
- package/dist/AuthClient/login-reg.d.ts +9 -0
- package/dist/AuthClient/login-reg.js +62 -0
- package/dist/AuthClient/login-reg.less +13 -0
- package/dist/AuthClient/login.d.ts +7 -0
- package/dist/AuthClient/login.js +159 -0
- package/dist/AuthClient/login.less +52 -0
- package/dist/AuthClient/qr/index.d.ts +13 -0
- package/dist/AuthClient/qr/index.js +315 -0
- package/dist/AuthClient/qr/index.less +84 -0
- package/dist/AuthClient/qr/typings.d.ts +22 -0
- package/dist/AuthClient/qr/ws.d.ts +20 -0
- package/dist/AuthClient/qr/ws.js +253 -0
- package/dist/AuthClient/reg.d.ts +7 -0
- package/dist/AuthClient/reg.js +170 -0
- package/dist/AuthClient/reg.less +3 -0
- package/dist/Buy/index.d.ts +14 -0
- package/dist/Buy/index.js +91 -0
- package/dist/Buy/index.less +26 -0
- package/dist/Buy/qr.d.ts +11 -0
- package/dist/Buy/qr.js +185 -0
- package/dist/Buy/qr.less +69 -0
- package/dist/Login/index.d.ts +2 -0
- package/dist/Login/index.js +5 -0
- package/dist/Product/index.d.ts +4 -0
- package/dist/Product/index.js +34 -0
- package/dist/Product/index.less +84 -0
- package/dist/UI/DialogDrawer.d.ts +8 -0
- package/dist/UI/DialogDrawer.js +67 -0
- package/dist/UI/DialogDrawer.less +10 -0
- package/dist/UI/DialogDrawerFooter.d.ts +7 -0
- package/dist/UI/DialogDrawerFooter.js +23 -0
- package/dist/UI/DialogDrawerFooter.less +19 -0
- package/dist/UI/LoadError.d.ts +10 -0
- package/dist/UI/LoadError.js +37 -0
- package/dist/UI/LoadError.less +18 -0
- package/dist/UI/PageContentWarp.d.ts +16 -0
- package/dist/UI/PageContentWarp.js +46 -0
- package/dist/UI/PageContentWarp.less +11 -0
- package/dist/VipCompare/commend.d.ts +7 -0
- package/dist/VipCompare/commend.js +29 -0
- package/dist/VipCompare/commend.less +7 -0
- package/dist/VipCompare/index.d.ts +9 -0
- package/dist/VipCompare/index.js +320 -0
- package/dist/VipCompare/index.less +26 -0
- package/dist/component/product-dict.d.ts +10 -0
- package/dist/component/product-dict.js +11 -0
- package/dist/component/product-type.d.ts +6 -0
- package/dist/component/product-type.js +19 -0
- package/dist/component/websocket/index.d.ts +22 -0
- package/dist/component/websocket/index.js +139 -0
- package/dist/config/apiUrls.d.ts +9 -0
- package/dist/config/apiUrls.js +25 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/lib/Tool.d.ts +201 -0
- package/dist/lib/Tool.js +1086 -0
- package/dist/lib/call-mini-url.d.ts +2 -0
- package/dist/lib/call-mini-url.js +8 -0
- package/dist/lib/getApiUrl.d.ts +5 -0
- package/dist/lib/getApiUrl.js +56 -0
- package/dist/lib/goAuth.d.ts +1 -0
- package/dist/lib/goAuth.js +28 -0
- package/dist/lib/js-error.d.ts +2 -0
- package/dist/lib/js-error.js +27 -0
- package/dist/lib/notification.d.ts +9 -0
- package/dist/lib/notification.js +42 -0
- package/dist/lib/platform.d.ts +12 -0
- package/dist/lib/platform.js +48 -0
- package/dist/lib/postMessage.d.ts +3 -0
- package/dist/lib/postMessage.js +8 -0
- package/dist/lib/request.d.ts +3 -0
- package/dist/lib/request.js +97 -0
- package/dist/service/api/AuthController.d.ts +16 -0
- package/dist/service/api/AuthController.js +75 -0
- package/dist/service/api/JsErrorController.d.ts +5 -0
- package/dist/service/api/JsErrorController.js +27 -0
- package/dist/service/api/ProductController.d.ts +7 -0
- package/dist/service/api/ProductController.js +53 -0
- package/dist/service/api/TradeController.d.ts +7 -0
- package/dist/service/api/TradeController.js +52 -0
- package/dist/service/api/UserController.d.ts +2 -0
- package/dist/service/api/UserController.js +52 -0
- package/dist/service/api/VipController.d.ts +6 -0
- package/dist/service/api/VipController.js +50 -0
- package/dist/service/typing.d.ts +12 -0
- package/dist/typings/Product.d.ts +25 -0
- package/dist/typings/Product.js +0 -0
- package/dist/typings/Trade.d.ts +29 -0
- package/dist/typings/Trade.js +0 -0
- package/dist/typings/User.d.ts +54 -0
- package/dist/typings/User.js +0 -0
- package/dist/typings/Vip.d.ts +15 -0
- package/dist/typings/Vip.js +0 -0
- package/dist/typings.d.ts +66 -0
- package/dist/window.d.ts +9 -0
- package/package.json +88 -0
package/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) i@alone.cat
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
interface Props {
|
3
|
+
defaultLoginType: Global.AuthClientLoginType;
|
4
|
+
wechatDisabled?: boolean;
|
5
|
+
accountDisabled?: boolean;
|
6
|
+
accountRegDisabled?: boolean;
|
7
|
+
onSuccess: () => void;
|
8
|
+
}
|
9
|
+
declare const Auth: React.FC<Props>;
|
10
|
+
export default Auth;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import LoginQr from "./qr";
|
3
|
+
import Tool from "../lib/Tool";
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
+
var Auth = function Auth(_ref) {
|
6
|
+
var defaultLoginType = _ref.defaultLoginType,
|
7
|
+
wechatDisabled = _ref.wechatDisabled,
|
8
|
+
accountDisabled = _ref.accountDisabled,
|
9
|
+
accountRegDisabled = _ref.accountRegDisabled,
|
10
|
+
_ref$onSuccess = _ref.onSuccess,
|
11
|
+
onSuccess = _ref$onSuccess === void 0 ? function () {} : _ref$onSuccess;
|
12
|
+
var onLoginSuccess = function onLoginSuccess() {
|
13
|
+
onSuccess();
|
14
|
+
Tool.pageDialogCloseAll();
|
15
|
+
};
|
16
|
+
return /*#__PURE__*/_jsx(LoginQr, {
|
17
|
+
defaultLoginType: defaultLoginType,
|
18
|
+
wechatDisabled: wechatDisabled,
|
19
|
+
accountDisabled: accountDisabled,
|
20
|
+
accountRegDisabled: accountRegDisabled,
|
21
|
+
onLoginSuccess: onLoginSuccess
|
22
|
+
});
|
23
|
+
};
|
24
|
+
export default Auth;
|
@@ -0,0 +1,62 @@
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
2
|
+
import React, { useState } from 'react';
|
3
|
+
import { Tabs, Radio } from "antd";
|
4
|
+
import { UserAddOutlined, UserOutlined } from "@ant-design/icons";
|
5
|
+
import Reg from "./reg";
|
6
|
+
import "./login-reg.less";
|
7
|
+
import AuthLogin from "./login";
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
9
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
10
|
+
var AuthLoginReg = function AuthLoginReg(_ref) {
|
11
|
+
var _ref$activeKeyDefault = _ref.activeKeyDefault,
|
12
|
+
activeKeyDefault = _ref$activeKeyDefault === void 0 ? 'reg' : _ref$activeKeyDefault,
|
13
|
+
accountRegDisabled = _ref.accountRegDisabled,
|
14
|
+
_ref$onSuccess = _ref.onSuccess,
|
15
|
+
_onSuccess = _ref$onSuccess === void 0 ? function () {} : _ref$onSuccess;
|
16
|
+
var _useState = useState(accountRegDisabled ? 'login' : activeKeyDefault),
|
17
|
+
_useState2 = _slicedToArray(_useState, 2),
|
18
|
+
activeKey = _useState2[0],
|
19
|
+
setActiveKey = _useState2[1];
|
20
|
+
return /*#__PURE__*/_jsxs("div", {
|
21
|
+
className: "loginReg",
|
22
|
+
children: [/*#__PURE__*/_jsx("div", {
|
23
|
+
className: "radioSelectBox",
|
24
|
+
children: /*#__PURE__*/_jsxs(Radio.Group, {
|
25
|
+
onChange: function onChange(keyName) {
|
26
|
+
return setActiveKey(keyName.target.value);
|
27
|
+
},
|
28
|
+
value: activeKey,
|
29
|
+
children: [/*#__PURE__*/_jsxs(Radio.Button, {
|
30
|
+
value: "login",
|
31
|
+
children: [/*#__PURE__*/_jsx(UserOutlined, {}), " \u767B\u5F55"]
|
32
|
+
}), /*#__PURE__*/_jsxs(Radio.Button, {
|
33
|
+
value: "reg",
|
34
|
+
disabled: accountRegDisabled,
|
35
|
+
children: [/*#__PURE__*/_jsx(UserAddOutlined, {}), " \u6CE8\u518C"]
|
36
|
+
})]
|
37
|
+
})
|
38
|
+
}), /*#__PURE__*/_jsxs(Tabs, {
|
39
|
+
activeKey: activeKey,
|
40
|
+
className: "selectTabs",
|
41
|
+
onChange: function onChange(keyName) {
|
42
|
+
setActiveKey(keyName);
|
43
|
+
},
|
44
|
+
children: [/*#__PURE__*/_jsx(Tabs.TabPane, {
|
45
|
+
tab: "\u767B\u5F55",
|
46
|
+
children: /*#__PURE__*/_jsx(AuthLogin, {
|
47
|
+
onSuccess: function onSuccess() {
|
48
|
+
return _onSuccess();
|
49
|
+
}
|
50
|
+
})
|
51
|
+
}, "login"), /*#__PURE__*/_jsx(Tabs.TabPane, {
|
52
|
+
tab: "\u6CE8\u518C",
|
53
|
+
children: /*#__PURE__*/_jsx(Reg, {
|
54
|
+
onSuccess: function onSuccess() {
|
55
|
+
return _onSuccess();
|
56
|
+
}
|
57
|
+
})
|
58
|
+
}, "reg")]
|
59
|
+
})]
|
60
|
+
});
|
61
|
+
};
|
62
|
+
export default AuthLoginReg;
|
@@ -0,0 +1,159 @@
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
5
|
+
import React, { useState } from 'react';
|
6
|
+
import { LockOutlined, UserOutlined, EyeTwoTone, EyeInvisibleOutlined } from '@ant-design/icons';
|
7
|
+
import { Input, Button, Form } from 'antd';
|
8
|
+
import Tool from "../lib/Tool";
|
9
|
+
import { useRequest } from '@umijs/hooks';
|
10
|
+
import "./reg.less";
|
11
|
+
import * as AuthController from "../service/api/AuthController";
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
13
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
14
|
+
var formItemLayout = {
|
15
|
+
labelCol: {
|
16
|
+
xs: {
|
17
|
+
span: 24
|
18
|
+
},
|
19
|
+
sm: {
|
20
|
+
span: 5
|
21
|
+
}
|
22
|
+
},
|
23
|
+
wrapperCol: {
|
24
|
+
xs: {
|
25
|
+
span: 24
|
26
|
+
},
|
27
|
+
sm: {
|
28
|
+
span: 19
|
29
|
+
}
|
30
|
+
}
|
31
|
+
};
|
32
|
+
var tailFormItemLayout = {
|
33
|
+
wrapperCol: {
|
34
|
+
xs: {
|
35
|
+
span: 24,
|
36
|
+
offset: 5
|
37
|
+
},
|
38
|
+
sm: {
|
39
|
+
span: 16,
|
40
|
+
offset: 5
|
41
|
+
}
|
42
|
+
}
|
43
|
+
};
|
44
|
+
var AuthReg = function AuthReg(_ref) {
|
45
|
+
var _ref$onSuccess = _ref.onSuccess,
|
46
|
+
onSuccess = _ref$onSuccess === void 0 ? function () {} : _ref$onSuccess;
|
47
|
+
var _useState = useState(false),
|
48
|
+
_useState2 = _slicedToArray(_useState, 2),
|
49
|
+
formLoading = _useState2[0],
|
50
|
+
setFormLoading = _useState2[1];
|
51
|
+
var _Form$useForm = Form.useForm(),
|
52
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
53
|
+
form = _Form$useForm2[0];
|
54
|
+
var _useRequest = useRequest(function (data) {
|
55
|
+
return AuthController.login(_objectSpread(_objectSpread({}, data), {}, {
|
56
|
+
inviteUserId: Tool.getInviteUserId()
|
57
|
+
}));
|
58
|
+
}, {
|
59
|
+
manual: true,
|
60
|
+
onSuccess: function onSuccess(result) {
|
61
|
+
loginSuccess(result);
|
62
|
+
}
|
63
|
+
}),
|
64
|
+
loading = _useRequest.loading,
|
65
|
+
run = _useRequest.run;
|
66
|
+
var loginSuccess = function loginSuccess(data) {
|
67
|
+
//登入用户名存在本地;
|
68
|
+
Tool.setLocalUserInfo(_objectSpread(_objectSpread({}, data), {}, {
|
69
|
+
isLogin: true
|
70
|
+
}));
|
71
|
+
Tool.toast('登录成功');
|
72
|
+
Tool.event.run('user-info');
|
73
|
+
onSuccess();
|
74
|
+
};
|
75
|
+
var onFinish = /*#__PURE__*/function () {
|
76
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
77
|
+
var values,
|
78
|
+
_args = arguments;
|
79
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
80
|
+
while (1) switch (_context.prev = _context.next) {
|
81
|
+
case 0:
|
82
|
+
values = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
83
|
+
run(values);
|
84
|
+
case 2:
|
85
|
+
case "end":
|
86
|
+
return _context.stop();
|
87
|
+
}
|
88
|
+
}, _callee);
|
89
|
+
}));
|
90
|
+
return function onFinish() {
|
91
|
+
return _ref2.apply(this, arguments);
|
92
|
+
};
|
93
|
+
}();
|
94
|
+
return /*#__PURE__*/_jsx("section", {
|
95
|
+
className: "authClientLogin",
|
96
|
+
children: /*#__PURE__*/_jsxs(Form, {
|
97
|
+
form: form,
|
98
|
+
onFinish: onFinish,
|
99
|
+
disabled: loading,
|
100
|
+
autoComplete: "off",
|
101
|
+
children: [/*#__PURE__*/_jsx(Form.Item, _objectSpread(_objectSpread({
|
102
|
+
label: "\u8D26\u53F7"
|
103
|
+
}, formItemLayout), {}, {
|
104
|
+
name: "accountName",
|
105
|
+
rules: [{
|
106
|
+
required: true,
|
107
|
+
message: '请输入'
|
108
|
+
}
|
109
|
+
// {
|
110
|
+
// pattern: /^([a-z0-9]+[_\-.]?)*[a-z0-9]+@([a-z0-9]+[_\-.]?)*[a-z0-9]+\.[a-z]{2,10}$/i,
|
111
|
+
// message: '这似乎不是一个电子邮箱'
|
112
|
+
// },
|
113
|
+
// {
|
114
|
+
// pattern: /^\s*1\d{10}\s*$/,
|
115
|
+
// message: '这似乎不是大陆手机号?'
|
116
|
+
// }
|
117
|
+
],
|
118
|
+
children: /*#__PURE__*/_jsx(Input, {
|
119
|
+
placeholder: "\u8D26\u53F7",
|
120
|
+
prefix: /*#__PURE__*/_jsx(UserOutlined, {
|
121
|
+
className: "input-prefix-icon"
|
122
|
+
})
|
123
|
+
})
|
124
|
+
})), /*#__PURE__*/_jsx(Form.Item, _objectSpread(_objectSpread({}, formItemLayout), {}, {
|
125
|
+
label: "\u5BC6\u7801",
|
126
|
+
name: "password",
|
127
|
+
rules: [{
|
128
|
+
required: true,
|
129
|
+
message: '请输入密码!'
|
130
|
+
}, {
|
131
|
+
min: 6,
|
132
|
+
message: '密码最短6位哦'
|
133
|
+
}, {
|
134
|
+
max: 60,
|
135
|
+
message: '密码最长60位哦'
|
136
|
+
}],
|
137
|
+
children: /*#__PURE__*/_jsx(Input.Password, {
|
138
|
+
prefix: /*#__PURE__*/_jsx(LockOutlined, {
|
139
|
+
className: "input-prefix-icon"
|
140
|
+
}),
|
141
|
+
type: "password",
|
142
|
+
placeholder: "\u8F93\u5165\u60A8\u7684\u5BC6\u7801",
|
143
|
+
iconRender: function iconRender(visible) {
|
144
|
+
return visible ? /*#__PURE__*/_jsx(EyeTwoTone, {}) : /*#__PURE__*/_jsx(EyeInvisibleOutlined, {});
|
145
|
+
}
|
146
|
+
})
|
147
|
+
})), /*#__PURE__*/_jsx(Form.Item, _objectSpread(_objectSpread({}, tailFormItemLayout), {}, {
|
148
|
+
children: /*#__PURE__*/_jsx(Button, {
|
149
|
+
type: "primary",
|
150
|
+
loading: loading,
|
151
|
+
htmlType: "submit",
|
152
|
+
icon: /*#__PURE__*/_jsx(UserOutlined, {}),
|
153
|
+
children: "\u767B\u5F55"
|
154
|
+
})
|
155
|
+
}))]
|
156
|
+
})
|
157
|
+
});
|
158
|
+
};
|
159
|
+
export default AuthReg;
|
@@ -0,0 +1,52 @@
|
|
1
|
+
.authClientLogin{
|
2
|
+
background: no-repeat left bottom #FFF;
|
3
|
+
background-size: cover;
|
4
|
+
.webTitle{
|
5
|
+
font-weight: normal;
|
6
|
+
font-size: 22px;
|
7
|
+
text-align: right;
|
8
|
+
margin: 0 0 -10px 0;
|
9
|
+
line-height: 1em;
|
10
|
+
span{
|
11
|
+
display: inline-block;
|
12
|
+
padding-left: 5px;
|
13
|
+
font-weight: lighter;
|
14
|
+
font-size: 16px;
|
15
|
+
};
|
16
|
+
}
|
17
|
+
.loginMain{
|
18
|
+
margin: 0 auto 20px;
|
19
|
+
.loginForm{
|
20
|
+
margin: 0 auto;
|
21
|
+
padding:0 0 5px 0 ;
|
22
|
+
background-color: rgba(255, 255, 255, 0.75 );
|
23
|
+
border-radius: 6px;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
.storePass{
|
28
|
+
cursor: pointer;
|
29
|
+
}
|
30
|
+
|
31
|
+
.login-success{
|
32
|
+
position: relative;
|
33
|
+
cursor: pointer;
|
34
|
+
width: 220px;
|
35
|
+
height: 220px;
|
36
|
+
margin: 10px auto; background-color: #EEE; font-size: 40px; color: #999; text-align: center;
|
37
|
+
.anticon{ line-height: 1em; color: #52c41a; }
|
38
|
+
.icon-warp{
|
39
|
+
position: relative; z-index: 10; opacity: 1; margin-top: 70px; width: 80px; height: 80px; padding: 10px; background-color: #FFF; display: inline-block; border-radius: 100px; }
|
40
|
+
}
|
41
|
+
|
42
|
+
.otherInfo{
|
43
|
+
position: relative;
|
44
|
+
.forgetPass{
|
45
|
+
position: absolute;
|
46
|
+
right: 0;
|
47
|
+
top: 0;
|
48
|
+
padding: 6px 0 0 0;
|
49
|
+
font-size: 13px;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import './index.less';
|
3
|
+
interface Props {
|
4
|
+
defaultLoginType: Global.AuthClientLoginType;
|
5
|
+
wechatDisabled?: boolean;
|
6
|
+
accountDisabled?: boolean;
|
7
|
+
accountHidden?: boolean;
|
8
|
+
accountRegDisabled?: boolean;
|
9
|
+
alipayDisabled?: boolean;
|
10
|
+
onLoginSuccess: () => void;
|
11
|
+
}
|
12
|
+
declare const LoginQr: React.FC<Props>;
|
13
|
+
export default LoginQr;
|