w-web-api 1.0.27 → 1.0.29

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 (42) hide show
  1. package/README.md +23 -16
  2. package/dist/css/app.d38a4241.css +1 -0
  3. package/dist/index.tmp +1 -1
  4. package/dist/js/app-legacy.86198344.js +2 -0
  5. package/dist/js/app-legacy.86198344.js.map +1 -0
  6. package/dist/js/app.86198344.js +2 -0
  7. package/dist/js/app.86198344.js.map +1 -0
  8. package/dist/js/chunk-vendors-legacy.c0c4267e.js +14 -0
  9. package/dist/js/chunk-vendors-legacy.c0c4267e.js.map +1 -0
  10. package/dist/js/chunk-vendors.c0c4267e.js +14 -0
  11. package/dist/js/chunk-vendors.c0c4267e.js.map +1 -0
  12. package/dist/w-web-api.umd.js +2 -2
  13. package/dist/w-web-api.umd.js.map +1 -1
  14. package/docs/WWebApi.html +4 -4
  15. package/docs/WWebApi.mjs.html +167 -64
  16. package/docs/index.html +1 -1
  17. package/{g.mDb.mjs → g.backupDb.mjs} +1 -1
  18. package/{g.mInitialTestData.mjs → g.initialTestData.mjs} +1 -1
  19. package/package.json +5 -10
  20. package/public/index.html +1 -1
  21. package/server/WWebApi.mjs +166 -63
  22. package/server/provideApis.mjs +2 -2
  23. package/src/App.vue +1 -8
  24. package/src/components/Layout.vue +2 -2
  25. package/src/components/LayoutContent.vue +634 -25
  26. package/src/main.js +0 -2
  27. package/src/store/mutations.mjs +13 -0
  28. package/srv.mjs +21 -12
  29. package/tableTags-web-api.json +1 -1
  30. package/vue.config.js +1 -1
  31. package/dist/css/app.e645631b.css +0 -1
  32. package/dist/css/chunk-vendors.ca61ed63.css +0 -5
  33. package/dist/js/app-legacy.4bcebb66.js +0 -2
  34. package/dist/js/app-legacy.4bcebb66.js.map +0 -1
  35. package/dist/js/app.8115e31a.js +0 -2
  36. package/dist/js/app.8115e31a.js.map +0 -1
  37. package/dist/js/chunk-vendors-legacy.0b4288c4.js +0 -14
  38. package/dist/js/chunk-vendors-legacy.0b4288c4.js.map +0 -1
  39. package/dist/js/chunk-vendors.0b4288c4.js +0 -14
  40. package/dist/js/chunk-vendors.0b4288c4.js.map +0 -1
  41. package/src/components/LayoutContentList.vue +0 -589
  42. package/src/plugins/mVuetify.mjs +0 -12
package/src/main.js CHANGED
@@ -11,7 +11,6 @@ import domResize from 'w-component-vue/src/js/domResize.mjs'
11
11
  import domDragDrop from 'w-component-vue/src/js/domDragDrop.mjs'
12
12
  import App from './App.vue'
13
13
  import store from './store/index.mjs'
14
- import mVuetify from './plugins/mVuetify.mjs'
15
14
  import ui from './plugins/mUI.mjs'
16
15
  import mDataSelectorSchema from './plugins/mDataSelectorSchema.mjs'
17
16
  import mDataSupport from './plugins/mDataSupport.mjs'
