system-phone 3.1.0 → 3.1.1
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 +1 -1
- package/src/components/LoginAppV4.vue +72 -88
- package/src/stores/AppData.js +0 -12
package/package.json
CHANGED
|
@@ -59,7 +59,6 @@
|
|
|
59
59
|
*
|
|
60
60
|
*/
|
|
61
61
|
|
|
62
|
-
|
|
63
62
|
import Vue from 'vue'
|
|
64
63
|
import * as Util from '../Util'
|
|
65
64
|
import JSEncrypt from 'jsencrypt'
|
|
@@ -67,21 +66,22 @@ import JSEncrypt from 'jsencrypt'
|
|
|
67
66
|
let asyncReady = async function (self, url) {
|
|
68
67
|
// 获取配置信息
|
|
69
68
|
try {
|
|
70
|
-
console.log(
|
|
69
|
+
console.log('获取营收配置文件和参数【开始】')
|
|
71
70
|
await self.$appdata.load()
|
|
72
|
-
console.log(
|
|
71
|
+
console.log('获取营收配置文件和参数【结束】,开始获取vue配置文件【开始】')
|
|
73
72
|
let that = self
|
|
74
73
|
let res = await Vue.resetget(`${url}/phone/rs/vue`, {data: {}}, {resolveMsg: null, rejectMsg: null})
|
|
75
74
|
that.$set('config', res.data)
|
|
76
75
|
Vue.config2 = res.data
|
|
77
76
|
// 判断是否需要弱密码校验
|
|
78
|
-
if (self.config && self.config.telephone && self.config.telephone.LoginApp &&
|
|
77
|
+
if (self.config && self.config.telephone && self.config.telephone.LoginApp && 'undefined' != typeof self.config.telephone.LoginApp.weakPassword) {
|
|
79
78
|
self.weakPassword = self.config.telephone.LoginApp.weakPassword
|
|
80
79
|
}
|
|
81
|
-
console.log(
|
|
80
|
+
console.log('手机端获取.json文件')
|
|
82
81
|
console.log(JSON.stringify(self.config))
|
|
83
82
|
return true
|
|
84
83
|
} catch (error) {
|
|
84
|
+
console.log(error)
|
|
85
85
|
// 此处业务数据装载异常不做任何处理,理论上不会有任何异常
|
|
86
86
|
self.$showMessage('登录系统: 获取配置文件失败,请检查网络后重新登陆!')
|
|
87
87
|
return false
|
|
@@ -108,7 +108,7 @@ let asyncLoadData = async function (self, url) {
|
|
|
108
108
|
|
|
109
109
|
export default {
|
|
110
110
|
title: '登录系统',
|
|
111
|
-
data() {
|
|
111
|
+
data () {
|
|
112
112
|
return {
|
|
113
113
|
loaderShow: false,
|
|
114
114
|
config: {},
|
|
@@ -127,7 +127,7 @@ export default {
|
|
|
127
127
|
}
|
|
128
128
|
},
|
|
129
129
|
|
|
130
|
-
ready() {
|
|
130
|
+
ready () {
|
|
131
131
|
if (Vue.android) {
|
|
132
132
|
const userCache = this.$androidUtil.getPreference('login_user_cache')
|
|
133
133
|
this.showauto = this.$androidUtil.getPreference('auto_login')
|
|
@@ -146,20 +146,20 @@ export default {
|
|
|
146
146
|
}
|
|
147
147
|
},
|
|
148
148
|
methods: {
|
|
149
|
-
success(val) {
|
|
149
|
+
success (val) {
|
|
150
150
|
// 修改密码成功
|
|
151
151
|
this.modifyPassword = false
|
|
152
152
|
this.password = val
|
|
153
153
|
},
|
|
154
154
|
// 对资源菜单进行排序
|
|
155
|
-
sortFunctions(val) {
|
|
155
|
+
sortFunctions (val) {
|
|
156
156
|
if (val && val.length > 0) {
|
|
157
157
|
for (var i = 0; i < val.length - 1; i++) {
|
|
158
158
|
for (var j = 0; j < val.length - 1 - i; j++) {
|
|
159
159
|
if (val[j].position > val[j + 1].position) {
|
|
160
160
|
var temp = val[j + 1]
|
|
161
161
|
val[j + 1] = val[j]
|
|
162
|
-
val[j] = temp
|
|
162
|
+
val[j] = temp
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
}
|
|
@@ -168,58 +168,68 @@ export default {
|
|
|
168
168
|
return val
|
|
169
169
|
},
|
|
170
170
|
// 记住密码选中/未选中
|
|
171
|
-
showoff() {
|
|
171
|
+
showoff () {
|
|
172
172
|
this.showsave = false
|
|
173
173
|
},
|
|
174
|
-
showon() {
|
|
174
|
+
showon () {
|
|
175
175
|
this.showsave = true
|
|
176
176
|
},
|
|
177
|
-
showoff1() {
|
|
177
|
+
showoff1 () {
|
|
178
178
|
this.showauto = '2'
|
|
179
179
|
},
|
|
180
|
-
showon1() {
|
|
180
|
+
showon1 () {
|
|
181
181
|
this.showauto = '1'
|
|
182
182
|
},
|
|
183
|
-
changepass() {
|
|
183
|
+
changepass () {
|
|
184
184
|
this.showpass = this.showpass ? false : true
|
|
185
185
|
if (this.showpass) {
|
|
186
|
-
this.imageurl = require(
|
|
186
|
+
this.imageurl = require('../assets/mingwen.png')
|
|
187
187
|
} else {
|
|
188
|
-
this.imageurl = require(
|
|
188
|
+
this.imageurl = require('../assets/miwen.png')
|
|
189
189
|
}
|
|
190
190
|
},
|
|
191
|
-
async confirm() {
|
|
191
|
+
async confirm () {
|
|
192
192
|
this.loaderShow = true
|
|
193
193
|
// 判断用户状态
|
|
194
|
-
let users = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/tel_singleTable_OrderBy`,{
|
|
195
|
-
data: {
|
|
196
|
-
|
|
194
|
+
let users = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/tel_singleTable_OrderBy`, {
|
|
195
|
+
data: {
|
|
196
|
+
items: '*',
|
|
197
|
+
tablename: 't_user',
|
|
198
|
+
orderitem: 'id desc',
|
|
199
|
+
condition: `ename = '${this.ename}' and (state='在职' or name like '%超级管理员%')`
|
|
200
|
+
}
|
|
201
|
+
}, {resolveMsg: null, rejectMsg: null})
|
|
197
202
|
if (users.data.length == 0) {
|
|
198
203
|
this.loaderShow = false
|
|
199
|
-
this.$showMessage(
|
|
204
|
+
this.$showMessage('登陆失败,用户不存在')
|
|
200
205
|
return
|
|
201
206
|
}
|
|
202
207
|
console.log('Vue.android:' + Vue.android)
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
Vue.dataUrl = this.$androidUtil.getProxyUrl() + "/"
|
|
206
|
-
// rsa加密
|
|
207
|
-
let encrypt = new JSEncrypt();
|
|
208
|
-
encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPvovSfXcwBbW8cKMCgwqNpsYuzF8RPAPFb7LGsnVo44JhM/xxzDyzoYtdfNmtbIuKVi9PzIsyp6rg+09gbuI6UGwBZ5DWBDBMqv5MPdOF5dCQkB2Bbr5yPfURPENypUz+pBFBg41d+BC+rwRiXELwKy7Y9caD/MtJyHydj8OUwIDAQAB');
|
|
209
|
-
const userDataEncrypt = encrypt.encrypt(JSON.stringify(userData))
|
|
210
|
-
console.log("加密后的用户登录信息", userDataEncrypt)
|
|
208
|
+
Vue.dataUrl = this.$androidUtil.getProxyUrl() + '/'
|
|
209
|
+
let loginData = {}
|
|
211
210
|
try {
|
|
212
211
|
let ret = {}
|
|
213
212
|
try {
|
|
214
|
-
ret = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/
|
|
213
|
+
ret = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/api/af-auth/login`, {
|
|
214
|
+
username: this.ename, password: this.password,
|
|
215
|
+
resourceName: '手机服务'
|
|
216
|
+
}, {
|
|
215
217
|
resolveMsg: null,
|
|
216
|
-
rejectMsg: null
|
|
218
|
+
rejectMsg: null,
|
|
219
|
+
headerConfig: {'Content-type': 'application/json'}
|
|
217
220
|
})
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
221
|
+
console.log(ret, '==')
|
|
222
|
+
if (ret.data) {
|
|
223
|
+
if (ret.data.resources.data && ret.data.resources.data.id) {
|
|
224
|
+
loginData = ret.data.resources.data
|
|
225
|
+
} else {
|
|
226
|
+
loginData = ret.data.resources
|
|
227
|
+
}
|
|
228
|
+
this.$androidUtil.setPreference('siteId', loginData.f_extend1 || '')
|
|
229
|
+
this.$androidUtil.setPreference('flatId', loginData.f_extend2 || '')
|
|
230
|
+
this.$androidUtil.setPreference('name', loginData.name || '')
|
|
231
|
+
this.$androidUtil.setPreference('ename', loginData.ename || '')
|
|
232
|
+
} else {
|
|
223
233
|
throw {status: ret.data.code, message: ret.data.msg}
|
|
224
234
|
}
|
|
225
235
|
} catch (e) {
|
|
@@ -231,11 +241,7 @@ export default {
|
|
|
231
241
|
}
|
|
232
242
|
|
|
233
243
|
// 设置登录人
|
|
234
|
-
|
|
235
|
-
Vue.user = Util.f = ret.data.data
|
|
236
|
-
} else {
|
|
237
|
-
Vue.user = Util.f = ret.data
|
|
238
|
-
}
|
|
244
|
+
Vue.user = Util.f = loginData
|
|
239
245
|
|
|
240
246
|
// 对资源菜单进行排序
|
|
241
247
|
let viewDetails = await Vue.resetpost(`${this.$androidUtil.getProxyUrl()}/rs/search`, {
|
|
@@ -246,12 +252,7 @@ export default {
|
|
|
246
252
|
Vue.user.r = []
|
|
247
253
|
rithtList.forEach(x => Vue.user.r.push(x.name))
|
|
248
254
|
// 功能排序
|
|
249
|
-
|
|
250
|
-
Vue.functions = this.sortFunctions(ret.data.data.functions)
|
|
251
|
-
} else {
|
|
252
|
-
Vue.functions = this.sortFunctions(ret.data.functions)
|
|
253
|
-
}
|
|
254
|
-
console.log('登陆人信息', JSON.stringify(Vue.user))
|
|
255
|
+
Vue.functions = this.sortFunctions(loginData.functions)
|
|
255
256
|
let userStr
|
|
256
257
|
if (Vue.android) {
|
|
257
258
|
console.log(`Device_IEMI:${this.$androidUtil.getPreference('Device_IEMI')}`)
|
|
@@ -283,45 +284,28 @@ export default {
|
|
|
283
284
|
this.$androidUtil.setPreference('f_repairman_name', Util.f.name)
|
|
284
285
|
this.$androidUtil.setPreference('f_orgid', Util.f.orgid)
|
|
285
286
|
this.$androidUtil.setPreference('f_role_name', Util.f.f_role_name || '')
|
|
286
|
-
console.log(
|
|
287
|
+
console.log('自动登陆标识' + Util.f.f_role_name)
|
|
287
288
|
console.log(this.showauto)
|
|
288
289
|
this.$androidUtil.setPreference('auto_login', this.showauto)
|
|
289
290
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
} else {
|
|
309
|
-
Vue.$login = Vue.prototype.$login = {jwt: ret.data.id,
|
|
310
|
-
toStandardDateString () {
|
|
311
|
-
let dt = new Date()
|
|
312
|
-
let month = dt.getMonth() + 1
|
|
313
|
-
let date = dt.getDate()
|
|
314
|
-
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
|
|
315
|
-
}, toStandardTimeString () {
|
|
316
|
-
let dt = new Date()
|
|
317
|
-
let month = dt.getMonth()+1
|
|
318
|
-
let date = dt.getDate()
|
|
319
|
-
let hour = dt.getHours()
|
|
320
|
-
let min = dt.getMinutes()
|
|
321
|
-
let sec = dt.getSeconds()
|
|
322
|
-
return dt.getFullYear() + '-' + (month<10? '0'+ month : month) + '-' + (date<10? '0'+ date : date)
|
|
323
|
-
+ ' ' + (hour<10? '0'+ hour : hour) + ':' + (min<10? '0'+ min : min) + ':' + (sec<10? '0'+ sec : sec)
|
|
324
|
-
}}
|
|
291
|
+
Vue.$login = Vue.prototype.$login = {
|
|
292
|
+
jwt: loginData.id,
|
|
293
|
+
jwtNew: ret.data.access_token,
|
|
294
|
+
toStandardDateString () {
|
|
295
|
+
let dt = new Date()
|
|
296
|
+
let month = dt.getMonth() + 1
|
|
297
|
+
let date = dt.getDate()
|
|
298
|
+
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
|
|
299
|
+
}, toStandardTimeString () {
|
|
300
|
+
let dt = new Date()
|
|
301
|
+
let month = dt.getMonth() + 1
|
|
302
|
+
let date = dt.getDate()
|
|
303
|
+
let hour = dt.getHours()
|
|
304
|
+
let min = dt.getMinutes()
|
|
305
|
+
let sec = dt.getSeconds()
|
|
306
|
+
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
|
|
307
|
+
+ ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
|
|
308
|
+
}
|
|
325
309
|
}
|
|
326
310
|
// 获取参数
|
|
327
311
|
console.log('获取参数system以及安检参数')
|
|
@@ -344,13 +328,13 @@ export default {
|
|
|
344
328
|
if (Vue.android) {
|
|
345
329
|
this.loaderShow = false
|
|
346
330
|
}
|
|
347
|
-
console.error(
|
|
348
|
-
this.$showMessage(
|
|
331
|
+
console.error('登录异常,LoginApp的confirm函数错误', e)
|
|
332
|
+
this.$showMessage('登陆失败!,')
|
|
349
333
|
}
|
|
350
|
-
}
|
|
334
|
+
}
|
|
351
335
|
},
|
|
352
336
|
watch: {
|
|
353
|
-
'config'(val) {
|
|
337
|
+
'config' (val) {
|
|
354
338
|
Vue.config = val
|
|
355
339
|
}
|
|
356
340
|
}
|
package/src/stores/AppData.js
CHANGED
|
@@ -13,18 +13,11 @@ let GetAppDataService = {
|
|
|
13
13
|
url1 = `${Vue.androidUtil.getProxyUrl()}/api/af-system/logic/getInitData`
|
|
14
14
|
}
|
|
15
15
|
let result = await new HttpResetClass().load('POST',url1, {data: {f_filialeids: Vue.user.orgid}}, {resolveMsg: null, rejectMsg: null})
|
|
16
|
-
console.log('system加载参数')
|
|
17
16
|
console.log(JSON.stringify(result))
|
|
18
17
|
let newdata = {
|
|
19
18
|
singleValues : result.data.singleValues,
|
|
20
19
|
params: result.data.params
|
|
21
20
|
}
|
|
22
|
-
if(Vue.isv4 && result.data.code == 200){
|
|
23
|
-
newdata = {
|
|
24
|
-
singleValues : result.data.data.singleValues,
|
|
25
|
-
params: result.data.data.params
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
21
|
newdata.singleValues.forEach((item) => {
|
|
29
22
|
this.singleValues[item.name] = item.value
|
|
30
23
|
})
|
|
@@ -48,11 +41,6 @@ let GetAppDataService = {
|
|
|
48
41
|
let newsaledata = {
|
|
49
42
|
gasbrands : getParams.data.gasbrands
|
|
50
43
|
}
|
|
51
|
-
if(Vue.isv4 && getParams.data.code == 200){
|
|
52
|
-
newsaledata = {
|
|
53
|
-
gasbrands : getParams.data.data.gasbrands
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
44
|
if (newsaledata) {
|
|
57
45
|
newsaledata.gasbrands.forEach((item, index) => {
|
|
58
46
|
this.saleParams.gasbrands[index] = {}
|