bi-element-ui 1.6.3-beta.7 → 1.6.3-beta.9

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bi-element-ui",
3
- "version": "1.6.3-beta.7",
3
+ "version": "1.6.3-beta.9",
4
4
  "private": false,
5
5
  "description": "基于 bi-eleme 编写的企业级 Vue 2 UI 组件库",
6
6
  "main": "lib/bi-element-ui-externals.common.js",
@@ -88,7 +88,6 @@
88
88
  "autoprefixer": "^10.4.14",
89
89
  "babel-eslint": "^10.1.0",
90
90
  "babel-loader": "^9.1.2",
91
- "bi-eleme": "^2.4.5",
92
91
  "chai": "^4.3.7",
93
92
  "clean-webpack-plugin": "^4.0.0",
94
93
  "commitizen": "^4.3.0",
@@ -105,7 +104,6 @@
105
104
  "html-webpack-plugin": "^5.5.0",
106
105
  "image-webpack-loader": "^8.1.0",
107
106
  "mini-css-extract-plugin": "^2.7.5",
108
- "moment": "^2.29.4",
109
107
  "node-gyp": "^6.1.0",
110
108
  "postcss": "^8.4.21",
111
109
  "postcss-loader": "^7.1.0",
@@ -114,7 +112,6 @@
114
112
  "style-loader": "^3.3.2",
115
113
  "terser-webpack-plugin": "^5.3.7",
116
114
  "url-loader": "^4.1.1",
117
- "vue": "^2.7.14",
118
115
  "vue-loader": "^15.10.1",
119
116
  "vue-router": "^3.6.5",
120
117
  "vue-style-loader": "^4.1.3",
@@ -130,7 +127,8 @@
130
127
  "bi-eleme": "^2.4.5",
131
128
  "moment": "^2.29.4",
132
129
  "axios": "^0.19.2",
133
- "js-cookie": "^3.0.1"
130
+ "js-cookie": "^3.0.1",
131
+ "md5": "^2.3.0"
134
132
  },
