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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kn-cli",
3
- "version": "1.0.49",
3
+ "version": "1.0.51",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -69,6 +69,9 @@ module.exports = {
69
69
  ```
70
70
 
71
71
  # 更新日志
72
+ * 1.0.50
73
+ 增加官网模板
74
+
72
75
  * 1.0.49
73
76
  更新app和admin模板,主要是编写了使用案例
74
77
 
package/src/create.js CHANGED
@@ -23,7 +23,7 @@ module.exports=async ()=> {
23
23
  choices:[
24
24
  '移动端APP',
25
25
  'pc管理系统',
26
- // 'pc官网(未开放)',
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
- p,div,section,hgroup
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;
@@ -53,7 +53,7 @@ const Page = () => {
53
53
  request.reset();
54
54
  }
55
55
  return (
56
- <section>
56
+ <section className='wrap-space'>
57
57
  <section style={{display:'flex'}}>
58
58
  <Form form={form} >
59
59
  <Form.Item name='keywords' label='关键字'>
@@ -44,7 +44,7 @@ const Page = () => {
44
44
  request.update({pagination:{current,pageSize}})
45
45
  }
46
46
  return (
47
- <section>
47
+ <section className='wrap-space'>
48
48
  <Table
49
49
  rowKey={'id'}
50
50
  loading={!request?.data?.length>0}
@@ -47,7 +47,7 @@ export const RouteList = (
47
47
  path='/'
48
48
  element={
49
49
  <ProviderMenu.Provider>
50
- <LayoutBasic nav={<LeftMenu />}topMenu={<TopMenu />} />
50
+ <AuthLogin><LayoutBasic nav={<LeftMenu />}topMenu={<TopMenu />} /></AuthLogin>
51
51
  </ProviderMenu.Provider>
52
52
  }
53
53
  >
@@ -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
+ };