kn-cli 1.0.90 → 1.0.91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/package.json +1 -1
  2. package/readme.md +4 -0
  3. package/src/create.js +22 -2
  4. package/src/utils/index.js +1 -1
  5. package/templates/template_admin/cli.config.js +1 -1
  6. package/templates/template_admin/jsconfig.json +5 -1
  7. package/templates/template_admin/package.json +1 -1
  8. package/templates/template_admin/public/index.html +2 -2
  9. package/templates/template_admin/public/src/components/{Auth → auth}/index.jsx +21 -3
  10. package/templates/template_admin/public/src/components/{IconFont → iconFont}/index.jsx +10 -0
  11. package/templates/template_admin/public/src/components/{Layout/Basic → layout/basic}/index.jsx +13 -3
  12. package/templates/template_admin/public/src/components/layout/centerBody/index.jsx +25 -0
  13. package/templates/template_admin/public/src/components/{Layout → layout}/index.jsx +15 -6
  14. package/templates/{template_offcial/public/src/components/Layout/Provider → template_admin/public/src/components/layout/provider}/index.jsx +8 -1
  15. package/templates/{template_app/public/src/components/Link → template_admin/public/src/components/link}/index.jsx +15 -0
  16. package/templates/template_admin/public/src/components/{Menu → menu}/index.jsx +15 -8
  17. package/templates/template_admin/public/src/components/{Page/PageLoading → page/pageLoading}/index.jsx +25 -4
  18. package/templates/template_admin/public/src/components/{Popup → popup}/index.jsx +13 -0
  19. package/templates/{template_app/public/src/components/Toast → template_admin/public/src/components/toast}/index.jsx +20 -1
  20. package/templates/template_admin/public/src/components/{TopMenu → topMenu}/index.jsx +13 -8
  21. package/templates/template_admin/public/src/dictionary/index.js +8 -3
  22. package/templates/template_admin/public/src/hooks/index.jsx +1 -0
  23. package/templates/template_admin/public/src/hooks/useDelay.jsx +5 -0
  24. package/templates/template_admin/public/src/hooks/useImageLoader.jsx +1 -2
  25. package/templates/template_admin/public/src/hooks/useLoading.jsx +5 -1
  26. package/templates/template_admin/public/src/hooks/usePreload.jsx +2 -1
  27. package/templates/template_admin/public/src/hooks/useScrollTop.jsx +12 -0
  28. package/templates/template_admin/public/src/hooks/useSearch.jsx +28 -2
  29. package/templates/template_admin/public/src/hooks/useUpdate.jsx +5 -0
  30. package/templates/template_admin/public/src/index.jsx +16 -2
  31. package/templates/template_admin/public/src/pages/material/index.jsx +2 -1
  32. package/templates/template_admin/public/src/pages/user/index.jsx +7 -2
  33. package/templates/template_admin/public/src/provider/app.jsx +39 -4
  34. package/templates/template_admin/public/src/provider/menu.jsx +4 -1
  35. package/templates/template_admin/public/src/route.jsx +8 -5
  36. package/templates/template_admin/public/src/services/index.js +38 -4
  37. package/templates/template_admin/public/src/services/user.js +3 -3
  38. package/templates/template_admin/public/src/type.js +48 -0
  39. package/templates/template_admin/public/src/utils/index.js +34 -18
  40. package/templates/template_app/cli.config.js +1 -1
  41. package/templates/template_app/jsconfig.json +5 -1
  42. package/templates/template_app/package.json +1 -1
  43. package/templates/template_app/public/src/components/{Auth → auth}/index.jsx +20 -2
  44. package/templates/template_app/public/src/components/{Header → header}/index.jsx +25 -1
  45. package/templates/template_app/public/src/components/{IconFont → iconFont}/index.jsx +10 -0
  46. package/templates/template_app/public/src/components/{Layout/App → layout/app}/index.jsx +12 -2
  47. package/templates/template_app/public/src/components/layout/index.jsx +6 -0
  48. package/templates/{template_admin/public/src/components/Layout/Provider → template_app/public/src/components/layout/provider}/index.jsx +3 -0
  49. package/templates/template_app/public/src/components/link/index.jsx +39 -0
  50. package/templates/template_app/public/src/components/{Marquee → marquee}/index.jsx +11 -2
  51. package/templates/template_app/public/src/components/{Page/PageLoading → page/pageLoading}/index.jsx +23 -3
  52. package/templates/template_app/public/src/components/{Popup → popup}/index.jsx +13 -0
  53. package/templates/{template_offcial/public/src/components/Toast → template_app/public/src/components/toast}/index.jsx +21 -1
  54. package/templates/template_app/public/src/dictionary/index.js +7 -3
  55. package/templates/template_app/public/src/hooks/index.jsx +1 -0
  56. package/templates/template_app/public/src/hooks/useDelay.jsx +5 -0
  57. package/templates/template_app/public/src/hooks/useImageLoader.jsx +1 -2
  58. package/templates/template_app/public/src/hooks/useLoading.jsx +5 -1
  59. package/templates/template_app/public/src/hooks/usePreload.jsx +2 -1
  60. package/templates/template_app/public/src/hooks/useScrollTop.jsx +12 -0
  61. package/templates/template_app/public/src/index.jsx +22 -5
  62. package/templates/template_app/public/src/pages/dictionary/index.jsx +9 -1
  63. package/templates/template_app/public/src/pages/index.jsx +16 -4
  64. package/templates/template_app/public/src/pages/list/index.jsx +7 -1
  65. package/templates/template_app/public/src/pages/login/index.jsx +10 -4
  66. package/templates/template_app/public/src/pages/user/index.jsx +7 -2
  67. package/templates/template_app/public/src/provider/app.jsx +5 -3
  68. package/templates/template_app/public/src/route.jsx +5 -2
  69. package/templates/template_app/public/src/services/index.js +10 -8
  70. package/templates/template_app/public/src/services/user.js +4 -4
  71. package/templates/template_app/public/src/type.js +27 -0
  72. package/templates/template_app/public/src/utils/index.js +6 -0
  73. package/templates/template_oa/cli.config.js +1 -1
  74. package/templates/template_oa/package.json +1 -1
  75. package/templates/template_oa_jwt/cli.config.js +1 -1
  76. package/templates/template_oa_jwt/package.json +1 -1
  77. package/templates/template_offcial/cli.config.js +1 -1
  78. package/templates/template_offcial/jsconfig.json +5 -1
  79. package/templates/template_offcial/package.json +1 -1
  80. package/templates/template_offcial/public/src/components/{Footer → footer}/index.jsx +15 -1
  81. package/templates/template_offcial/public/src/components/{Header → header}/index.jsx +14 -0
  82. package/templates/template_offcial/public/src/components/{IconFont → iconFont}/index.jsx +10 -0
  83. package/templates/template_offcial/public/src/components/{Layout → layout}/index.jsx +10 -3
  84. package/templates/{template_app/public/src/components/Layout/Provider → template_offcial/public/src/components/layout/provider}/index.jsx +7 -0
  85. package/templates/template_offcial/public/src/components/link/index.jsx +39 -0
  86. package/templates/template_offcial/public/src/components/{Page/PageLoading → page/pageLoading}/index.jsx +25 -4
  87. package/templates/template_offcial/public/src/components/{Popup → popup}/index.jsx +13 -0
  88. package/templates/{template_admin/public/src/components/Toast → template_offcial/public/src/components/toast}/index.jsx +20 -1
  89. package/templates/template_offcial/public/src/hooks/index.jsx +1 -0
  90. package/templates/template_offcial/public/src/hooks/useImageLoader.jsx +1 -0
  91. package/templates/template_offcial/public/src/hooks/useInToView.jsx +3 -0
  92. package/templates/template_offcial/public/src/hooks/usePreload.jsx +1 -0
  93. package/templates/template_offcial/public/src/hooks/useScroll.jsx +8 -0
  94. package/templates/template_offcial/public/src/index.jsx +15 -2
  95. package/templates/template_offcial/public/src/pages/index.jsx +8 -1
  96. package/templates/template_offcial/public/src/pages/pc/index.jsx +4 -2
  97. package/templates/template_offcial/public/src/provider/app.jsx +28 -2
  98. package/templates/template_offcial/public/src/route.jsx +4 -2
  99. package/templates/template_offcial/public/src/services/index.js +38 -2
  100. package/templates/template_offcial/public/src/services/user.js +3 -3
  101. package/templates/template_offcial/public/src/type.js +47 -0
  102. package/src/.DS_Store +0 -0
  103. package/templates/template_admin/.gitignore +0 -6
  104. package/templates/template_admin/public/src/components/Alert/index.jsx +0 -0
  105. package/templates/template_admin/public/src/components/Alert/index.less +0 -0
  106. package/templates/template_admin/public/src/components/Header/index.jsx +0 -57
  107. package/templates/template_admin/public/src/components/Layout/CenterBody/index.jsx +0 -15
  108. package/templates/template_admin/public/src/components/Link/index.jsx +0 -24
  109. package/templates/template_admin/public/src/components/Loading/index.jsx +0 -14
  110. package/templates/template_admin/public/src/components/Loading/index.less +0 -85
  111. package/templates/template_admin/public/src/components/mask/index.jsx +0 -47
  112. package/templates/template_admin/public/src/components/mask/index.less +0 -32
  113. package/templates/template_admin/public/src/hooks/useLogin.jsx +0 -33
  114. package/templates/template_app/.gitignore +0 -6
  115. package/templates/template_app/public/src/components/Header/index.less +0 -57
  116. package/templates/template_app/public/src/components/Layout/index.jsx +0 -4
  117. package/templates/template_app/public/src/hooks/useLogin.jsx +0 -33
  118. package/templates/template_oa/.gitignore +0 -6
  119. package/templates/template_oa_jwt/.gitignore +0 -6
  120. package/templates/template_offcial/.gitignore +0 -6
  121. package/templates/template_offcial/public/src/components/Alert/index.jsx +0 -0
  122. package/templates/template_offcial/public/src/components/Alert/index.less +0 -0
  123. package/templates/template_offcial/public/src/components/Link/index.jsx +0 -24
  124. /package/templates/template_admin/public/src/components/{IconFont → iconFont}/index.less +0 -0
  125. /package/templates/template_admin/public/src/components/{Layout/Basic → layout/basic}/index.less +0 -0
  126. /package/templates/template_admin/public/src/components/{Layout/CenterBody → layout/centerBody}/index.less +0 -0
  127. /package/templates/template_admin/public/src/components/{Layout → layout}/index.less +0 -0
  128. /package/templates/template_admin/public/src/components/{Link → link}/index.less +0 -0
  129. /package/templates/template_admin/public/src/components/{Menu → menu}/index.less +0 -0
  130. /package/templates/template_admin/public/src/components/{Page/PageLoading → page/pageLoading}/index.less +0 -0
  131. /package/templates/template_admin/public/src/components/{Popup → popup}/index.less +0 -0
  132. /package/templates/template_admin/public/src/components/{Toast → toast}/index.less +0 -0
  133. /package/templates/template_admin/public/src/components/{TopMenu → topMenu}/index.less +0 -0
  134. /package/templates/{template_admin/public/src/components/Header → template_app/public/src/components/header}/index.less +0 -0
  135. /package/templates/template_app/public/src/components/{IconFont → iconFont}/index.less +0 -0
  136. /package/templates/template_app/public/src/components/{Layout/App → layout/app}/index.less +0 -0
  137. /package/templates/template_app/public/src/components/{Link → link}/index.less +0 -0
  138. /package/templates/template_app/public/src/components/{Marquee → marquee}/index.less +0 -0
  139. /package/templates/template_app/public/src/components/{Page/PageLoading → page/pageLoading}/index.less +0 -0
  140. /package/templates/template_app/public/src/components/{Popup → popup}/index.less +0 -0
  141. /package/templates/template_app/public/src/components/{Toast → toast}/index.less +0 -0
  142. /package/templates/template_offcial/public/src/components/{Footer → footer}/index.less +0 -0
  143. /package/templates/template_offcial/public/src/components/{Header → header}/index.less +0 -0
  144. /package/templates/template_offcial/public/src/components/{IconFont → iconFont}/index.less +0 -0
  145. /package/templates/template_offcial/public/src/components/{Layout → layout}/index.less +0 -0
  146. /package/templates/template_offcial/public/src/components/{Link → link}/index.less +0 -0
  147. /package/templates/template_offcial/public/src/components/{Page/PageLoading → page/pageLoading}/index.less +0 -0
  148. /package/templates/template_offcial/public/src/components/{Popup → popup}/index.less +0 -0
  149. /package/templates/template_offcial/public/src/components/{Toast → toast}/index.less +0 -0
