kn-cli 1.0.49 → 1.0.51
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.
- package/package.json +1 -1
- package/readme.md +3 -0
- package/src/create.js +2 -1
- package/templates/template_admin/public/src/_reset.less +13 -8
- package/templates/template_admin/public/src/components/TopMenu/index.jsx +0 -5
- package/templates/template_admin/public/src/pages/material/index.jsx +1 -1
- package/templates/template_admin/public/src/pages/video/index.jsx +1 -1
- package/templates/template_admin/public/src/route.jsx +1 -1
- package/templates/template_admin/public/src/utils/index.js +28 -0
- package/templates/template_app/public/src/utils/index.js +27 -0
package/package.json
CHANGED
package/readme.md
CHANGED
package/src/create.js
CHANGED
|
@@ -23,7 +23,7 @@ module.exports=async ()=> {
|
|
|
23
23
|
choices:[
|
|
24
24
|
'移动端APP',
|
|
25
25
|
'pc管理系统',
|
|
26
|
-
|
|
26
|
+
'官网',
|
|
27
27
|
// '移动端H5活动(未开放)',
|
|
28
28
|
// 'pc官网(未开放)',
|
|
29
29
|
// 'pc管理系统',
|
|
@@ -36,6 +36,7 @@ module.exports=async ()=> {
|
|
|
36
36
|
switch(answer.type){
|
|
37
37
|
case '移动端APP':{templateName='template_app'}break;
|
|
38
38
|
case 'pc管理系统':{templateName='template_admin'}break;
|
|
39
|
+
case '官网':{templateName='template_offcial'}break;
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
|
|
@@ -64,7 +64,7 @@ a,div,p,span,section,hgroup{
|
|
|
64
64
|
|
|
65
65
|
* {
|
|
66
66
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
67
|
-
position: relative;
|
|
67
|
+
// position: relative;
|
|
68
68
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
69
69
|
-webkit-text-size-adjust: none;
|
|
70
70
|
-webkit-box-sizing: border-box;
|
|
@@ -117,12 +117,17 @@ a,div,p,span,section,hgroup{
|
|
|
117
117
|
-webkit-overflow-scrolling: touch;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
p,div,section,hgroup
|
|
121
|
+
{
|
|
122
|
+
&[data-text-break]{
|
|
123
|
+
white-space: pre-wrap;
|
|
124
|
+
word-break:break-all;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
121
127
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
&[data-text-break]{
|
|
125
|
-
white-space: pre-wrap;
|
|
126
|
-
word-break:break-all;
|
|
128
|
+
.wrap-space{
|
|
129
|
+
padding:var(--padding-small)
|
|
127
130
|
}
|
|
128
|
-
|
|
131
|
+
|
|
132
|
+
}
|
|
133
|
+
|
|
@@ -111,11 +111,6 @@ const TopMenu=(props)=>{
|
|
|
111
111
|
return req;
|
|
112
112
|
}
|
|
113
113
|
const loadMenu=async ()=>{
|
|
114
|
-
const isLogin= await app.isLogin();
|
|
115
|
-
if(!isLogin){
|
|
116
|
-
navigate('/superAdminLogin')
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
114
|
let reqMenu = await GET_MENU();
|
|
120
115
|
if(reqMenu?.code==0){
|
|
121
116
|
let originMenu= reqMenu.data;
|
|
@@ -19,6 +19,22 @@ export const isMobile = () => {
|
|
|
19
19
|
)
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
export const toHref = (url, replace, newWindow) => {
|
|
23
|
+
if(window.knFeishu){
|
|
24
|
+
window.knFeishu.ToHref(url,replace,newWindow);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (newWindow) {
|
|
28
|
+
window.open(url);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (replace) {
|
|
32
|
+
location.replace(url);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
location.href = url;
|
|
36
|
+
};
|
|
37
|
+
|
|
22
38
|
export const jumpUrl=(url,options={})=>{
|
|
23
39
|
const {replace,newWindow,reload}= options;
|
|
24
40
|
if(reload){
|
|
@@ -36,3 +52,15 @@ export const jumpUrl=(url,options={})=>{
|
|
|
36
52
|
location.href=url;
|
|
37
53
|
|
|
38
54
|
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
// 关闭页面
|
|
58
|
+
export const closeWindow = () => {
|
|
59
|
+
if (window.knFeishu && window.knFeishu.closeWindow) {
|
|
60
|
+
window.knFeishu.closeWindow();
|
|
61
|
+
} else {
|
|
62
|
+
if (window.close) {
|
|
63
|
+
window.close();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
@@ -13,9 +13,36 @@ export const openLink = (link, target = '_blank') => {
|
|
|
13
13
|
}, 200);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
|
|
17
|
+
export const toHref = (url, replace, newWindow) => {
|
|
18
|
+
if(window.knFeishu){
|
|
19
|
+
window.knFeishu.ToHref(url,replace,newWindow);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (newWindow) {
|
|
23
|
+
window.open(url);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (replace) {
|
|
27
|
+
location.replace(url);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
location.href = url;
|
|
31
|
+
};
|
|
32
|
+
|
|
16
33
|
export const isMobile = () => {
|
|
17
34
|
return navigator.userAgent.match(
|
|
18
35
|
/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
|
|
19
36
|
)
|
|
20
37
|
}
|
|
21
38
|
|
|
39
|
+
// 关闭页面
|
|
40
|
+
export const closeWindow = () => {
|
|
41
|
+
if (window.knFeishu && window.knFeishu.closeWindow) {
|
|
42
|
+
window.knFeishu.closeWindow();
|
|
43
|
+
} else {
|
|
44
|
+
if (window.close) {
|
|
45
|
+
window.close();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|