Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NewTruckTerminalSyetem
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
SQL_Mou
NewTruckTerminalSyetem
Commits
ccf18a0d
Commit
ccf18a0d
authored
Nov 15, 2022
by
xxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录前查询设备编号等操作
parent
cf2202d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
10 deletions
+68
-10
api.js
src/axios/api.js
+1
-0
Login.vue
src/views/Login.vue
+67
-10
No files found.
src/axios/api.js
View file @
ccf18a0d
...
...
@@ -45,3 +45,4 @@ export const apiPathmapNavigationQuery = '/api/Pathmap/navigation'; //获取关
export
const
apiManmadesRealCarQuery
=
'
/api/Manmades/RealCar
'
;
//点击车辆小弹框
export
const
apiManmadesChanJxQuery
=
'
/api/Manmades/ChanJx
'
;
//铲车绩效上面
export
const
apiManmadesChanCheRealQuery
=
'
/api/Manmades/ChanCheReal
'
;
//铲车车辆信息实时数据
export
const
apiEquipmentQuery
=
'
/api/Equipment
'
;
//获取设备表
src/views/Login.vue
View file @
ccf18a0d
...
...
@@ -30,7 +30,7 @@
></el-input>
</el-form-item>
</el-form>
<button
class=
"loginBtn"
@
click=
"
LoginInitiatio
n"
>
安全登录
</button>
<button
class=
"loginBtn"
@
click=
"
loginBeforeF
n"
>
安全登录
</button>
</div>
</div>
<!--
<keyboard
v-on:updatekey=
"GetKeyVal"
class=
"keyboardStyle"
v-show=
"keyboardShow"
></keyboard>
-->
...
...
@@ -39,7 +39,7 @@
<
script
>
import
{
httpGet
,
httpPostForJson
}
from
"
@/common/httpBean.js
"
;
import
{
login
,
code
}
from
"
@/axios/api.js
"
;
import
{
login
,
code
,
apiEquipmentQuery
,
vehicleInformationQuery
}
from
"
@/axios/api.js
"
;
import
{
encrypt
}
from
"
@/utils/rsaEncrypt.js
"
;
import
Cookies
from
"
js-cookie
"
;
import
{
config
as
appConfig
}
from
"
../config.js
"
;
...
...
@@ -60,6 +60,8 @@ export default {
keyboardShowType
:
''
,
//设备OAID
deviceOAID
:
''
,
//判断设备是否与车绑定
bindingStatus
:
false
,
};
},
created
()
{
...
...
@@ -84,7 +86,35 @@ export default {
success
:
function
(
e
){
console
.
log
(
e
.
oaid
);
this
.
deviceOAID
=
e
.
oaid
;
//查询设备表是否存在该设备编号
httpGet
(
apiEquipmentQuery
,{
name
:
this
.
deviceOAID
}).
then
((
resSheiBei
)
=>
{
if
(
resSheiBei
.
code
==
200
&&
resSheiBei
.
data
.
totalElements
!=
0
){
//查询车辆表中设备是否与车辆绑定
httpGet
(
vehicleInformationQuery
,{
equipmentName
:
this
.
deviceOAID
}).
then
((
resCar
)
=>
{
if
(
resCar
.
code
==
200
&&
resCar
.
data
.
totalElements
!=
0
){
this
.
$message
({
message
:
"
设备检索完毕,可进行登录!
"
,
type
:
'
success
'
});
this
.
bindingStatus
=
true
;
}
else
{
this
.
$message
({
message
:
"
请在后台系统中将该设备与车辆绑定后再进行登录!
"
,
type
:
'
error
'
});
this
.
bindingStatus
=
false
;
}
})
}
else
{
httpPostForJson
(
apiEquipmentQuery
,{
name
:
this
.
deviceOAID
,
status
:
'
正常
'
}).
then
((
res
)
=>
{
this
.
$message
({
message
:
"
请在后台系统中将该设备与车辆绑定后再进行登录!
"
,
type
:
'
error
'
});
this
.
bindingStatus
=
false
;
})
}
});
},
fail
:
function
(
e
){
console
.
log
(
'
getDeviceInfo failed:
'
+
JSON
.
stringify
(
e
));
...
...
@@ -92,12 +122,12 @@ export default {
message
:
"
获取设备信息失败,请退出系统并且开启权限后重试!
"
,
type
:
'
error
'
});
this
.
bindingStatus
=
false
;
}
})
},
getCode
()
{
httpGet
(
code
).
then
((
res
)
=>
{
//console.log(res);
this
.
loginForm
.
uuid
=
res
.
uuid
;
});
},
...
...
@@ -112,6 +142,35 @@ export default {
password
:
password
,
}
},
//登录前操作判断
loginBeforeFn
()
{
httpGet
(
apiEquipmentQuery
,{
name
:
this
.
deviceOAID
}).
then
((
resSheiBei
)
=>
{
if
(
resSheiBei
.
code
==
200
&&
resSheiBei
.
data
.
totalElements
!=
0
){
//查询车辆表中设备是否与车辆绑定
httpGet
(
vehicleInformationQuery
,{
equipmentName
:
this
.
deviceOAID
}).
then
((
resCar
)
=>
{
if
(
resCar
.
code
==
200
&&
resCar
.
data
.
totalElements
!=
0
){
this
.
bindingStatus
=
true
;
this
.
LoginInitiation
();
}
else
{
this
.
$message
({
message
:
"
请在后台系统中将该设备与车辆绑定后再进行登录!
"
,
type
:
'
error
'
});
this
.
bindingStatus
=
false
;
}
})
}
else
{
httpPostForJson
(
apiEquipmentQuery
,{
name
:
this
.
deviceOAID
,
status
:
'
正常
'
}).
then
((
res
)
=>
{
this
.
$message
({
message
:
"
请在后台系统中将该设备与车辆绑定后再进行登录!
"
,
type
:
'
error
'
});
this
.
bindingStatus
=
false
;
})
}
});
},
//进行登录
LoginInitiation
(){
this
.
loading
=
true
;
if
(
this
.
loginForm
.
userName
==
""
||
this
.
loginForm
.
password
==
""
){
...
...
@@ -135,7 +194,6 @@ export default {
if
(
res
.
status
===
400
){
that
.
$message
.
warning
(
'
用户名和密码错误,请重新输入
'
);
}
else
{
//console.log(res);
localStorage
.
setItem
(
appConfig
.
TOKEN_KEY
,
res
.
token
);
localStorage
.
setItem
(
appConfig
.
USER_KEY
,
JSON
.
stringify
(
res
.
user
));
if
(
user
.
rememberMe
)
{
...
...
@@ -150,11 +208,10 @@ export default {
}
})
}
else
{
this
.
$message
({
message
:
"
用户名密码错误
"
,
type
:
'
error
'
});
//console.log('error submit!!')
this
.
$message
({
message
:
"
用户名密码错误
"
,
type
:
'
error
'
});
return
false
}
})
...
...
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