vue2-client 1.7.6 → 1.7.8

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": "vue2-client",
3
- "version": "1.7.6",
3
+ "version": "1.7.8",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
package/src/bootstrap.js CHANGED
@@ -3,6 +3,7 @@ import { loadRoutes, loadGuards, setAppOptions } from '@vue2-client/utils/router
3
3
  import { loadInterceptors } from '@vue2-client/utils/request'
4
4
  import guards from '@vue2-client/router/guards'
5
5
  import interceptors from '@vue2-client/utils/axios-interceptors'
6
+ import { getConfig } from '@vue2-client/services/api'
6
7
 
7
8
  /**
8
9
  * 启动引导方法
@@ -12,8 +13,15 @@ import interceptors from '@vue2-client/utils/axios-interceptors'
12
13
  * @param i18n 应用的 vue-i18n 实例
13
14
  * @param i18n 应用的 message 实例
14
15
  */
15
- function bootstrap ({ router, store, i18n, message }) {
16
+ async function bootstrap ({ router, store, i18n, message }) {
16
17
  Vue.$store = store
18
+ // 获取系统配置
19
+ await getConfig('webConfig', undefined, res => {
20
+ localStorage.setItem(process.env.VUE_APP_WEB_CONFIG_KEY, JSON.stringify(res))
21
+ if (res.setting) {
22
+ Vue.$store.commit('setting/setSetting', res.setting)
23
+ }
24
+ })
17
25
  // 设置应用配置
18
26
  setAppOptions({ router, store, i18n })
19
27
  // 加载 axios 拦截器
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <div class="common-layout">
3
+ <div class="top"><a class="clearCacheBtn" @click="clearCache">清除缓存</a></div>
3
4
  <div class="content"><slot></slot></div>
4
5
  <page-footer :link-list="footerLinks" :copyright="copyright" :copyrightStyle="copyrightStyle"></page-footer>
5
6
  </div>
@@ -8,12 +9,18 @@
8
9
  <script>
9
10
  import PageFooter from '@vue2-client/layouts/footer/PageFooter'
10
11
  import { mapState } from 'vuex'
12
+ import { indexedDB } from '@vue2-client/utils/indexedDB'
11
13
 
12
14
  export default {
13
15
  name: 'CommonLayout',
14
16
  components: { PageFooter },
15
17
  computed: {
16
18
  ...mapState('setting', ['footerLinks', 'copyright', 'copyrightStyle'])
19
+ },
20
+ methods: {
21
+ clearCache () {
22
+ indexedDB.clearCache()
23
+ }
17
24
  }
18
25
  }
19
26
  </script>
@@ -30,6 +37,13 @@ export default {
30
37
  background-position-x: center;
31
38
  background-position-y: 110px;
32
39
  background-size: 100%;
40
+ .top {
41
+ padding: 5px 10px;
42
+ text-align: right;
43
+ .clearCacheBtn {
44
+ color: #fff !important;
45
+ }
46
+ }
33
47
  .content{
34
48
  padding: 32px 0;
35
49
  flex: 1;
@@ -12,7 +12,7 @@
12
12
  </div>
13
13
  <div :class="['admin-header-right', headerTheme]">
14
14
  <component class="header-item" :is="dynamicComponents['HeaderSearch']" @active="val => searchActive = val"/>
15
- <a-tooltip class="header-item" placement="bottom" title="清理查询缓存" >
15
+ <a-tooltip class="header-item" placement="bottom" title="清理缓存" >
16
16
  <a @click="handleToClearCache">
17
17
  <a-icon type="reload" />
18
18
  </a>
@@ -115,11 +115,9 @@ export default {
115
115
  handleToClearCache () {
116
116
  Modal.confirm({
117
117
  title: '信息',
118
- content: '您确定要清除查询配置缓存吗?',
118
+ content: '您确定要清除缓存吗?',
119
119
  onOk: () => {
120
- indexedDB.clear(() => {
121
- location.reload()
122
- })
120
+ indexedDB.clearCache()
123
121
  },
124
122
  onCancel () {}
125
123
  })
package/src/main.js CHANGED
@@ -11,10 +11,11 @@ Vue.use(Vuex)
11
11
  const store = new Vuex.Store({ modules })
12
12
  const router = new Router(routerOptions)
13
13
 
14
- bootstrap({ router, store, i18n, message })
15
- new Vue({
16
- router,
17
- store,
18
- i18n,
19
- render: h => h(App)
20
- }).$mount('#app')
14
+ bootstrap({ router, store, i18n, message }).then(() => {
15
+ new Vue({
16
+ router,
17
+ store,
18
+ i18n,
19
+ render: h => h(App)
20
+ }).$mount('#app')
21
+ })
@@ -64,7 +64,6 @@ import { positions } from '@vue2-client/mock/common'
64
64
  import { timeFix } from '@vue2-client/utils/util'
65
65
  import { loginStart } from '@vue2-client/base-client/plugins/compatible/LoginServiceOA'
66
66
  import { indexedDB } from '@vue2-client/utils/indexedDB'
67
- import { getConfig } from '@vue2-client/services/api'
68
67
 
69
68
  export default {
70
69
  name: 'Login',
@@ -76,14 +75,6 @@ export default {
76
75
  form: this.$form.createForm(this)
77
76
  }
78
77
  },
79
- async created () {
80
- await getConfig('webConfig', undefined, res => {
81
- localStorage.setItem(process.env.VUE_APP_WEB_CONFIG_KEY, JSON.stringify(res))
82
- if (res.setting) {
83
- this.$store.commit('setting/setSetting', res.setting)
84
- }
85
- })
86
- },
87
78
  computed: {
88
79
  ...mapState('setting', ['systemName', 'systemDesc', 'homePage', 'ticketPage', 'compatible', 'routeName', 'defaultAvatarUrl'])
89
80
  },
@@ -144,5 +144,10 @@ export const indexedDB = {
144
144
  }
145
145
  }
146
146
  })
147
+ },
148
+ clearCache () {
149
+ indexedDB.clear(() => {
150
+ location.reload()
151
+ })
147
152
  }
148
153
  }