@netang/quasar 0.2.28 → 0.2.30

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.
@@ -128,6 +128,10 @@ export default {
128
128
  type: [String, Number],
129
129
  default: '600px',
130
130
  },
131
+ // 最小高度
132
+ minHeight: [String, Number],
133
+ // 最大宽度
134
+ maxWidth: [String, Number],
131
135
  // 是否全屏
132
136
  fullscreen: Boolean,
133
137
  // 是否是页面容器
@@ -258,6 +262,14 @@ export default {
258
262
  setWH(style, 'height', 'vh')
259
263
  // 最小宽度
260
264
  setWH(style, 'minWidth', 'vw')
265
+ // 最小高度度
266
+ if (props.minHeight) {
267
+ setWH(style, 'minHeight', 'vh')
268
+ }
269
+ // 最大宽度
270
+ if (props.maxWidth) {
271
+ setWH(style, 'maxWidth', 'vw')
272
+ }
261
273
  }
262
274
 
263
275
  return style
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netang/quasar",
3
- "version": "0.2.28",
3
+ "version": "0.2.30",
4
4
 
5
5
  "description": "netang-quasar",
6
6
  "scripts": {
package/utils/$auth.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import $n_router from '@netang/utils/vue/router'
2
2
 
3
3
  import $n_isValidObject from '@netang/utils/isValidObject'
4
- import $n_cookie from '@netang/utils/cookie'
4
+ import $n_storage from '@netang/utils/storage'
5
5
 
6
+ import { configs } from './config'
6
7
  import { stateUserInfo } from '../store'
7
8
  import { checkUserInfo } from './useAuth'
8
9
 
@@ -58,7 +59,7 @@ function _updateUserInfo(res) {
58
59
  }
59
60
 
60
61
  // 保存缓存(永久缓存)
61
- $n_cookie.set('_tk', res, 0)
62
+ $n_storage.set('_tk', res, configs.authExpireTime)
62
63
 
63
64
  // 设置用户信息状态
64
65
  stateUserInfo.value = res
@@ -96,7 +97,7 @@ function pushLogin(query) {
96
97
  function logout() {
97
98
 
98
99
  // 删除管理员信息
99
- $n_cookie.delete('_tk')
100
+ $n_storage.delete('_tk')
100
101
 
101
102
  // 清空用户信息状态
102
103
  stateUserInfo.value = {
package/utils/$table.js CHANGED
@@ -1192,7 +1192,8 @@ function create(options) {
1192
1192
  * 获取表格配置
1193
1193
  */
1194
1194
  function config(routePath, path, defaultValue) {
1195
- return $n_cloneDeep($n_get(tablesConfig, $n_slash(routePath, 'start', false) + (path ? '.' + path : ''), defaultValue))
1195
+ const res = $n_get(tablesConfig, $n_slash(routePath, 'start', false) + (path ? '.' + path : ''), defaultValue)
1196
+ return $n_cloneDeep($n_isFunction(res) ? res() : res)
1196
1197
  }
1197
1198
 
1198
1199
  /**
package/utils/config.js CHANGED
@@ -46,6 +46,8 @@ export const configs = {
46
46
  // 上传请求
47
47
  onUploadHttp: null,
48
48
  },
49
+ // 鉴权过期时间(2 天)
50
+ authExpireTime: 172800000,
49
51
  }
50
52
 
51
53
  /**
package/utils/useAuth.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import $n_validator from '@netang/utils/validator'
2
- import $n_cookie from '@netang/utils/cookie'
2
+ import $n_storage from '@netang/utils/storage'
3
3
 
4
4
  /**
5
5
  * 初始化鉴权状态
6
6
  */
7
7
  export function initAuthStore() {
8
8
  // 获取管理员信息缓存
9
- const cache = $n_cookie.get('_tk')
9
+ const cache = $n_storage.get('_tk')
10
10
  return checkUserInfo(cache) ? cache : {
11
11
  id: 0,
12
12
  token: '',