135
133
  "peerDependenciesMeta": {
136
134
  "axios": {
@@ -34,6 +34,7 @@ var AccessReport = /** @class */ (function () {
34
34
  method: 'post',
35
35
  headers: {
36
36
  authorization: (0, tools_1.getToken)(),
37
+ 'zw-csrf-token': (0, tools_1.getCSFToken)(),
37
38
  'Login-Device': JSON.stringify(this.browserType())
38
39
  },
39
40
  data: data
@@ -1,5 +1,5 @@
1
1
  import request from '../utils/request/accessReport'
2
- import { getToken } from '../utils/tools'
2
+ import { getToken, getCSFToken } from '../utils/tools'
3
3
  class AccessReport {
4
4
  systemName = ''
5
5
  authorization = ''
@@ -33,6 +33,7 @@ class AccessReport {
33
33
  method: 'post',
34
34
  headers: {
35
35
  authorization: getToken(),
36
+ 'zw-csrf-token': getCSFToken(),
36
37
  'Login-Device': JSON.stringify(this.browserType())
37
38
  },
38
39
  data
@@ -360,15 +360,17 @@ export default {
360
360
  this.clickSearch()
361
361
  },
362
362
  initOptions() {
363
- this.$BiRequest({
364
- url: '/systemlog/options',
365
- method: 'post'
366
- }).then((res) => {
367
- if (res.status_code === 1) {
368
- this.optionsList.model = res.data.model
369
- this.optionsList.operate_name = res.data.operate_name
370
- }
371
- })
363
+ this.$BI
364
+ .request({
365
+ url: '/systemlog/options',
366
+ method: 'post'
367
+ })
368
+ .then((res) => {
369
+ if (res.status_code === 1) {
370
+ this.optionsList.model = res.data.model
371
+ this.optionsList.operate_name = res.data.operate_name
372
+ }
373
+ })
372
374
  },
373
375
  singleLogSearch() {},
374
376
  clickSearch() {
@@ -381,33 +383,35 @@ export default {
381
383
  },
382
384
  dataSearch() {
383
385
  this.tableLoading = true
384
- this.$BiRequest({
385
- url: '/systemlog/list',
386
- method: 'post',
387
- data: this.params
388
- }).then((res) => {
389
- if (res.status_code === 1) {
390
- if (this.params.page > 1) {
391
- if (res.data.data.length) {
386
+ this.$BI
387
+ .request({
388
+ url: '/systemlog/list',
389
+ method: 'post',
390
+ data: this.params
391
+ })
392
+ .then((res) => {
393
+ if (res.status_code === 1) {
394
+ if (this.params.page > 1) {
395
+ if (res.data.data.length) {
396
+ this.tableData = res.data.data
397
+ }
398
+ } else {
392
399
  this.tableData = res.data.data
393
400
  }
394
- } else {
395
- this.tableData = res.data.data
396
- }
397
- if (this.params.page >= this.pageCount) {
398
- if (res.data.data.length < this.formData.limit) {
399
- this.pageCount = this.params.page
400
- } else {
401
- this.pageCount = this.params.page + 1
401
+ if (this.params.page >= this.pageCount) {
402
+ if (res.data.data.length < this.formData.limit) {
403
+ this.pageCount = this.params.page
404
+ } else {
405
+ this.pageCount = this.params.page + 1
406
+ }
402
407
  }
403
- }
404
408
 
405
- this.tableData.map((item) => {
406
- this.$set(item, 'showLength', item.operates && item.operates.length > 3 ? 3 : 0)
407
- })
408
- }
409
- this.tableLoading = false
410
- })
409
+ this.tableData.map((item) => {
410
+ this.$set(item, 'showLength', item.operates && item.operates.length > 3 ? 3 : 0)
411
+ })
412
+ }
413
+ this.tableLoading = false
414
+ })
411
415
  },
412
416
  reset() {
413
417
  this.$set(this, 'formData', {
@@ -65,7 +65,7 @@ export default {
65
65
  this.WebSocketInit()
66
66
  const { needIcon, env, iconInit } = this.$BI
67
67
  if (needIcon && !iconInit) {
68
- loadIcon(getToken(), env, (data) => {
68
+ loadIcon(env, (data) => {
69
69
  this.$set(this.$BI, 'iconList', data.data)
70
70
  this.$set(this.$BI, 'iconInit', true)
71
71
  })
@@ -1,4 +1,4 @@
1
- import { getToken, getSystem, getEnv } from '../../utils/tools'
1
+ import { getToken, getSystem, getEnv, getCSFToken } from '../../utils/tools'
2
2
  import { getCurrentEnvURL } from '../../config/index'
3
3
  import request from '../../utils/request/defaultRequest'
4
4
 
@@ -8,6 +8,7 @@ export default class HeaderPopper {
8
8
  this.popperData = []
9
9
  this.module = moduleName || ''
10
10
  this.authorization = getToken()
11
+ this.csfToken = getCSFToken()
11
12
  this.system = getSystem()
12
13
  this.$BiEnv = getEnv()
13
14
  this.baseUrl = getCurrentEnvURL(this.$BiEnv || '').zhangquan.baseUrl
@@ -28,6 +29,7 @@ export default class HeaderPopper {
28
29
  method: 'post',
29
30
  headers: {
30
31
  Authorization: this.authorization,
32
+ 'zw-csrf-token': this.csfToken,
31
33
  System: this.system
32
34
  },
33
35
  data: {
@@ -60,6 +62,7 @@ export default class HeaderPopper {
60
62
  method: 'post',
61
63
  headers: {
62
64
  Authorization: this.authorization,
65
+ 'zw-csrf-token': this.csfToken,
63
66
  System: this.system
64
67
  },
65
68
  data: obj
@@ -78,6 +81,7 @@ export default class HeaderPopper {
78
81
  method: 'post',
79
82
  headers: {
80
83
  Authorization: this.authorization,
84
+ 'zw-csrf-token': this.csfToken,
81
85
  System: this.system
82
86
  },
83
87
  data: {
@@ -34,19 +34,19 @@ const BASE_URLS = {
34
34
  noticeCenterWebsocket: { baseUrl: 'wss://message.wanqudianchi.com/' },
35
35
  noticeCenter: { baseUrl: 'https://scenter.zwwlkj03.top/api' },
36
36
  downloadCenter: { baseUrl: 'https://export.zwwlkj03.top' },
37
- zhangquan: { baseUrl: 'https://zq.zwwlkj03.top/api/' }
37
+ zhangquan: { baseUrl: 'https://zq.zwwlkj03.top/api' }
38
38
  },
39
39
  [ENV_TYPES.PRODUCTION]: {
40
40
  noticeCenterWebsocket: { baseUrl: 'wss://message.zwnet.cn/' },
41
41
  noticeCenter: { baseUrl: 'https://scenter.wozhangwan.com/api' },
42
42
  downloadCenter: { baseUrl: 'https://export.wozhangwan.com' },
43
- zhangquan: { baseUrl: 'https://zq.wozhangwan.com/api/' }
43
+ zhangquan: { baseUrl: 'https://zq.wozhangwan.com/api' }
44
44
  },
45
45
  [ENV_TYPES.RELEASE]: {
46
46
  noticeCenterWebsocket: { baseUrl: 'wss://message.wanqudianchi.com/' },
47
- noticeCenter: { baseUrl: 'https://scenter.wozhangwan.com/api' },
47
+ noticeCenter: { baseUrl: 'https://scenter.zwwlkj03.top/api' },
48
48
  downloadCenter: { baseUrl: 'https://export.zwwlkj03.top' },
49
- zhangquan: { baseUrl: 'https://zq.zwwlkj03.top/api/' }
49
+ zhangquan: { baseUrl: 'https://zq.zwwlkj03.top/api' }
50
50
  }
51
51
  }
52
52
 
package/packages/index.js CHANGED
@@ -42,7 +42,8 @@ const checkDependencies = () => {
42
42
  const requiredDeps = [
43
43
  { name: 'Vue', global: 'Vue', package: 'vue@^2.6.0' },
44
44
  { name: 'ELEMENT', global: 'ELEMENT', package: 'bi-eleme@^2.4.5' },
45
- { name: 'moment', global: 'moment', package: 'moment@^2.29.4' }
45
+ { name: 'moment', global: 'moment', package: 'moment@^2.29.4' },
46
+ { name: 'md5', global: 'md5', package: 'md5@^2.3.0' }
46
47
  ]
47
48
 
48
49
  const missingDeps = []
@@ -109,19 +110,16 @@ const install = function (Vue, config = {}) {
109
110
  iconInit: false,
110
111
  iconList: {}
111
112
  }
112
- if (config && config.request) {
113
- Vue.prototype.$BiRequest = config.request
114
- }
115
113
  if (config && config.needIcon) {
116
114
  Vue.prototype.$BI.needIcon = true
117
115
  }
118
116
 
119
- Vue.prototype.$BiEnv = config.env || 'production'
117
+ // Vue.prototype.$BiEnv = config.env || 'production'
120
118
  Vue.prototype.$AccessReport = new AccessReport({ system: config.system, env: config.env || 'production' })
121
119
  window.$BI = Vue.prototype.$BI
122
120
  window.$AccessReport = Vue.prototype.$AccessReport
123
- window.$BiEnv = Vue.prototype.$BiEnv
124
- window.$BiSystem = Vue.prototype.$BiSystem
121
+ window.$BiEnv = Vue.prototype.$BI.env
122
+ window.$BiSystem = Vue.prototype.$BI.system
125
123
 
126
124
  Cookies.set('$BiEnv', config.env)
127
125
  Cookies.set('$BiSystem', config.system)
@@ -1,10 +1,11 @@
1
1
  import OSS from 'ali-oss'
2
- import { getToken, getSystem, getEnv, randomStr } from './tools'
2
+ import { getToken, getSystem, getEnv, randomStr, getCSFToken } from './tools'
3
3
  import { getCurrentEnvURL } from '../config/index'
4
4
  import request from './request/defaultRequest'
5
5
  import moment from 'moment'
6
6
  export default function ossUpload(file, config, progressCallback) {
7
7
  const authorization = getToken()
8
+ const csfToken = getCSFToken()
8
9
  const system = getSystem()
9
10
  const $BiEnv = getEnv()
10
11
 
@@ -29,6 +30,7 @@ export default function ossUpload(file, config, progressCallback) {
29
30
  method: 'post',
30
31
  headers: {
31
32
  Authorization: authorization,
33
+ 'zw-csrf-token': csfToken,
32
34
  System: system
33
35
  }
34
36
  }).then((result) => {
@@ -49,6 +51,7 @@ export default function ossUpload(file, config, progressCallback) {
49
51
  method: 'post',
50
52
  headers: {
51
53
  Authorization: authorization,
54
+ 'zw-csrf-token': csfToken,
52
55
  System: system
53
56
  }
54
57
  })
@@ -1,5 +1,6 @@
1
1
  import axios from 'axios'
2
2
  import { Message } from 'bi-eleme'
3
+ import { getToken, getCSFToken } from '../tools'
3
4
  // create an axios instance
4
5
 
5
6
  const service = axios.create({
@@ -11,6 +12,8 @@ const service = axios.create({
11
12
  service.interceptors.request.use(
12
13
  (config) => {
13
14
  config.headers['Content-Type'] = 'application/json'
15
+ config.headers['Authorization'] = getToken()
16
+ config.headers['zw-csrf-token'] = getCSFToken()
14
17
  return config
15
18
  },
16
19
  (error) => {
@@ -1,5 +1,6 @@
1
1
  import axios from 'axios'
2
2
  import { Message } from 'bi-eleme'
3
+ import { getToken, getCSFToken } from '../tools'
3
4
  // create an axios instance
4
5
 
5
6
  const service = axios.create({
@@ -11,6 +12,8 @@ const service = axios.create({
11
12
  service.interceptors.request.use(
12
13
  (config) => {
13
14
  config.headers['Content-Type'] = 'application/json'
15
+ config.headers['Authorization'] = getToken()
16
+ config.headers['zw-csrf-token'] = getCSFToken()
14
17
  return config
15
18
  },
16
19
  (error) => {
@@ -1,5 +1,6 @@
1
1
  import axios from 'axios'
2
2
  import { Message } from 'bi-eleme'
3
+ import { getToken, getCSFToken } from '../tools'
3
4
  // create an axios instance
4
5
 
5
6
  const service = axios.create({
@@ -11,6 +12,8 @@ const service = axios.create({
11
12
  service.interceptors.request.use(
12
13
  (config) => {
13
14
  config.headers['Content-Type'] = 'application/json'
15
+ config.headers['token'] = getToken()
16
+ config.headers['zw-csrf-token'] = getCSFToken()
14
17
  return config
15
18
  },
16
19
  (error) => {
@@ -1,5 +1,6 @@
1
1
  import axios from 'axios'
2
2
  import { Message } from 'bi-eleme'
3
+ import { getToken, getCSFToken } from '../tools'
3
4
 
4
5
  // create an axios instance
5
6
  const service = axios.create({
@@ -11,6 +12,8 @@ const service = axios.create({
11
12
  service.interceptors.request.use(
12
13
  (config) => {
13
14
  config.headers['Content-Type'] = 'application/json'
15
+ config.headers['Authtoken'] = getToken()
16
+ config.headers['zw-csrf-token'] = getCSFToken()
14
17
  return config
15
18
  },
16
19
  (error) => {
@@ -1,5 +1,6 @@
1
1
  import request from '../request/defaultRequest'
2
2
  import { getCurrentEnvURL } from '../../config/index'
3
+ import { getCSFToken, getToken } from '../tools'
3
4
 
4
5
  function getIconUrl(character, baseUrl) {
5
6
  return request({
@@ -10,11 +11,12 @@ function getIconUrl(character, baseUrl) {
10
11
  }
11
12
  })
12
13
  }
13
- function getIconList(baseUrl, authorization) {
14
+ function getIconList(baseUrl) {
14
15
  return request({
15
16
  headers: {
16
17
  AuthKey: 'authtpe84dzfl3iq62',
17
- authorization: authorization
18
+ authorization: getToken(),
19
+ 'zw-csrf-token': getCSFToken()
18
20
  },
19
21
  url: baseUrl + '/api/icon/list',
20
22
  method: 'post'
@@ -37,9 +39,9 @@ export function loadSvg(character, env) {
37
39
  }
38
40
  })
39
41
  }
40
- export function loadIcon(authorization, env, callback) {
42
+ export function loadIcon(env, callback) {
41
43
  const baseUrl = getCurrentEnvURL(env || '').zhangquan.baseUrl
42
- getIconList(baseUrl, authorization).then((res) => {
44
+ getIconList(baseUrl).then((res) => {
43
45
  if (res.status_code === 1) {
44
46
  callback(res.data)
45
47
  setTimeout(() => {
@@ -1,8 +1,13 @@
1
1
  import Cookies from 'js-cookie'
2
+ import md5 from 'md5'
2
3
 
3
4
  export function getToken(key = 'zw-authorization') {
4
5
  return Cookies.get(key)
5
6
  }
7
+ export function getCSFToken(key = 'zw-csrf-token') {
8
+ const token = Cookies.get(key)
9
+ return token ? md5(token) : ''
10
+ }
6
11
  export function getSystem(key = '$BiSystem') {
7
12
  return Cookies.get(key)
8
13
  }
@@ -1,57 +0,0 @@
1
- /* __placeholder__ */
2
- export default (await import('vue')).defineComponent({
3
- name: 'BiSystemLink',
4
- props: {
5
- request: {
6
- type: Function,
7
- default: () => {
8
- return () => {}
9
- }
10
- },
11
- test: {
12
- type: Function,
13
- default: () => {
14
- return () => {}
15
- }
16
- },
17
- token: {
18
- type: String,
19
- default: ''
20
- }
21
- },
22
- data() {
23
- return {
24
- systemList: []
25
- }
26
- },
27
- mounted() {
28
- // this.getZqToken()
29
- // this.getSystemList()
30
- },
31
- methods: {
32
- async getSystemList() {
33
- const res = await this.request({
34
- url: '/sys_common/system',
35
- method: 'post'
36
- })
37
- if (res.status_code === 1) {
38
- this.systemList = res.data
39
- }
40
- },
41
- async getZqToken() {
42
- const res = await this.request({
43
- url: '/sys_common/getZqToken',
44
- method: 'post'
45
- })
46
- if (res.status_code === 1) {
47
- this.zqToken = res.data
48
- }
49
- },
50
- goSystem({ link }) {
51
- const a = document.createElement('a')
52
- a.target = '_blank'
53
- a.href = link + '?authorization=' + this.token
54
- a.click()
55
- }
56
- }
57
- })