Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
kd_app_vue
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhanglw
kd_app_vue
Commits
91f4a8d2
Commit
91f4a8d2
authored
May 09, 2023
by
zhanglw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复退出异常
parent
61ffaa92
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
145 additions
and
132 deletions
+145
-132
config.js
src/config.js
+6
-6
Login.vue
src/views/Login.vue
+41
-84
Login__.vue
src/views/Login__.vue
+84
-41
index.vue
src/views/MLargeScreen/components/personalCenter/index.vue
+2
-1
index.vue
src/views/MLargeScreen/index.vue
+12
-0
No files found.
src/config.js
View file @
91f4a8d2
// 项目配置相关
// 项目配置相关
const
config
=
{
const
config
=
{
//ganxu
//ganxu
BASE_URL
:
'
http://192.168.3.23:9092
'
,
//
BASE_URL: 'http://192.168.3.23:9092',
REAL_URL
:
'
http://192.168.3.23:9092
'
,
//
REAL_URL: 'http://192.168.3.23:9092',
ws
:
'
8.143.203.103:9092
'
,
//
ws: '8.143.203.103:9092',
//服务器
//服务器
// BASE_URL: 'http://8.143.203.103:9092',
// BASE_URL: 'http://8.143.203.103:9092',
// REAL_URL: 'http://8.143.203.103:9092',
// REAL_URL: 'http://8.143.203.103:9092',
//
BASE_URL: 'http://39.164.225.220:5000',
BASE_URL
:
'
http://39.164.225.220:5000
'
,
//
REAL_URL: 'http://39.164.225.220:5000',
REAL_URL
:
'
http://39.164.225.220:5000
'
,
//
ws: '39.164.225.220:5000',
ws
:
'
39.164.225.220:5000
'
,
TOKEN_KEY
:
'
token
'
,
TOKEN_KEY
:
'
token
'
,
USER_KEY
:
'
userInfo
'
,
USER_KEY
:
'
userInfo
'
,
...
...
src/views/Login.vue
View file @
91f4a8d2
...
@@ -56,8 +56,8 @@ export default {
...
@@ -56,8 +56,8 @@ export default {
data
()
{
data
()
{
return
{
return
{
loginForm
:
{
loginForm
:
{
username
:
""
,
username
:
"
testkc
"
,
password
:
""
,
password
:
"
123456
"
,
uuid
:
""
,
uuid
:
""
,
},
},
loading
:
false
,
loading
:
false
,
...
@@ -65,7 +65,8 @@ export default {
...
@@ -65,7 +65,8 @@ export default {
keyboardShowType
:
""
,
keyboardShowType
:
""
,
//设备OAID testkc test999
//设备OAID testkc test999
//testcc deviceOAID: "test888",
//testcc deviceOAID: "test888",
deviceOAID
:
""
,
// deviceOAID: "test999",
deviceOAID
:
"
140945db5f9b8e04
"
,
//判断设备是否与车绑定
//判断设备是否与车绑定
bindingStatus
:
false
,
bindingStatus
:
false
,
//绑定的车牌号
//绑定的车牌号
...
@@ -79,18 +80,17 @@ export default {
...
@@ -79,18 +80,17 @@ export default {
this
.
getCookie
();
this
.
getCookie
();
},
},
mounted
()
{
mounted
()
{
console
.
log
(
window
,
1111111
);
//两种方法相互冲突,每次只需要一种,并且获取的id不一样
//两种方法相互冲突,每次只需要一种,并且获取的id不一样
//app获取设备号方法
//app获取设备号方法
this
.
appGetDeviceId
();
//
this.appGetDeviceId();
//5+app获取OAID方法
//5+app获取OAID方法
//
if (window.plus) {
if
(
window
.
plus
)
{
//
this.plusReady();
this
.
plusReady
();
//
} else {
}
else
{
//
document.addEventListener("plusready", this.plusReady, false);
document
.
addEventListener
(
"
plusready
"
,
this
.
plusReady
,
false
);
//
}
}
},
},
components
:
{
components
:
{
// Keyboard
// Keyboard
...
@@ -98,45 +98,41 @@ export default {
...
@@ -98,45 +98,41 @@ export default {
methods
:
{
methods
:
{
//app获取设备号方法
//app获取设备号方法
appGetDeviceId
()
{
appGetDeviceId
()
{
let
that
=
this
;
// let that = this;
let
appDeviceId1
=
window
.
Device
.
getDeviceId
();
// let appDeviceId1 = window.Device.getDeviceId();
// let appDeviceId1 = window.Device.getDeviceId();
if
(
appDeviceId1
)
{
// // let appDeviceId1 = window.Device.getDeviceId();
that
.
deviceOAID
=
appDeviceId1
;
// console.log("app设备号", window.Device);
//查询设备表是否存在该设备编号
// if (appDeviceId1) {
httpGet
(
apiEquipmentQuery
,
{
name
:
that
.
deviceOAID
}).
then
(
// that.deviceOAID = appDeviceId1;
(
resSheiBei
)
=>
{
// //查询设备表是否存在该设备编号
if
(
resSheiBei
.
code
==
200
&&
resSheiBei
.
data
.
totalElements
!=
0
)
{
// httpGet(apiEquipmentQuery, { name: that.deviceOAID }).then(
//查询车辆表中设备是否与车辆绑定
// (resSheiBei) => {
httpGet
(
vehicleInformationQuery
,
{
// if (resSheiBei.code == 200 && resSheiBei.data.totalElements != 0) {
equipmentName
:
that
.
deviceOAID
,
// //查询车辆表中设备是否与车辆绑定
}).
then
((
resCar
)
=>
{
// httpGet(vehicleInformationQuery, {
if
(
resCar
.
code
==
200
&&
resCar
.
data
.
totalElements
!=
0
)
{
// equipmentName: that.deviceOAID,
that
.
bindingStatus
=
true
;
// }).then((resCar) => {
}
else
{
// if (resCar.code == 200 && resCar.data.totalElements != 0) {
that
.
bindingStatus
=
false
;
// that.bindingStatus = true;
}
// } else {
});
// that.bindingStatus = false;
}
else
{
// }
httpPostForJson
(
apiEquipmentQuery
,
{
// });
name
:
that
.
deviceOAID
,
// } else {
status
:
"
正常
"
,
// httpPostForJson(apiEquipmentQuery, {
}).
then
((
res
)
=>
{
// name: that.deviceOAID,
that
.
bindingStatus
=
false
;
// status: "正常",
});
// }).then((res) => {
}
// that.bindingStatus = false;
}
// });
);
// }
}
// }
// );
// }
},
},
//5+app获取OAID方法
//5+app获取OAID方法
plusReady
()
{
plusReady
()
{
let
that
=
this
;
// let that = this;
console
.
log
(
"
设备身份码:
"
+
plus
.
device
.
imei
);
console
.
log
(
"
用户识别码:
"
+
plus
.
device
.
imsi
);
console
.
log
(
"
设备型号信息:
"
+
plus
.
device
.
model
);
console
.
log
(
"
设备厂商信息:
"
+
plus
.
device
.
vendor
);
console
.
log
(
"
设备唯一标识号:
"
+
plus
.
device
.
uuid
);
// plus.device.getOAID({
// plus.device.getOAID({
// success: function (e) {
// success: function (e) {
// console.log("oaid", e.oaid);
// console.log("oaid", e.oaid);
...
@@ -174,45 +170,6 @@ export default {
...
@@ -174,45 +170,6 @@ export default {
// that.bindingStatus = false;
// that.bindingStatus = false;
// },
// },
// });
// });
//无法获取oaid的设备尝试获取uuid或imei
plus
.
device
.
getInfo
({
success
:
function
(
e
){
console
.
log
(
'
getDeviceInfo success:
'
+
JSON
.
stringify
(
e
));
that
.
deviceOAID
=
e
.
uuid
;
//查询设备表是否存在该设备编号
httpGet
(
apiEquipmentQuery
,
{
name
:
that
.
deviceOAID
}).
then
(
(
resSheiBei
)
=>
{
if
(
resSheiBei
.
code
==
200
&&
resSheiBei
.
data
.
totalElements
!=
0
)
{
//查询车辆表中设备是否与车辆绑定
httpGet
(
vehicleInformationQuery
,
{
equipmentName
:
that
.
deviceOAID
,
}).
then
((
resCar
)
=>
{
if
(
resCar
.
code
==
200
&&
resCar
.
data
.
totalElements
!=
0
)
{
that
.
bindingStatus
=
true
;
}
else
{
that
.
bindingStatus
=
false
;
}
});
}
else
{
httpPostForJson
(
apiEquipmentQuery
,
{
name
:
that
.
deviceOAID
,
status
:
"
正常
"
,
}).
then
((
res
)
=>
{
that
.
bindingStatus
=
false
;
});
}
}
);
},
fail
:
function
(
e
){
console
.
log
(
'
getDeviceInfo failed:
'
+
JSON
.
stringify
(
e
));
that
.
bindingStatus
=
false
;
}
});
},
},
getCode
()
{
getCode
()
{
httpGet
(
code
).
then
((
res
)
=>
{
httpGet
(
code
).
then
((
res
)
=>
{
...
...
src/views/Login_.vue
→
src/views/Login_
_
.vue
View file @
91f4a8d2
...
@@ -56,8 +56,8 @@ export default {
...
@@ -56,8 +56,8 @@ export default {
data
()
{
data
()
{
return
{
return
{
loginForm
:
{
loginForm
:
{
username
:
"
testkc
"
,
username
:
""
,
password
:
"
123456
"
,
password
:
""
,
uuid
:
""
,
uuid
:
""
,
},
},
loading
:
false
,
loading
:
false
,
...
@@ -65,8 +65,7 @@ export default {
...
@@ -65,8 +65,7 @@ export default {
keyboardShowType
:
""
,
keyboardShowType
:
""
,
//设备OAID testkc test999
//设备OAID testkc test999
//testcc deviceOAID: "test888",
//testcc deviceOAID: "test888",
deviceOAID
:
"
test999
"
,
deviceOAID
:
""
,
// deviceOAID: "140945db5f9b8e04",
//判断设备是否与车绑定
//判断设备是否与车绑定
bindingStatus
:
false
,
bindingStatus
:
false
,
//绑定的车牌号
//绑定的车牌号
...
@@ -80,17 +79,18 @@ export default {
...
@@ -80,17 +79,18 @@ export default {
this
.
getCookie
();
this
.
getCookie
();
},
},
mounted
()
{
mounted
()
{
console
.
log
(
window
,
1111111
);
//两种方法相互冲突,每次只需要一种,并且获取的id不一样
//两种方法相互冲突,每次只需要一种,并且获取的id不一样
//app获取设备号方法
//app获取设备号方法
//
this.appGetDeviceId();
this
.
appGetDeviceId
();
//5+app获取OAID方法
//5+app获取OAID方法
if
(
window
.
plus
)
{
//
if (window.plus) {
this
.
plusReady
();
//
this.plusReady();
}
else
{
//
} else {
document
.
addEventListener
(
"
plusready
"
,
this
.
plusReady
,
false
);
//
document.addEventListener("plusready", this.plusReady, false);
}
//
}
},
},
components
:
{
components
:
{
// Keyboard
// Keyboard
...
@@ -98,41 +98,45 @@ export default {
...
@@ -98,41 +98,45 @@ export default {
methods
:
{
methods
:
{
//app获取设备号方法
//app获取设备号方法
appGetDeviceId
()
{
appGetDeviceId
()
{
// let that = this;
let
that
=
this
;
let
appDeviceId1
=
window
.
Device
.
getDeviceId
();
// let appDeviceId1 = window.Device.getDeviceId();
// let appDeviceId1 = window.Device.getDeviceId();
// // let appDeviceId1 = window.Device.getDeviceId();
if
(
appDeviceId1
)
{
// console.log("app设备号", window.Device);
that
.
deviceOAID
=
appDeviceId1
;
// if (appDeviceId1) {
//查询设备表是否存在该设备编号
// that.deviceOAID = appDeviceId1;
httpGet
(
apiEquipmentQuery
,
{
name
:
that
.
deviceOAID
}).
then
(
// //查询设备表是否存在该设备编号
(
resSheiBei
)
=>
{
// httpGet(apiEquipmentQuery, { name: that.deviceOAID }).then(
if
(
resSheiBei
.
code
==
200
&&
resSheiBei
.
data
.
totalElements
!=
0
)
{
// (resSheiBei) => {
//查询车辆表中设备是否与车辆绑定
// if (resSheiBei.code == 200 && resSheiBei.data.totalElements != 0) {
httpGet
(
vehicleInformationQuery
,
{
// //查询车辆表中设备是否与车辆绑定
equipmentName
:
that
.
deviceOAID
,
// httpGet(vehicleInformationQuery, {
}).
then
((
resCar
)
=>
{
// equipmentName: that.deviceOAID,
if
(
resCar
.
code
==
200
&&
resCar
.
data
.
totalElements
!=
0
)
{
// }).then((resCar) => {
that
.
bindingStatus
=
true
;
// if (resCar.code == 200 && resCar.data.totalElements != 0) {
}
else
{
// that.bindingStatus = true;
that
.
bindingStatus
=
false
;
// } else {
}
// that.bindingStatus = false;
});
// }
}
else
{
// });
httpPostForJson
(
apiEquipmentQuery
,
{
// } else {
name
:
that
.
deviceOAID
,
// httpPostForJson(apiEquipmentQuery, {
status
:
"
正常
"
,
// name: that.deviceOAID,
}).
then
((
res
)
=>
{
// status: "正常",
that
.
bindingStatus
=
false
;
// }).then((res) => {
});
// that.bindingStatus = false;
}
// });
}
// }
);
// }
}
// );
// }
},
},
//5+app获取OAID方法
//5+app获取OAID方法
plusReady
()
{
plusReady
()
{
// let that = this;
let
that
=
this
;
console
.
log
(
"
设备身份码:
"
+
plus
.
device
.
imei
);
console
.
log
(
"
用户识别码:
"
+
plus
.
device
.
imsi
);
console
.
log
(
"
设备型号信息:
"
+
plus
.
device
.
model
);
console
.
log
(
"
设备厂商信息:
"
+
plus
.
device
.
vendor
);
console
.
log
(
"
设备唯一标识号:
"
+
plus
.
device
.
uuid
);
// plus.device.getOAID({
// plus.device.getOAID({
// success: function (e) {
// success: function (e) {
// console.log("oaid", e.oaid);
// console.log("oaid", e.oaid);
...
@@ -170,6 +174,45 @@ export default {
...
@@ -170,6 +174,45 @@ export default {
// that.bindingStatus = false;
// that.bindingStatus = false;
// },
// },
// });
// });
//无法获取oaid的设备尝试获取uuid或imei
plus
.
device
.
getInfo
({
success
:
function
(
e
){
console
.
log
(
'
getDeviceInfo success:
'
+
JSON
.
stringify
(
e
));
that
.
deviceOAID
=
e
.
uuid
;
//查询设备表是否存在该设备编号
httpGet
(
apiEquipmentQuery
,
{
name
:
that
.
deviceOAID
}).
then
(
(
resSheiBei
)
=>
{
if
(
resSheiBei
.
code
==
200
&&
resSheiBei
.
data
.
totalElements
!=
0
)
{
//查询车辆表中设备是否与车辆绑定
httpGet
(
vehicleInformationQuery
,
{
equipmentName
:
that
.
deviceOAID
,
}).
then
((
resCar
)
=>
{
if
(
resCar
.
code
==
200
&&
resCar
.
data
.
totalElements
!=
0
)
{
that
.
bindingStatus
=
true
;
}
else
{
that
.
bindingStatus
=
false
;
}
});
}
else
{
httpPostForJson
(
apiEquipmentQuery
,
{
name
:
that
.
deviceOAID
,
status
:
"
正常
"
,
}).
then
((
res
)
=>
{
that
.
bindingStatus
=
false
;
});
}
}
);
},
fail
:
function
(
e
){
console
.
log
(
'
getDeviceInfo failed:
'
+
JSON
.
stringify
(
e
));
that
.
bindingStatus
=
false
;
}
});
},
},
getCode
()
{
getCode
()
{
httpGet
(
code
).
then
((
res
)
=>
{
httpGet
(
code
).
then
((
res
)
=>
{
...
...
src/views/MLargeScreen/components/personalCenter/index.vue
View file @
91f4a8d2
...
@@ -157,6 +157,7 @@ export default {
...
@@ -157,6 +157,7 @@ export default {
putForJson
(
vehicleInformationUpdate
,{
id
:
res1
.
data
.
content
[
0
].
id
,
odo
:
0
,
oddStatus
:
1
,
workStatus
:
0
,
weightStatus
:
0
}).
then
((
res2
)
=>
{
putForJson
(
vehicleInformationUpdate
,{
id
:
res1
.
data
.
content
[
0
].
id
,
odo
:
0
,
oddStatus
:
1
,
workStatus
:
0
,
weightStatus
:
0
}).
then
((
res2
)
=>
{
//人员信息表中与车辆解绑
//人员信息表中与车辆解绑
putForJson
(
personalCenterInforQuery
,{
id
:
this
.
personalInformationData
.
id
,
car
:
''
}).
then
((
res3
)
=>
{
putForJson
(
personalCenterInforQuery
,{
id
:
this
.
personalInformationData
.
id
,
car
:
''
}).
then
((
res3
)
=>
{
this
.
logout
();
//删除调度单子
//删除调度单子
// httpGet(dingDanBiaoCaoZuo,{carNo:this.carnumber}).then((res3Del) => {
// httpGet(dingDanBiaoCaoZuo,{carNo:this.carnumber}).then((res3Del) => {
// if(res3Del.code == 200 && res3Del.data.content.length != 0){
// if(res3Del.code == 200 && res3Del.data.content.length != 0){
...
...
src/views/MLargeScreen/index.vue
View file @
91f4a8d2
...
@@ -1579,6 +1579,18 @@ export default {
...
@@ -1579,6 +1579,18 @@ export default {
clearInterval
(
this
.
zongTimer2
);
clearInterval
(
this
.
zongTimer2
);
this
.
zongTimer2
=
null
;
this
.
zongTimer2
=
null
;
}
}
if
(
this
.
posTimer
)
{
clearInterval
(
this
.
posTimer
);
this
.
posTimer
=
null
;
}
if
(
this
.
areaTimer
)
{
clearInterval
(
this
.
areaTimer
);
this
.
areaTimer
=
null
;
}
if
(
this
.
zongTimer3
)
{
clearInterval
(
this
.
zongTimer3
);
this
.
zongTimer3
=
null
;
}
},
},
};
};
</
script
>
</
script
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment