n20-common-lib 2.7.67 → 2.8.0

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": "n20-common-lib",
3
- "version": "2.7.67",
3
+ "version": "2.8.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -59,8 +59,9 @@
59
59
  "qrcode": "*",
60
60
  "resize-detector": "*",
61
61
  "strip-json-comments": "*",
62
- "vuedraggable": "*",
63
62
  "v-viewer": "1.6.4",
63
+ "vue-jsonp": "2.0.0",
64
+ "vuedraggable": "*",
64
65
  "xe-utils": "^3.5.11"
65
66
  },
66
67
  "devDependencies": {
@@ -52,6 +52,7 @@
52
52
  import { $lc } from '../../../utils/i18n/index.js'
53
53
  import auth from '../../../utils/auth.js'
54
54
  import axios from '../../../utils/axios.js'
55
+ import { jsonp } from 'vue-jsonp'
55
56
 
56
57
  export default {
57
58
  props: {
@@ -72,6 +73,7 @@ export default {
72
73
  newPassword: '',
73
74
  validatePassword: ''
74
75
  },
76
+ ipInfo:{},
75
77
  laoding: false
76
78
  }
77
79
  },
@@ -84,8 +86,33 @@ export default {
84
86
  },
85
87
  created() {
86
88
  this.getPwdRule()
89
+ this.getIpInfo()
87
90
  },
88
91
  methods: {
92
+ /**
93
+ * v1.12.0 增加第三方ip信息查询接口
94
+ */
95
+ getIpInfo() {
96
+ jsonp(`https://tbip.alicdn.com/api/queryip`).then(({code,data}) => {
97
+ if (code ===0) {
98
+ this.ipInfo = {
99
+ headers: {
100
+ reqIp: data?.ip,
101
+ reqAddr: encodeURIComponent(data?.region && data?.city ? `${data?.region}-${data?.city}`:data?.region ?data?.region:data?.city),
102
+ reqCountry: encodeURIComponent(data?.country),
103
+ }
104
+ }
105
+ }
106
+ }).catch(
107
+ this.ipInfo = {
108
+ headers: {
109
+ reqIp: '127.0.0.1',
110
+ reqAddr: encodeURIComponent('内网'),
111
+ reqCountry: encodeURIComponent('中国'),
112
+ }
113
+ }
114
+ )
115
+ },
89
116
  getPwdRule() {
90
117
  axios
91
118
  .post(
@@ -187,7 +214,8 @@ export default {
187
214
  {
188
215
  loading: () => {
189
216
  this.laoding = false
190
- }
217
+ },
218
+ ...this.ipInfo
191
219
  }
192
220
  )
193
221
  .then(() => {