n20-common-lib 1.3.49 → 1.3.52

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.
@@ -1,11 +1,13 @@
1
1
  <template>
2
2
  <dialog-wrap
3
3
  ref="dialog"
4
+ v-drag
4
5
  class="p-t-0"
5
6
  v-bind="$attrs"
6
7
  :visible.sync="visible"
7
- :width="width"
8
8
  :title="title"
9
+ :width="width"
10
+ :close-on-click-modal="false"
9
11
  @open="popOpen"
10
12
  >
11
13
  <div class="dialog-view">
@@ -172,6 +174,7 @@ export default {
172
174
  }
173
175
  },
174
176
  reset() {
177
+ ////
175
178
  this.dragList = this.checkColumns.filter((col) => !col.static)
176
179
  },
177
180
  setChange() {
package/src/utils/auth.js CHANGED
@@ -2,6 +2,7 @@
2
2
  import Cookies from 'js-cookie'
3
3
 
4
4
  const STORAGE = window.sessionStorage
5
+ let ownLoginPath = '/login'
5
6
 
6
7
  const auth = {
7
8
  stokenKey: 'token',
@@ -18,6 +19,7 @@ const auth = {
18
19
  return Cookies.get(this.cokenKey)
19
20
  },
20
21
  setToken(val) {
22
+ this.tokenVal = val
21
23
  Cookies.set(this.cokenKey, val, { expires: 1 })
22
24
  STORAGE.setItem(this.stokenKey, val)
23
25
  },
@@ -25,7 +27,7 @@ const auth = {
25
27
  this.tokenVal = ''
26
28
  Cookies.remove(this.cokenKey)
27
29
  STORAGE.removeItem(this.stokenKey)
28
- toLogin()
30
+ auth.toLogin()
29
31
  },
30
32
  setLoginPath(router) {
31
33
  let { base = '/', mode = 'history' } = router.options
@@ -36,21 +38,19 @@ const auth = {
36
38
  ownLoginPath = window.location.origin + base + 'login'
37
39
  }
38
40
  // 判断有没有token,没有直接跳到登录页
39
- auth.getToken() || toLogin()
41
+ auth.getToken() || auth.toLogin()
42
+ },
43
+ toLogin() {
44
+ let hrefOld = window.location.href
45
+ let loginHref = window.__POWERED_BY_QIANKUN__
46
+ ? window.location.origin + '/login'
47
+ : ownLoginPath
48
+ if (hrefOld !== loginHref) {
49
+ window.location.href = loginHref
50
+ }
40
51
  }
41
52
  }
42
- auth.cokenKey = 'Admin-Token'
43
53
 
44
- let ownLoginPath = '/login'
45
- function toLogin() {
46
- let hrefOld = window.location.href
47
- let loginHref = window.__POWERED_BY_QIANKUN__
48
- ? window.location.origin + '/login'
49
- : ownLoginPath
50
- if (hrefOld !== loginHref) {
51
- history.pushState(null, null, loginHref)
52
- window.location.reload()
53
- }
54
- }
54
+ auth.cokenKey = 'Admin-Token'
55
55
 
56
56
  export default auth