@@ -1,16 +1,16 @@
1
- import {GET_DEFAULT,PUT_DEFAULT,POST_DEFAULT,API_ROOT} from './index.js';
1
+ import {GET_DEFAULT,POST_DEFAULT,API_ROOT} from './index.js';
2
2
 
3
3
 
4
4
 
5
5
  export function GET_USER(){
6
- return GET_DEFAULT(`${HOST}/user`);
6
+ return GET_DEFAULT(`${API_ROOT}/user`);
7
7
  }
8
8
 
9
9
  export function SET_USER(params={
10
10
  name:'',
11
11
  age:''
12
12
  }){
13
- return POST_DEFAULT(`${HOST}/user`,params)
13
+ return POST_DEFAULT(`${API_ROOT}/user`,params)
14
14
  }
15
15
 
16
16
 
@@ -0,0 +1,47 @@
1
+
2
+ /**
3
+ * 可自行扩展任意数量的属性
4
+ * @typedef {Object<string, any>} OtherAny
5
+ */
6
+
7
+ /**
8
+ * 指向DOM节点的ref
9
+ * @typedef {object} RefDomElement
10
+ * @property {HTMLElement} current - DOM节点
11
+ */
12
+
13
+
14
+
15
+ /**
16
+ * @typedef {object} FormDataInfo
17
+ * @property {string} btnControl
18
+ */
19
+
20
+ /**
21
+ * @typedef {[FormDataInfo,Function]} UseStateFormData
22
+ */
23
+
24
+
25
+ /**
26
+ * @typedef {FormDataInfo & OtherAny} TableContentData
27
+ */
28
+
29
+
30
+ /**
31
+ * 分页
32
+ * @typedef {object} Pagination
33
+ * @property {number} current - 当前页码,1~N
34
+ * @property {number} pageSize=10 - 分页大小
35
+ * @property {number} total - 总记录条数
36
+ * @property {number} startIdx - 当前页面第一条的数据索引起始值
37
+ *
38
+ */
39
+
40
+
41
+ /**
42
+ * 接口response数据
43
+ * @typedef {object} ServicesResponse
44
+ * @property {number} code - 接口处理结果,0为成功
45
+ * @property {object} data - 接口返回的数据
46
+ *
47
+ */
package/src/.DS_Store DELETED
Binary file
@@ -1,6 +0,0 @@
1
- **/node_modules
2
- **/package-lock.json
3
- **/.DS_Store
4
- **/dist
5
- **/release
6
-
@@ -1,57 +0,0 @@
1
- import React, { useEffect } from 'react';
2
- import IconFont from '../IconFont';
3
- import styles from './index.less';
4
-
5
- const Header=(props)=>{
6
- const {
7
- visible=true,
8
- className='',
9
- title='标题',
10
- subTitle='',
11
- leftLabel='',
12
- rightLabel='',
13
- left=<IconFont className={styles.leftIcon} icon='arrowBack' />,
14
- right='',
15
- syncDocumentTitle=false
16
- } = props;
17
-
18
- // 同步更新网页标题
19
- useEffect(()=>{
20
- if(syncDocumentTitle){
21
- document.title= title;
22
- }
23
- },[title])
24
- const onLeft=()=>{
25
- window.history.back();
26
- }
27
- const onLeftLabel=()=>{
28
- if(props.onLeftLabel){props.onLeftLabel()}
29
- }
30
- const onRight=()=>{
31
- if(props.onRight){props.onRight()}
32
- }
33
- const onRightLabel=()=>{
34
- if(props.onRightLabel){props.onRightLabel()}
35
- }
36
- const onTitle=()=>{
37
- if(props.onTitle){props.onTitle()}
38
- }
39
- return (
40
- <section className={`${styles.header} ${className}`} data-visible={visible}>
41
- <hgroup className={styles.group}>
42
- {left&&(<section className={styles.left} onClick={onLeft}>{left}</section>)}
43
- {leftLabel&&<span className={styles.leftLabel} onClick={onLeftLabel}>{leftLabel}</span>}
44
- </hgroup>
45
- <section className={styles.center}>
46
- {title&&<span onClick={onTitle}>{title}</span>}
47
- {subTitle&&<span>{subTitle}</span>}
48
- </section>
49
- <hgroup className={styles.group}>
50
- {rightLabel&&<span className={styles.rightLabel} onClick={onRightLabel}>{rightLabel}</span>}
51
- {right&&(<section className={styles.right} onClick={onRight}>{right}</section>)}
52
- </hgroup>
53
-
54
- </section>
55
- )
56
- }
57
- export default Header;
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
-
3
- import styles from './index.less';
4
-
5
-
6
- const LayoutCenterBody=(props)=>{
7
- const {className,layout='normal'} = props;
8
-
9
- return (
10
- <section data-layout={layout} className={ className?`${styles.contentBody} ${className}`:styles.contentBody }>
11
- {props.children}
12
- </section>
13
- )
14
- }
15
- export default LayoutCenterBody;
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
- import { openLink,jumpUrl } from '@/utils';
3
- import styles from './index.less';
4
-
5
- const Link=(props)=>{
6
- const {children,className='',onClick,href='',target=''} = props;
7
-
8
- const onLink=()=>{
9
- if(href){
10
- if(target=='_blank'){
11
- openLink(href);
12
- // window.open(href);
13
- }else{
14
- jumpUrl(href);
15
- }
16
- return;
17
- }
18
- if(onClick)onClick();
19
- }
20
- return (
21
- <span onClick={onLink} className={`${styles.linkWrap} ${className}`}>{children}</span>
22
- )
23
- }
24
- export default React.memo(Link);
@@ -1,14 +0,0 @@
1
-
2
-
3
- import React,{useMemo} from 'react';
4
- import styles from './index.less';
5
- styles;
6
- export const Loading=()=>{
7
- return (
8
- <div className="ldio-2oha7mxue8v">
9
- <div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
10
- </div>
11
- )
12
- }
13
-
14
- export default React.memo(Loading);
@@ -1,85 +0,0 @@
1
-
2
- :global{
3
- @color:#fff;
4
- @keyframes ldio-2oha7mxue8v {
5
- 0% { opacity: 1 }
6
- 100% { opacity: 0 }
7
- }
8
- .ldio-2oha7mxue8v div:local {
9
- left:0px;
10
- top:0px;
11
- position: absolute;
12
- animation: ldio-2oha7mxue8v linear 1s infinite;
13
- background: @color;
14
- width: 12px;
15
- height: 24px;
16
- border-radius: 6px / 12px;
17
- transform-origin: 40px 40px;
18
- }
19
- .ldio-2oha7mxue8v div:nth-child(1) {
20
- transform: rotate(0deg);
21
- animation-delay: -0.9166666666666666s;
22
- background: @color;
23
- }.ldio-2oha7mxue8v div:nth-child(2) {
24
- transform: rotate(30deg);
25
- animation-delay: -0.8333333333333334s;
26
- background: @color;
27
- }.ldio-2oha7mxue8v div:nth-child(3) {
28
- transform: rotate(60deg);
29
- animation-delay: -0.75s;
30
- background: @color;
31
- }.ldio-2oha7mxue8v div:nth-child(4) {
32
- transform: rotate(90deg);
33
- animation-delay: -0.6666666666666666s;
34
- background: @color;
35
- }.ldio-2oha7mxue8v div:nth-child(5) {
36
- transform: rotate(120deg);
37
- animation-delay: -0.5833333333333334s;
38
- background: @color;
39
- }.ldio-2oha7mxue8v div:nth-child(6) {
40
- transform: rotate(150deg);
41
- animation-delay: -0.5s;
42
- background: @color;
43
- }.ldio-2oha7mxue8v div:nth-child(7) {
44
- transform: rotate(180deg);
45
- animation-delay: -0.4166666666666667s;
46
- background: @color;
47
- }.ldio-2oha7mxue8v div:nth-child(8) {
48
- transform: rotate(210deg);
49
- animation-delay: -0.3333333333333333s;
50
- background: @color;
51
- }.ldio-2oha7mxue8v div:nth-child(9) {
52
- transform: rotate(240deg);
53
- animation-delay: -0.25s;
54
- background: @color;
55
- }.ldio-2oha7mxue8v div:nth-child(10) {
56
- transform: rotate(270deg);
57
- animation-delay: -0.16666666666666666s;
58
- background: @color;
59
- }.ldio-2oha7mxue8v div:nth-child(11) {
60
- transform: rotate(300deg);
61
- animation-delay: -0.08333333333333333s;
62
- background: @color;
63
- }.ldio-2oha7mxue8v div:nth-child(12) {
64
- transform: rotate(330deg);
65
- animation-delay: 0s;
66
- background: @color;
67
- }
68
- .loadingio-spinner-spinner-vviroavveu {
69
- width: 200px;
70
- height: 200px;
71
- display: inline-block;
72
- overflow: hidden;
73
- background: transparent;
74
- }
75
- .ldio-2oha7mxue8v {
76
- width: 80px;
77
- height: 80px;
78
- position: relative;
79
- transform: translateZ(0) scale(1);
80
- backface-visibility: hidden;
81
- transform-origin: 0 0; /* see note above */
82
- }
83
- .ldio-2oha7mxue8v div { box-sizing: content-box; }
84
- /* generated by https://loading.io/ */
85
- }
@@ -1,47 +0,0 @@
1
- import React, { useEffect, useRef } from 'react';
2
- import ReactDOM from 'react-dom';
3
- import styles from './index.less';
4
- import Popup from '@/components/Popup/index.jsx';
5
-
6
-
7
- const useToast = () => {
8
-
9
- const ref = useRef();
10
-
11
- const runNext = (props) => {
12
- console.log(props.popup.dom);
13
- ReactDOM.render(
14
- <Toast {...props} />,
15
- props.popup.dom
16
- );
17
- }
18
-
19
- const Toast = ({ children }) => {
20
- return (
21
- <section className={styles.wrap}>
22
- <div className={styles.content + ` animate__animated animate__fast`}>
23
- {children}
24
- </div>
25
- </section>
26
- )
27
- }
28
-
29
- const hiddenToast = () => {
30
- ref.current.destory();
31
- }
32
- const showToast = props => {
33
- props = { children: props }
34
- return new Promise((resolve) => {
35
- let popup = Popup(resolve);
36
- ref.current = popup;
37
- props.popup = popup;
38
- runNext(props);
39
- });
40
- }
41
- return {
42
- showToast, hiddenToast
43
- }
44
-
45
- }
46
-
47
- export default useToast;
@@ -1,32 +0,0 @@
1
- @import '~@/_variable.less';
2
-
3
- .wrap{
4
- position: fixed;
5
- left:0;
6
- top:0;
7
- width:100vw;
8
- height:100vh;
9
- display: flex;
10
- justify-content: center;
11
- align-items: center;
12
- flex-direction: column;
13
- z-index: 1000;
14
- .content{
15
- position: fixed;
16
- left:0;
17
- top:0;
18
- width:100vw;
19
- height:100vh;
20
-
21
- background: rgba(0,0,0,.8);
22
- padding:var(--padding-default);
23
-
24
- display: flex;
25
- flex-direction: column;
26
- justify-content: center;
27
- align-items: center;
28
-
29
- font-size: 14px;
30
- color: #FFFFFF;
31
- }
32
- }
@@ -1,33 +0,0 @@
1
-
2
-
3
- import React, { useEffect, useState, useRef } from 'react';
4
- import {IS_LOGIN,SET_TOKEN,LOGIN} from '@/services/wish';
5
- import ShowLogin from '@/pages/components/dialog/alert/login';
6
-
7
-
8
- const useLogin=(props)=>{
9
- const [isLogin,setLogin] = useState(IS_LOGIN());
10
-
11
- const login=async ()=>{
12
- if(IS_LOGIN()){
13
- setLogin(true);
14
- return true;
15
- }else{
16
- setLogin(false);
17
- const phone = await ShowLogin();
18
- if(phone){
19
- const loginReq = await LOGIN({phone});
20
- if(loginReq?.code==0){
21
- SET_TOKEN(loginReq.data.api_token);
22
- setLogin(IS_LOGIN());
23
- return true;
24
- }
25
- }
26
- }
27
- return false;
28
- }
29
-
30
- return {login,isLogin}
31
- }
32
-
33
- export default useLogin;
@@ -1,6 +0,0 @@
1
- **/node_modules
2
- **/package-lock.json
3
- **/.DS_Store
4
- **/dist
5
- **/release
6
-
@@ -1,57 +0,0 @@
1
- @import '~@/_variable.less';
2
-
3
-
4
- .header{
5
- z-index: 1;
6
- height:var(--height-header);
7
- background-color: white;
8
- width:100%;
9
- display: flex;
10
- align-items: center;
11
- box-shadow: 0 0 2px 0 #ccc;
12
- padding: 0 var(--padding-default);
13
- &[data-visible='false']{
14
- display: none;
15
- }
16
- .group{
17
- display: flex;
18
- align-items: center;
19
- height:100%;
20
- min-width: 1px;
21
- }
22
- .right,
23
- .left{
24
- display: flex;
25
- align-items: center;
26
- font-size: 24px;
27
- .rightIcon,
28
- .leftIcon{
29
- margin-top: 6px;
30
- }
31
- }
32
- .rightLabel,
33
- .leftLabel{
34
- &:not(:first-child){
35
- margin-left:var(--padding-small)
36
- }
37
- }
38
-
39
- .center{
40
- flex:1;
41
- height:100%;
42
- display: flex;
43
- flex-direction: column;
44
- align-items: center;
45
- justify-content: center;
46
- color:var(--color-text);
47
- span:nth-child(1){
48
- font-size: 16px;
49
- color:inherit;
50
- }
51
- span:nth-child(2){
52
- font-size: 12px;
53
- color:inherit;
54
- }
55
- }
56
- }
57
-
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import LayoutApp from './App';
3
- import LayoutProvider from './Provider';
4
- export { LayoutApp ,LayoutProvider};
@@ -1,33 +0,0 @@
1
-
2
-
3
- import React, { useEffect, useState, useRef } from 'react';
4
- import {IS_LOGIN,SET_TOKEN,LOGIN} from '@/services/wish';
5
- import ShowLogin from '@/pages/components/dialog/alert/login';
6
-
7
-
8
- const useLogin=(props)=>{
9
- const [isLogin,setLogin] = useState(IS_LOGIN());
10
-
11
- const login=async ()=>{
12
- if(IS_LOGIN()){
13
- setLogin(true);
14
- return true;
15
- }else{
16
- setLogin(false);
17
- const phone = await ShowLogin();
18
- if(phone){
19
- const loginReq = await LOGIN({phone});
20
- if(loginReq?.code==0){
21
- SET_TOKEN(loginReq.data.api_token);
22
- setLogin(IS_LOGIN());
23
- return true;
24
- }
25
- }
26
- }
27
- return false;
28
- }
29
-
30
- return {login,isLogin}
31
- }
32
-
33
- export default useLogin;
@@ -1,6 +0,0 @@
1
- **/node_modules
2
- **/package-lock.json
3
- **/.DS_Store
4
- **/dist
5
- **/release
6
-
@@ -1,6 +0,0 @@
1
- **/node_modules
2
- **/package-lock.json
3
- **/.DS_Store
4
- **/dist
5
- **/release
6
-
@@ -1,6 +0,0 @@
1
- **/node_modules
2
- **/package-lock.json
3
- **/.DS_Store
4
- **/dist
5
- **/release
6
-
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
- import { openLink,jumpUrl } from '@/utils';
3
- import styles from './index.less';
4
-
5
- const Link=(props)=>{
6
- const {children,className='',onClick,href='',target=''} = props;
7
-
8
- const onLink=()=>{
9
- if(href){
10
- if(target=='_blank'){
11
- openLink(href);
12
- // window.open(href);
13
- }else{
14
- jumpUrl(href);
15
- }
16
- return;
17
- }
18
- if(onClick)onClick();
19
- }
20
- return (
21
- <span onClick={onLink} className={`${styles.linkWrap} ${className}`}>{children}</span>
22
- )
23
- }
24
- export default React.memo(Link);