@@ -96,7 +95,6 @@ WServHapiClient({
96
95
 
97
96
  //new
98
97
  new Vue({
99
- vuetify: mVuetify,
100
98
  store,
101
99
  render: h => h(App)
102
100
  }).$mount('#app')
@@ -41,6 +41,15 @@ let state = {
41
41
  lang: 'cht',
42
42
  keyLangs: {
43
43
 
44
+ menuTreeShow: {
45
+ eng: 'Show API list',
46
+ cht: '顯示API清單',
47
+ },
48
+ menuTreeHide: {
49
+ eng: 'Hide API list',
50
+ cht: '隱藏API清單',
51
+ },
52
+
44
53
  empty: {
45
54
  eng: 'Empty',
46
55
  cht: '無',
@@ -57,6 +66,10 @@ let state = {
57
66
  eng: 'Tokens',
58
67
  cht: '授權金鑰',
59
68
  },
69
+ apiUrl: {
70
+ eng: 'API url',
71
+ cht: 'API網址',
72
+ },
60
73
  version: {
61
74
  eng: 'Version',
62
75
  cht: '版本',
package/srv.mjs CHANGED
@@ -15,7 +15,7 @@ let opt = {
15
15
  bExcludeWhenNotAdmin: false,
16
16
 
17
17
  serverPort: 11005,
18
- subfolder: '', //mpai
18
+ subfolder: '', //mapi
19
19
 
20
20
  webName: {
21
21
  'eng': 'API Service',
@@ -30,24 +30,33 @@ let opt = {
30
30
  }
31
31
 
32
32
  let getUserByToken = (token) => {
33
- console.log('getUserByToken token', token)
34
- // return {} //測試無法登入條件
35
- if (token !== 'sys') {
36
- return {}
33
+ // return {} //測試無法登入
34
+ if (token === '{token-for-application}') { //提供外部應用系統作為存取使用者
35
+ return {
36
+ id: 'id-for-application',
37
+ name: 'application',
38
+ email: 'admin@example.com',
39
+ isAdmin: 'y',
40
+ }
37
41
  }
38
- return {
39
- id: 'id-for-admin',
40
- name: '測試者',
41
- email: 'admin@example.com',
42
- isAdmin: 'y',
42
+ if (token === 'sys') { //開發階段w-ui-loginout自動給予browser使用者(且位於localhost)的token為sys
43
+ return {
44
+ id: 'id-for-admin',
45
+ name: '測試者',
46
+ email: 'admin@example.com',
47
+ isAdmin: 'y',
48
+ }
43
49
  }
50
+ console.log('invalid token', token)
51
+ console.log('於生產環境時得加入SSO等驗證token機制')
52
+ return {}
44
53
  }
45
54
 
46
55
  let verifyUser = (user) => {
47
- return user.isAdmin === 'y'
56
+ console.log('於生產環境時得加入驗證user機制')
57
+ return user.isAdmin === 'y' //測試僅系統管理者使用
48
58
  }
49
59
 
50
-
51
60
  //WWebApi
52
61
  let instWWebApi = WWebApi(WOrm, url, db, getUserByToken, verifyUser, opt)
53
62
 
@@ -1 +1 @@
1
- {"apis":"LJvSk0"}
1
+ {"apis":"fY7kYV"}
package/vue.config.js CHANGED
@@ -10,6 +10,6 @@ module.exports = {
10
10
  },
11
11
  }
12
12
  },
13
- // transpileDependencies: ['vuetify'],
13
+ // transpileDependencies: [''],
14
14
  publicPath: process.env.NODE_ENV === 'production' ? '/mapi/' : '/', //預先編譯至mapi子目錄下, 待轉成模板, 並於伺服器啟動後依照設定檔取代
15
15
  }
@@ -1 +0,0 @@
1
- .md[data-v-6700278b] table{border-collapse:collapse;margin:0;padding:0;word-break:normal}.md[data-v-6700278b] tr{margin:0;padding:0}.md[data-v-6700278b] table tr th{font-weight:700;background:#eee;border:1px solid #ddd;border-bottom:0;margin:0;padding:6px 13px}.md[data-v-6700278b] table tr td{border:1px solid #ddd;margin:0;padding:6px 13px}.md[data-v-6700278b] h1{font-size:1.2rem;line-height:1.2rem}.md[data-v-6700278b] h1,.md[data-v-6700278b] h2{font-weight:700;margin-top:.5rem;margin-bottom:.5rem}.md[data-v-6700278b] h2{font-size:1.1rem;line-height:1.1rem}.md[data-v-6700278b] h3,.md[data-v-6700278b] h4,.md[data-v-6700278b] h5,.md[data-v-6700278b] h6{font-weight:700;font-size:1rem;line-height:1rem;margin-top:.5rem;margin-bottom:.5rem}.bk[data-v-382b8964]{display:inline-block;width:200px;padding:0 10px 10px 0;vertical-align:top}.bk-title[data-v-382b8964]{font-size:.8rem;color:#888}.bk-item[data-v-382b8964]{padding:3px 5px;font-size:.9rem;line-height:.9rem;border-radius:5px;border:1px solid #ddd;background:#fff}body,html{font-family:微軟正黑體,Microsoft JhengHei,MicrosoftJhengHeiRegular,Avenir,Helvetica,Arial,sans-serif;overflow-y:hidden}.v-application,.v-application--wrap,a,button,div,input,p,pre,span,textarea{font-family:inherit}.v-chip{cursor:inherit}.fade-enter-active{-webkit-animation:go 1s;animation:go 1s}.fade-leave-active{-webkit-animation:back 1s;animation:back 1s}@-webkit-keyframes go{0%{opacity:0}to{opacity:1}}@keyframes go{0%{opacity:0}to{opacity:1}}@-webkit-keyframes back{0%{opacity:1}to{opacity:0}}@keyframes back{0%{opacity:1}to{opacity:0}}