@netang/quasar 0.0.48 → 0.0.49

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 (56) hide show
  1. package/components/dialog/index.vue +10 -10
  2. package/components/dialog-table/index.vue +1 -1
  3. package/components/dragger/index.vue +2 -2
  4. package/components/drawer/index.vue +7 -7
  5. package/components/field-date/index.vue +35 -35
  6. package/components/field-table/index.vue +34 -34
  7. package/components/field-text/index.vue +2 -2
  8. package/components/field-tree/index.vue +18 -18
  9. package/components/input-number/index.vue +2 -2
  10. package/components/list-menu/index.vue +2 -2
  11. package/components/private/components/move-to-tree/index.vue +2 -2
  12. package/components/private/edit-power-data/index.vue +50 -50
  13. package/components/private/table-visible-columns-button/index.vue +2 -2
  14. package/components/render/index.vue +6 -6
  15. package/components/search/index.vue +2 -2
  16. package/components/search-item/index.vue +5 -5
  17. package/components/select/index.vue +2 -2
  18. package/components/splitter/index.vue +7 -7
  19. package/components/table/index.vue +5 -5
  20. package/components/table-splitter/index.vue +3 -3
  21. package/components/table-summary/index.vue +3 -3
  22. package/components/thumbnail/index.vue +6 -6
  23. package/components/uploader/index.vue +1 -1
  24. package/components/uploader-query/index.vue +25 -25
  25. package/components/value-format/index.vue +12 -12
  26. package/package.json +1 -1
  27. package/utils/$area.js +13 -13
  28. package/utils/$auth.js +6 -6
  29. package/utils/$dialog.js +3 -3
  30. package/utils/$form.js +2 -2
  31. package/utils/$power.js +118 -118
  32. package/utils/$rule.js +4 -4
  33. package/utils/$search.js +50 -50
  34. package/utils/$table.js +76 -76
  35. package/utils/$tree.js +43 -43
  36. package/utils/$uploader.js +47 -47
  37. package/utils/alert.js +1 -1
  38. package/utils/arr.js +2 -2
  39. package/utils/bus.js +1 -1
  40. package/utils/config.js +4 -4
  41. package/utils/confrim.js +1 -1
  42. package/utils/dict.js +5 -5
  43. package/utils/getData.js +9 -9
  44. package/utils/getFile.js +5 -5
  45. package/utils/getImage.js +12 -12
  46. package/utils/getTime.js +4 -4
  47. package/utils/http.js +20 -20
  48. package/utils/loading.js +1 -1
  49. package/utils/notify.js +1 -1
  50. package/utils/previewImage.js +2 -2
  51. package/utils/price.js +3 -3
  52. package/utils/timestamp.js +1 -1
  53. package/utils/toast.js +1 -1
  54. package/utils/uploader/qiniu.js +11 -11
  55. package/utils/useAuth.js +2 -2
  56. package/utils/useRouter.js +4 -4
package/utils/config.js CHANGED
@@ -4,19 +4,19 @@ import configData from '@/configs/production.json'
4
4
  // --------------------------------------------------
5
5
  // #if IS_DEBUG && IS_DEV
6
6
  import configDataDev from '@/configs/development.json'
7
- _.merge(configData, configDataDev)
7
+ $n.merge(configData, configDataDev)
8
8
  // #endif
9
9
 
10
10
  // 【测试模式】
11
11
  // --------------------------------------------------
12
12
  // #if IS_DEBUG && IS_TEST
13
13
  import configDataTest from '@/configs/testing.json'
14
- _.merge(configData, configDataTest)
14
+ $n.merge(configData, configDataTest)
15
15
  // #endif
16
16
 
17
17
  /**
18
18
  * 获取配置
19
19
  */
