n20-common-lib 2.7.66 → 2.7.68

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.66",
3
+ "version": "2.7.68",
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": {
@@ -123,4 +124,4 @@
123
124
  "last 2 versions",
124
125
  "not dead"
125
126
  ]
126
- }
127
+ }
@@ -110,13 +110,17 @@ export default {
110
110
  }
111
111
  },
112
112
  data() {
113
- return {
114
- errorV: false
115
- }
113
+ return {}
116
114
  },
117
- watch: {
118
- validateDialog(val) {
119
- this.errorV = val
115
+ computed: {
116
+ errorV: {
117
+ get() {
118
+ return this.validateDialog
119
+ },
120
+ set(v) {
121
+ this.$emit('update:validateDialog', v)
122
+ return v
123
+ }
120
124
  }
121
125
  },
122
126
  methods: {
@@ -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(() => {