20
- utils.config = function(key = '', defaultValue = '') {
21
- return key ? _.get(configData, key, defaultValue) : configData
20
+ $n.config = function(key = '', defaultValue = '') {
21
+ return key ? $n.get(configData, key, defaultValue) : configData
22
22
  }
package/utils/confrim.js CHANGED
@@ -3,7 +3,7 @@ import { Dialog } from 'quasar'
3
3
  /**
4
4
  * 确认框
5
5
  */
6
- utils.confirm = function(params) {
6
+ $n.confirm = function(params) {
7
7
  return Dialog.create(Object.assign({
8
8
  title: '提示',
9
9
  cancel: true,
package/utils/dict.js CHANGED
@@ -5,15 +5,15 @@ import dictData from '@/configs/dict.json'
5
5
  */
6
6
 
7
7
  // 设置字典数据
8
- utils.dictData = dictData
8
+ $n.dictData = dictData
9
9
 
10
10
  /**
11
11
  * 获取字典值对应的文字
12
12
  */
13
- utils.dict = function(key, value, defaultValue = '') {
13
+ $n.dict = function(key, value, defaultValue = '') {
14
14
  if (
15
15
  key
16
- && _.has(dictData, key)
16
+ && $n.has(dictData, key)
17
17
  ) {
18
18
  for (const item of dictData[key]) {
19
19
  if (item[1] === value) {
@@ -25,11 +25,11 @@ utils.dict = function(key, value, defaultValue = '') {
25
25
  return defaultValue
26
26
  }
27
27
 
28
- utils.dictOptions = function(key, textKey = 'label', valueKey = 'value') {
28
+ $n.dictOptions = function(key, textKey = 'label', valueKey = 'value') {
29
29
 
30
30
  const lists = []
31
31
 
32
- const dictItem = _.get(dictData, key, [])
32
+ const dictItem = $n.get(dictData, key, [])
33
33
 
34
34
  for (const item of dictItem) {
35
35
 
package/utils/getData.js CHANGED
@@ -3,17 +3,17 @@ import { isRef } from 'vue'
3
3
  /**
4
4
  * 获取公共数据
5
5
  */
6
- utils.getData = async function(url, pageStatus, emptyDescription, refValue) {
6
+ $n.getData = async function(url, pageStatus, emptyDescription, refValue) {
7
7
 
8
- const warn = _.isNil(pageStatus) || ! isRef(pageStatus)
8
+ const warn = $n.isNil(pageStatus) || ! isRef(pageStatus)
9
9
 
10
10
  // 如果是数组, 说明需要同时请求多个地址
11
11
  // --------------------------------------------------
12
12
  if (Array.isArray(url)) {
13
13
 
14
- const result = await utils.http(_.map(url, function (item) {
14
+ const result = await $n.http($n.map(url, function (item) {
15
15
  return {
16
- url: utils.config('commonDataUrl') + item,
16
+ url: $n.config('commonDataUrl') + item,
17
17
  warn,
18
18
  }
19
19
  }))
@@ -25,7 +25,7 @@ utils.getData = async function(url, pageStatus, emptyDescription, refValue) {
25
25
  if (! warn) {
26
26
  pageStatus.value = false
27
27
  }
28
- if (! _.isNil(emptyDescription) && isRef(emptyDescription)) {
28
+ if (! $n.isNil(emptyDescription) && isRef(emptyDescription)) {
29
29
  emptyDescription.value = data.msg
30
30
  }
31
31
  return false
@@ -38,22 +38,22 @@ utils.getData = async function(url, pageStatus, emptyDescription, refValue) {
38
38
 
39
39
  // 单个请求
40
40
  // --------------------------------------------------
41
- const { status, data } = await utils.http({
42
- url: utils.config('commonDataUrl') + url,
41
+ const { status, data } = await $n.http({
42
+ url: $n.config('commonDataUrl') + url,
43
43
  warn,
44
44
  })
45
45
  if (! status) {
46
46
  if (! warn) {
47
47
  pageStatus.value = false
48
48
  }
49
- if (! _.isNil(emptyDescription) && isRef(emptyDescription)) {
49
+ if (! $n.isNil(emptyDescription) && isRef(emptyDescription)) {
50
50
  emptyDescription.value = data.msg
51
51
  }
52
52
  return false
53
53
  }
54
54
 
55
55
  // 直接设置 value
56
- if (! _.isNil(refValue) && isRef(refValue)) {
56
+ if (! $n.isNil(refValue) && isRef(refValue)) {
57
57
  refValue.value = data
58
58
  }
59
59
 
package/utils/getFile.js CHANGED
@@ -1,27 +1,27 @@
1
1
  /**
2
2
  * 获取文件
3
3
  */
4
- utils.getFile = function(src) {
4
+ $n.getFile = function(src) {
5
5
 
6
6
  if (src) {
7
7
 
8
8
  // 如果为数组, 则获取第一个
9
- if (utils.isValidArray(src)) {
9
+ if ($n.isValidArray(src)) {
10
10
  src = src[0]
11
11
  }
12
12
 
13
- if (utils.isValidString(src)) {
13
+ if ($n.isValidString(src)) {
14
14
 
15
15
  // http(s):// 或 data: 或 blob: 开头的地址
16
16
  if (/^(http(s)?:\/\/|data:|blob:)/i.test(src)) {
17
17
  return src
18
18
  }
19
19
 
20
- const uploaderConfig = utils.config('uploader.upload')
20
+ const uploaderConfig = $n.config('uploader.upload')
21
21
  switch (uploaderConfig.type) {
22
22
  // 七牛云
23
23
  case 'qiniu':
24
- return utils.slash(uploaderConfig.domain, 'end', true) + src
24
+ return $n.slash(uploaderConfig.domain, 'end', true) + src
25
25
  }
26
26
  }
27
27
  }
package/utils/getImage.js CHANGED
@@ -1,27 +1,27 @@
1
1
  /**
2
2
  * 获取图片
3
3
  */
4
- utils.getImage = function(src, params) {
4
+ $n.getImage = function(src, params) {
5
5
 
6
6
  if (src) {
7
7
 
8
8
  // 如果为数组, 则获取第一个
9
- if (utils.isValidArray(src)) {
9
+ if ($n.isValidArray(src)) {
10
10
  src = src[0]
11
11
 
12
12
  // 如果为对象
13
- } else if (utils.isValidObject(src)) {
13
+ } else if ($n.isValidObject(src)) {
14
14
 
15
- if (_.has(src, 'params')) {
15
+ if ($n.has(src, 'params')) {
16
16
  params = src.params
17
17
  }
18
18
 
19
- if (_.has(src, 'img')) {
19
+ if ($n.has(src, 'img')) {
20
20
  src = src.img
21
21
  }
22
22
  }
23
23
 
24
- if (utils.isValidString(src)) {
24
+ if ($n.isValidString(src)) {
25
25
 
26
26
  // http(s):// 或 data: 或 blob: 开头的地址
27
27
  if (/^(http(s)?:\/\/|data:|blob:)/i.test(src)) {
@@ -29,12 +29,12 @@ utils.getImage = function(src, params) {
29
29
  }
30
30
 
31
31
  // 如果为对象定义的规格
32
- if (utils.isValidObject(params)) {
32
+ if ($n.isValidObject(params)) {
33
33
 
34
34
  // 【自动缩放】
35
35
  // 如果没有定义 w
36
36
  // --------------------------------------------------
37
- if (! _.has(params, 'w')) {
37
+ if (! $n.has(params, 'w')) {
38
38
 
39
39
  const {
40
40
  width,
@@ -46,11 +46,11 @@ utils.getImage = function(src, params) {
46
46
 
47
47
  let w = width
48
48
 
49
- if (! utils.isNumeric(w) && _.isString(w)) {
49
+ if (! $n.isNumeric(w) && $n.isString(w)) {
50
50
  w = w.replace('px', '')
51
51
  }
52
52
 
53
- if (utils.isNumeric(w)) {
53
+ if ($n.isNumeric(w)) {
54
54
  w = Number(w)
55
55
  if (w > 0) {
56
56
 
@@ -75,7 +75,7 @@ utils.getImage = function(src, params) {
75
75
  // --------------------------------------------------
76
76
  }
77
77
 
78
- const uploaderConfig = utils.config('uploader.upload')
78
+ const uploaderConfig = $n.config('uploader.upload')
79
79
  switch (uploaderConfig.type) {
80
80
  // 七牛云
81
81
  case 'qiniu':
@@ -127,7 +127,7 @@ utils.getImage = function(src, params) {
127
127
  src += '/format/' + format
128
128
  }
129
129
 
130
- return utils.slash(uploaderConfig.domain, 'end', true) + src
130
+ return $n.slash(uploaderConfig.domain, 'end', true) + src
131
131
  }
132
132
  }
133
133
  }
package/utils/getTime.js CHANGED
@@ -3,10 +3,10 @@ import { date as quasarDate } from 'quasar'
3
3
  /**
4
4
  * 获取时间
5
5
  */
6
- utils.getTime = function(time, params, defaultValue = '') {
6
+ $n.getTime = function(time, params, defaultValue = '') {
7
7
 
8
8
  if (! time) {
9
- return utils.isValidString(params) ? params : defaultValue
9
+ return $n.isValidString(params) ? params : defaultValue
10
10
  }
11
11
 
12
12
  let {
@@ -33,10 +33,10 @@ utils.getTime = function(time, params, defaultValue = '') {
33
33
  }, params)
34
34
 
35
35
  // 传入时间
36
- const date = utils.toDate(time)
36
+ const date = $n.toDate(time)
37
37
 
38
38
  // 当前时间
39
- const now = utils.toDate(utils.timestamp())
39
+ const now = $n.toDate($n.timestamp())
40
40
 
41
41
  // 如果是自然化时间
42
42
  // 如果是今天, 则显示时分秒
package/utils/http.js CHANGED
@@ -6,9 +6,9 @@ import { statePower } from '../store'
6
6
  /**
7
7
  * 初始化 http
8
8
  */
9
- utils.http = createHttp({
9
+ $n.http = createHttp({
10
10
  // 基础 url
11
- baseUrl: utils.config('apiUrl'),
11
+ baseUrl: $n.config('apiUrl'),
12
12
  // 是否开启错误提醒(true:普通方式/false:不开启/alert:对话框方式)
13
13
  warn: 'alert',
14
14
  // 检查结果的 code 是否正确(前提数据类型必须为 json)
@@ -20,7 +20,7 @@ utils.http = createHttp({
20
20
  // 是否开启防抖(防止重复请求)
21
21
  debounce: true,
22
22
  // 缓存方法
23
- storage: utils.storage,
23
+ storage: $n.storage,
24
24
  // 是否已更新过鉴权
25
25
  _isUpdatedAuthToken: false,
26
26
 
@@ -35,7 +35,7 @@ utils.http = createHttp({
35
35
  onOptions({ options, para }) {
36
36
 
37
37
  // 取消请求
38
- if (_.isFunction(para.onCancel)) {
38
+ if ($n.isFunction(para.onCancel)) {
39
39
  const source = axios.CancelToken.source()
40
40
  options.cancelToken = source.token
41
41
 
@@ -47,7 +47,7 @@ utils.http = createHttp({
47
47
  }
48
48
 
49
49
  // 获取上传进度
50
- if (para.upload === true && _.isFunction(para.onUploadProgress)) {
50
+ if (para.upload === true && $n.isFunction(para.onUploadProgress)) {
51
51
  options.onUploadProgress = function (e) {
52
52
  para.onUploadProgress(Math.round(e.loaded * 100 / e.total), e)
53
53
  }
@@ -60,7 +60,7 @@ utils.http = createHttp({
60
60
  async onRequest({ options, para, onError, next }) {
61
61
 
62
62
  // 如果无网络
63
- // if (! utils.state.get('network').isOnline) {
63
+ // if (! $n.state.get('network').isOnline) {
64
64
  // return onError({
65
65
  // code: dicts.CODE__SERVER_ERROR,
66
66
  // msg: '网络不给力,请检查设置后重试',
@@ -74,7 +74,7 @@ utils.http = createHttp({
74
74
  // appWgtVersion,
75
75
  // // 【自定义】app 类型(1:app-android,2:app-ios,3:web-mobile,4:web-pc)
76
76
  // appType,
77
- // } = utils.getSystemInfo()
77
+ // } = $n.getSystemInfo()
78
78
 
79
79
  // 如果验证 code, 说明是请求业务服务器
80
80
  if (para.checkCode) {
@@ -95,8 +95,8 @@ utils.http = createHttp({
95
95
  if (para.token) {
96
96
 
97
97
  // 如果已登录
98
- if (utils.$auth.isLogin()) {
99
- const { token } = utils.$auth.getAdminUserInfo()
98
+ if ($n.$auth.isLogin()) {
99
+ const { token } = $n.$auth.getAdminUserInfo()
100
100
 
101
101
  // 头部添加鉴权认证
102
102
  options.headers.Authorization = token
@@ -109,7 +109,7 @@ utils.http = createHttp({
109
109
 
110
110
  // 否则未登录 && 如果开启强制登录, 则跳转登录页面
111
111
  } else if (para.login) {
112
- utils.$auth.pushLogin()
112
+ $n.$auth.pushLogin()
113
113
  return false
114
114
  }
115
115
  }
@@ -127,7 +127,7 @@ utils.http = createHttp({
127
127
  // 如果请求成功
128
128
  if (res.status && para.checkCode && para.token) {
129
129
  // 设置权限数据
130
- utils.$power.setData(_.get(res, 'response.data.power'))
130
+ $n.$power.setData($n.get(res, 'response.data.power'))
131
131
  }
132
132
 
133
133
  return res
@@ -168,7 +168,7 @@ utils.http = createHttp({
168
168
  // #if IS_DEBUG
169
169
  if (
170
170
  data.code === dicts.CODE__SERVER_ERROR
171
- && utils.isValidString(_.get(r, 'response.data'))
171
+ && $n.isValidString($n.get(r, 'response.data'))
172
172
  ) {
173
173
  message = r.response.data
174
174
  }
@@ -179,7 +179,7 @@ utils.http = createHttp({
179
179
  if (para.warn === 'alert') {
180
180
 
181
181
  // 提示框
182
- utils.alert({
182
+ $n.alert({
183
183
  message,
184
184
 
185
185
  // #if IS_DEBUG
@@ -194,7 +194,7 @@ utils.http = createHttp({
194
194
  // 否则为轻提示
195
195
  } else {
196
196
  // 轻提示
197
- utils.toast({
197
+ $n.toast({
198
198
  message,
199
199
 
200
200
  // #if IS_DEBUG
@@ -207,12 +207,12 @@ utils.http = createHttp({
207
207
  }
208
208
 
209
209
  // 页面状态
210
- if (! _.isNil(para.pageStatus) && isRef(para.pageStatus)) {
210
+ if (! $n.isNil(para.pageStatus) && isRef(para.pageStatus)) {
211
211
  para.pageStatus.value = false
212
212
  }
213
213
 
214
214
  // 空状态描述
215
- if (! _.isNil(para.emptyDescription) && isRef(para.emptyDescription)) {
215
+ if (! $n.isNil(para.emptyDescription) && isRef(para.emptyDescription)) {
216
216
  para.emptyDescription.value = data.msg
217
217
  }
218
218
  },
@@ -222,7 +222,7 @@ utils.http = createHttp({
222
222
  */
223
223
  async onBusinessError({ data, para, onHttp }) {
224
224
 
225
- if (utils.indexOf([
225
+ if ($n.indexOf([
226
226
  // 状态码(411:强制退出)
227
227
  dicts.CODE__LOGOUT,
228
228
  // 状态码(410:token 过期需要重新鉴权)
@@ -235,15 +235,15 @@ utils.http = createHttp({
235
235
  ], data.code) > -1) {
236
236
 
237
237
  // 轻提示
238
- utils.toast({
238
+ $n.toast({
239
239
  message: data.msg || '请重新登录',
240
240
  })
241
241
 
242
242
  // 退出登录
243
- utils.$auth.logout()
243
+ $n.$auth.logout()
244
244
 
245
245
  // 跳转登录页面
246
- utils.$auth.pushLogin()
246
+ $n.$auth.pushLogin()
247
247
 
248
248
  return false
249
249
  }
package/utils/loading.js CHANGED
@@ -3,7 +3,7 @@ import { Loading } from 'quasar'
3
3
  /**
4
4
  * 加载
5
5
  */
6
- utils.loading = {
6
+ $n.loading = {
7
7
  show() {
8
8
  Loading.show()
9
9
  },
package/utils/notify.js CHANGED
@@ -3,7 +3,7 @@ import { Notify } from 'quasar'
3
3
  /**
4
4
  * 通知
5
5
  */
6
- utils.notify = function(params) {
6
+ $n.notify = function(params) {
7
7
  Notify.create(Object.assign({
8
8
  // 出现位置
9
9
  position: 'bottom-right',
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * 预览图片
3
3
  */
4
- utils.previewImage = function(src) {
5
- utils.toast({
4
+ $n.previewImage = function(src) {
5
+ $n.toast({
6
6
  message: '预览图片还没做'
7
7
  })
8
8
  }
package/utils/price.js CHANGED
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * 换算金额
3
3
  */
4
- utils.price = function(value, params) {
5
- return utils.decimal(value, Object.assign({
4
+ $n.price = function(value, params) {
5
+ return $n.decimal(value, Object.assign({
6
6
  // 最小值
7
7
  min: 0,
8
8
  // 小数点位数
9
9
  decimalLength: 2,
10
10
  // 是否开启人民币分转元(如值 189 -> 1.89)
11
- centToYuan: utils.config('priceCent') === true,
11
+ centToYuan: $n.config('priceCent') === true,
12
12
  }, params))
13
13
  }
@@ -3,7 +3,7 @@ import { stateTimeDiff } from '../store'
3
3
  /**
4
4
  * 获取当前时间戳
5
5
  */
6
- utils.timestamp = function(isMicro = false) {
6
+ $n.timestamp = function(isMicro = false) {
7
7
 
8
8
  // 获取当前时间戳(毫秒)
9
9
  const nowTime = new Date().getTime()
package/utils/toast.js CHANGED
@@ -3,7 +3,7 @@ import { Notify, Platform } from 'quasar'
3
3
  /**
4
4
  * 轻提示
5
5
  */
6
- utils.toast = function(params) {
6
+ $n.toast = function(params) {
7
7
  return Notify.create(Object.assign({
8
8
  // 出现位置
9
9
  position: Platform.is.desktop ? 'top' : 'bottom',
@@ -10,7 +10,7 @@ import {
10
10
  async function getQiniuToken(bucket = 'public') {
11
11
 
12
12
  // 请求数据
13
- const { status, data } = await utils.http({
13
+ const { status, data } = await $n.http({
14
14
  url: REQUEST_URL + 'get_qiniu_token',
15
15
  data: {
16
16
  bucket,
@@ -46,7 +46,7 @@ export default async function ({ waitUploadFileLists, uploadFileLists, checkFile
46
46
  for (const fileItem of waitUploadFileLists) {
47
47
  setFileFail(fileItem, '上传失败')
48
48
  }
49
- utils.toast({
49
+ $n.toast({
50
50
  message: '获取上传参数失败',
51
51
  })
52
52
  return
@@ -68,7 +68,7 @@ export default async function ({ waitUploadFileLists, uploadFileLists, checkFile
68
68
  fileItem.status = UPLOAD_STATUS.uploading
69
69
 
70
70
  // 请求上传文件到七牛云
71
- const { status, data: resUpload } = await utils.http({
71
+ const { status, data: resUpload } = await $n.http({
72
72
  // 上传地址
73
73
  url: 'https://upload.qiniup.com/',
74
74
  // 数据
@@ -92,7 +92,7 @@ export default async function ({ waitUploadFileLists, uploadFileLists, checkFile
92
92
  onCancel(cancel) {
93
93
  // 设置中断上传
94
94
  fileItem.abort = function(msg) {
95
- cancel(utils.isValidString(msg) ? msg : '已取消')
95
+ cancel($n.isValidString(msg) ? msg : '已取消')
96
96
  }
97
97
  },
98
98
  // 监听上传进度
@@ -116,7 +116,7 @@ export default async function ({ waitUploadFileLists, uploadFileLists, checkFile
116
116
  }
117
117
 
118
118
  // 请求 - 上传文件至 cdn
119
- const { status: statusCallback, data: resCallback } = await utils.http({
119
+ const { status: statusCallback, data: resCallback } = await $n.http({
120
120
  url: REQUEST_URL + 'upload_cdn_callback',
121
121
  data: query,
122
122
  // 关闭错误提示
@@ -140,7 +140,7 @@ export default async function ({ waitUploadFileLists, uploadFileLists, checkFile
140
140
  function checkQiniuCallback(res, fileItem) {
141
141
 
142
142
  // 如果文件被删除
143
- if (_.findIndex(uploadFileLists.value, { hash: fileItem.hash }) === -1) {
143
+ if ($n.findIndex(uploadFileLists.value, { hash: fileItem.hash }) === -1) {
144
144
  // 设置文件上传失败
145
145
  setFileFail(fileItem, '上传失败')
146
146
  return false
@@ -215,7 +215,7 @@ export default async function ({ waitUploadFileLists, uploadFileLists, checkFile
215
215
  d: vduration,
216
216
  })
217
217
 
218
- if (_.has(rotates, vrotate)) {
218
+ if ($n.has(rotates, vrotate)) {
219
219
  json.o = rotates[vrotate]
220
220
  }
221
221
 
@@ -263,9 +263,9 @@ export default async function ({ waitUploadFileLists, uploadFileLists, checkFile
263
263
  // 【8】旋转 270 度(宽高反转)
264
264
  'left-bottom': 8,
265
265
  }
266
- if (orientation && _.isString(orientation)) {
267
- const key = _.trim(orientation).toLowerCase()
268
- if (_.has(orientations, key)) {
266
+ if (orientation && $n.isString(orientation)) {
267
+ const key = $n.trim(orientation).toLowerCase()
268
+ if ($n.has(orientations, key)) {
269
269
  json.o = orientations[key]
270
270
  }
271
271
  }
@@ -305,7 +305,7 @@ export default async function ({ waitUploadFileLists, uploadFileLists, checkFile
305
305
  Object.assign(fileItem, query)
306
306
 
307
307
  return Object.assign({}, query, {
308
- json: utils.isValidObject(json) ? JSON.stringify(json) : ''
308
+ json: $n.isValidObject(json) ? JSON.stringify(json) : ''
309
309
  })
310
310
  }
311
311
  }
package/utils/useAuth.js CHANGED
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export function initAuthStore() {
5
5
  // 获取管理员信息缓存
6
- const cache = utils.cookie.get('_tk')
6
+ const cache = $n.cookie.get('_tk')
7
7
  return checkAdminUserInfo(cache) ? cache : {
8
8
  id: 0,
9
9
  isLogin: false,
@@ -15,7 +15,7 @@ export function initAuthStore() {
15
15
  * 验证管理员信息
16
16
  */
17
17
  export function checkAdminUserInfo(data) {
18
- return ! utils.validator(data, {
18
+ return ! $n.validator(data, {
19
19
  // 管理员 id
20
20
  id: 'required|natural_no_zero',
21
21
  // 登录 token
@@ -9,18 +9,18 @@ export function getRouters(mainRouter, errorRouter) {
9
9
  mainRouter
10
10
  ]
11
11
 
12
- utils.forIn(routers, function(item, key) {
12
+ $n.forIn(routers, function(item, key) {
13
13
 
14
14
  // 如果没有 meta
15
- if (! _.has(item, 'meta')) {
15
+ if (! $n.has(item, 'meta')) {
16
16
  item.meta = {}
17
17
  }
18
18
 
19
19
  // path
20
- item.path = utils.slash(key, 'start', true)
20
+ item.path = $n.slash(key, 'start', true)
21
21
 
22
22
  // 如果是单独路由
23
- if (_.get(item.meta, 'parent') === false) {
23
+ if ($n.get(item.meta, 'parent') === false) {
24
24
  routes.push(item)
25
25
 
26
26
  // 否则为框架页面