Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
罗鑫霖
/
vion-tools
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f50e4225
authored
Jan 11, 2022
by
李金轩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
ljx
1 parent
29779967
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
184 additions
and
101 deletions
static/index.html
static/js/common.js
static/js/home.js
static/js/request.js
static/index.html
View file @
f50e422
...
@@ -1073,26 +1073,17 @@
...
@@ -1073,26 +1073,17 @@
<!-- </el-form-item>-->
<!-- </el-form-item>-->
<el-form-item
label=
"集团:"
>
<el-form-item
label=
"集团:"
>
<el-select
<el-select
v-model=
"account
Val
"
v-model=
"account
_id
"
filterable
filterable
multiple
multiple
collapse-tags
collapse-tags
:clearable=
"false"
:clearable=
"false"
placeholder=
"请选择集团"
placeholder=
"请选择集团"
class=
"query-select mall-sel-box"
class=
"query-select mall-sel-box"
@
change=
"
accountc
hange"
@
change=
"
onAccount_idC
hange"
>
>
<div
:class=
"isAccoutSelAll ? 'sel-all-box selected' : 'sel-all-box'"
@
click=
"selAllHandle('accout')"
>
<span
class=
"custom-checkbox__input"
>
<span
class=
"custom-checkbox__inner"
></span>
</span>
<span
style=
"padding-left: 5px;"
>
全选
</span>
</div>
<el-option
<el-option
v-for=
"item in accou
tOpts
"
v-for=
"item in accou
nt_id_list
"
:key=
"item.id"
:key=
"item.id"
:label=
"item.name"
:label=
"item.name"
:value=
"item.id"
:value=
"item.id"
...
@@ -1104,42 +1095,28 @@
...
@@ -1104,42 +1095,28 @@
</el-option>
</el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<!-- <el-form-item label="广场:">-->
<!-- <el-select>-->
<!-- <el-option :label="'Store'"></el-option>-->
<!-- <el-option :label="'Mall'"></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item
label=
"出入类型:"
>
<el-form-item
label=
"出入类型:"
>
<el-select
v-model=
"type6"
>
<el-select
v-model=
"type6"
@
change=
"onTypeChange"
>
<el-option
:label=
"'广场出入口'"
:value=
"1"
></el-option>
<el-option
:label=
"'广场出入口'"
:value=
"1"
></el-option>
<el-option
:label=
"'楼层出入口'"
:value=
"2"
></el-option>
<el-option
:label=
"'楼层出入口'"
:value=
"2"
></el-option>
<el-option
:label=
"'店铺出入口'"
:value=
"3"
></el-option>
<el-option
:label=
"'店铺出入口'"
:value=
"3"
></el-option>
<el-option
:label=
"'其他'"
:value=
"4"
></el-option>
<el-option
:label=
"'其他'"
:value=
"4"
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"
商场/门店
:"
>
<el-form-item
label=
"
广场
:"
>
<el-select
<el-select
v-model=
"
mallVal
"
v-model=
"
plaza_id
"
filterable
filterable
multiple
multiple
collapse-tags
collapse-tags
:clearable=
"false"
:clearable=
"false"
placeholder=
"请选择商场"
placeholder=
"请选择商场"
class=
"query-select mall-sel-box"
class=
"query-select mall-sel-box"
@
change=
"
mallc
hange"
@
change=
"
onPlaza_idC
hange"
>
>
<div
:class=
"isMallSelAll ? 'sel-all-box selected' : 'sel-all-box'"
@
click=
"selAllHandle()"
>
<span
class=
"custom-checkbox__input"
>
<span
class=
"custom-checkbox__inner"
></span>
</span>
<span
style=
"padding-left: 5px;"
>
全选
</span>
</div>
<el-option
<el-option
v-for=
"item in
mallOpts
"
v-for=
"item in
plaza_id_list
"
:key=
"item.id"
:key=
"item.id"
:label=
"item.name"
:label=
"item.name"
:value=
"item.id"
:value=
"item.id"
...
@@ -1153,15 +1130,16 @@
...
@@ -1153,15 +1130,16 @@
</el-form-item>
</el-form-item>
<el-form-item
label=
"区域信息:"
>
<el-form-item
label=
"区域信息:"
>
<el-select
<el-select
v-model=
"zone
Value
"
v-model=
"zone
_id
"
filterable
filterable
multiple
multiple
collapse-tags
collapse-tags
:clearable=
"false"
:clearable=
"false"
@
change=
"onGate_idChange"
class=
"query-select mall-sel-box"
class=
"query-select mall-sel-box"
>
>
<el-option
<el-option
v-for=
"item in zoneList"
v-for=
"item in zone
_id
List"
:key=
"item.id"
:key=
"item.id"
:label=
"item.name"
:label=
"item.name"
:value=
"item.id"
:value=
"item.id"
...
@@ -1173,16 +1151,14 @@
...
@@ -1173,16 +1151,14 @@
</el-option>
</el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"
监控点名称
:"
>
<el-form-item
label=
"
出入口信息
:"
>
<el-select
<el-select
v-model=
"gate
Val
"
v-model=
"gate
_id
"
filterable
filterable
clearable
clearable
placeholder=
"请选择监控点"
@
change=
"getChannel"
>
>
<el-option
<el-option
v-for=
"(item, index) in gate
Op
t"
v-for=
"(item, index) in gate
_idLis
t"
:key=
"item.index"
:key=
"item.index"
:label=
"item.name"
:label=
"item.name"
:value=
"item.id"
:value=
"item.id"
...
@@ -1225,7 +1201,7 @@
...
@@ -1225,7 +1201,7 @@
<img
:src=
"item.picture_url"
<img
:src=
"item.picture_url"
style=
"width: 100%; height: auto;"
>
style=
"width: 100%; height: auto;"
>
<div>
时间:{{item.counttime}}
</div>
<div>
时间:{{item.counttime}}
</div>
<div>
{{formatDirection(item.direction)}}
</div>
<div>
方向:
{{formatDirection(item.direction)}}
</div>
<div>
地点:{{item.gate_name}}
</div>
<div>
地点:{{item.gate_name}}
</div>
</div>
</div>
</el-col>
</el-col>
...
@@ -1244,28 +1220,25 @@
...
@@ -1244,28 +1220,25 @@
</div>
</div>
<div
v-if=
"currentIndex6 === '2'"
>
<div
v-if=
"currentIndex6 === '2'"
>
<el-form
:inline=
"true"
size=
"small"
>
<el-form
:inline=
"true"
size=
"small"
>
<!-- <el-form-item label="平台:">-->
<!-- <el-select>-->
<!-- <el-option :label="'Store'" :value="'Store'"></el-option>-->
<!-- <el-option :label="'Mall'" :value="'Store'"></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item
label=
"集团:"
>
<el-form-item
label=
"集团:"
>
<el-select
<el-select
v-model=
"account
Val
"
v-model=
"account
_id
"
filterable
filterable
multiple
multiple
collapse-tags
collapse-tags
:clearable=
"false"
:clearable=
"false"
placeholder=
"请选择集团"
placeholder=
"请选择集团"
class=
"query-select mall-sel-box"
class=
"query-select mall-sel-box"
@
change=
"
accountc
hange"
@
change=
"
onAccount_idC
hange"
>
>
<div
:class=
"isAccoutSelAll ? 'sel-all-box selected' : 'sel-all-box'"
@
click=
"selAllHandle('accout')"
>
<span
class=
"custom-checkbox__input"
>
<span
class=
"custom-checkbox__inner"
></span>
</span>
<span
style=
"padding-left: 5px;"
>
全选
</span>
</div>
<el-option
<el-option
v-for=
"item in accou
tOpts
"
v-for=
"item in accou
nt_id_list
"
:key=
"item.id"
:key=
"item.id"
:label=
"item.name"
:label=
"item.name"
:value=
"item.id"
:value=
"item.id"
...
@@ -1284,35 +1257,27 @@
...
@@ -1284,35 +1257,27 @@
<!-- </el-select>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-form-item>-->
<el-form-item
label=
"出入类型:"
>
<el-form-item
label=
"出入类型:"
>
<el-select
v-model=
"type6"
>
<el-select
v-model=
"type6"
@
change=
"onTypeChange"
>
<el-option
:label=
"'广场出入口'"
:value=
"1"
></el-option>
<el-option
:label=
"'广场出入口'"
:value=
"1"
></el-option>
<el-option
:label=
"'楼层出入口'"
:value=
"2"
></el-option>
<el-option
:label=
"'楼层出入口'"
:value=
"2"
></el-option>
<el-option
:label=
"'店铺出入口'"
:value=
"3"
></el-option>
<el-option
:label=
"'店铺出入口'"
:value=
"3"
></el-option>
<el-option
:label=
"'其他'"
:value=
"4"
></el-option>
<el-option
:label=
"'其他'"
:value=
"4"
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"
商场/门店
:"
>
<el-form-item
label=
"
广场
:"
>
<el-select
<el-select
v-model=
"
mallVal
"
v-model=
"
plaza_id
"
filterable
filterable
multiple
multiple
collapse-tags
collapse-tags
:clearable=
"false"
:clearable=
"false"
placeholder=
"请选择商场"
placeholder=
"请选择商场"
class=
"query-select mall-sel-box"
class=
"query-select mall-sel-box"
@
change=
"
mallc
hange"
@
change=
"
onPlaza_idC
hange"
>
>
<div
:class=
"isMallSelAll ? 'sel-all-box selected' : 'sel-all-box'"
@
click=
"selAllHandle()"
>
<span
class=
"custom-checkbox__input"
>
<span
class=
"custom-checkbox__inner"
></span>
</span>
<span
style=
"padding-left: 5px;"
>
全选
</span>
</div>
<el-option
<el-option
v-for=
"item in
mallOpts
"
v-for=
"item in
plaza_id_list
"
:key=
"item.id"
:key=
"item.id"
:label=
"item.name"
:label=
"item.name"
:value=
"item.id"
:value=
"item.id"
...
@@ -1326,15 +1291,16 @@
...
@@ -1326,15 +1291,16 @@
</el-form-item>
</el-form-item>
<el-form-item
label=
"区域信息:"
>
<el-form-item
label=
"区域信息:"
>
<el-select
<el-select
v-model=
"zone
Value
"
v-model=
"zone
_id
"
filterable
filterable
multiple
multiple
collapse-tags
collapse-tags
:clearable=
"false"
:clearable=
"false"
@
change=
"onGate_idChange"
class=
"query-select mall-sel-box"
class=
"query-select mall-sel-box"
>
>
<el-option
<el-option
v-for=
"item in zoneList"
v-for=
"item in zone
_id
List"
:key=
"item.id"
:key=
"item.id"
:label=
"item.name"
:label=
"item.name"
:value=
"item.id"
:value=
"item.id"
...
@@ -1346,16 +1312,14 @@
...
@@ -1346,16 +1312,14 @@
</el-option>
</el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"
监控点名称
:"
>
<el-form-item
label=
"
出入口信息
:"
>
<el-select
<el-select
v-model=
"gate
Val
"
v-model=
"gate
_id
"
filterable
filterable
clearable
clearable
placeholder=
"请选择监控点"
@
change=
"getChannel"
>
>
<el-option
<el-option
v-for=
"(item, index) in gate
Op
t"
v-for=
"(item, index) in gate
_idLis
t"
:key=
"item.index"
:key=
"item.index"
:label=
"item.name"
:label=
"item.name"
:value=
"item.id"
:value=
"item.id"
...
@@ -1414,7 +1378,7 @@
...
@@ -1414,7 +1378,7 @@
<img
:src=
"item.picture_url"
<img
:src=
"item.picture_url"
style=
"width: 100%; height: auto;"
>
style=
"width: 100%; height: auto;"
>
<div>
时间:{{item.counttime}}
</div>
<div>
时间:{{item.counttime}}
</div>
<div>
{{formatDirection(item.direction)}}
</div>
<div>
方向:
{{formatDirection(item.direction)}}
</div>
<div>
地点:{{item.gate_name}}
</div>
<div>
地点:{{item.gate_name}}
</div>
</div>
</div>
</el-col>
</el-col>
...
...
static/js/common.js
View file @
f50e422
window
.
_serverHost
=
window
.
location
.
hostname
===
'localhost'
?
'store.keliuyun.com:9998'
:
window
.
location
.
host
window
.
_baseUrl
=
`http://
${
window
.
_serverHost
}
`
window
.
_CONF_
=
{
window
.
_CONF_
=
{
reportApiUrl
:
''
,
reportApiUrl
:
''
,
apiUrl
:
window
.
_baseUrl
,
apiUrl
:
window
.
location
.
hostname
===
'localhost'
?
'http://store.keliuyun.com:9998'
:
''
,
apiUrl2
:
window
.
location
.
hostname
===
'localhost'
?
'http://36.112.68.214:9999'
:
''
,
webSockUrl
:
''
webSockUrl
:
''
}
}
...
...
static/js/home.js
View file @
f50e422
...
@@ -34,8 +34,8 @@ new Vue({
...
@@ -34,8 +34,8 @@ new Vue({
total2
:
0
,
total2
:
0
,
dataList1
:
[],
dataList1
:
[],
dataList2
:
[],
dataList2
:
[],
zoneList
:
[],
zone
_id
List
:
[],
zone
Value
:
[],
zone
_id
:
[],
pickerOpts
:
{
pickerOpts
:
{
disabledDate
(
time
)
{
disabledDate
(
time
)
{
return
Date
.
parse
(
time
)
>
Date
.
parse
(
new
Date
())
return
Date
.
parse
(
time
)
>
Date
.
parse
(
new
Date
())
...
@@ -69,12 +69,19 @@ new Vue({
...
@@ -69,12 +69,19 @@ new Vue({
referenceDate
:
""
,
referenceDate
:
""
,
repairDate
:
""
,
repairDate
:
""
,
accountVal
:
[],
accountVal
:
[],
account_id
:
[],
plaza_id
:
[],
mallVal
:
[],
mallVal
:
[],
mallOpts
:
[],
mallOpts
:
[],
accountId
:
[],
accountId
:
[],
accoutOpts
:
[],
accoutOpts
:
[],
account_id_list
:
[],
plaza_id_list
:
[],
gate_idList
:
[],
deviceVal
:
""
,
deviceVal
:
""
,
gateVal
:
""
,
gateVal
:
""
,
gateVal2
:
""
,
gate_id
:
''
,
channelVal
:
""
,
channelVal
:
""
,
showDiv
:
true
,
showDiv
:
true
,
loading
:
""
,
loading
:
""
,
...
@@ -323,15 +330,12 @@ new Vue({
...
@@ -323,15 +330,12 @@ new Vue({
}
}
else
if
(
this
.
dateFormat
==
"snapGatherClass"
)
else
if
(
this
.
dateFormat
==
"snapGatherClass"
)
{
{
this
.
getGate
()
// initialize
get
(
get
(
'http://36.112.68.214:9999'
+
'/malls'
,
window
.
_CONF_
.
apiUrl2
+
'/accounts'
,
{
accountIds
:
2
}
).
then
(
).
then
(
(
r
)
=>
{
(
r
)
=>
{
log
(
r
)
this
.
account_id_list
=
r
}
}
)
)
}
}
...
@@ -340,8 +344,70 @@ new Vue({
...
@@ -340,8 +344,70 @@ new Vue({
// this.getMall();
// this.getMall();
}
}
},
},
onAccount_idChange
:
function
()
{
this
.
getMallList
()
this
.
getZoneList
()
this
.
getGateList
()
},
getMallList
:
function
()
{
this
.
plaza_id_list
=
[]
get
(
window
.
_CONF_
.
apiUrl2
+
'/malls'
,
{
accountIds
:
this
.
account_id
.
toString
(),
}
).
then
(
(
r
)
=>
{
this
.
plaza_id_list
=
r
}
)
},
onPlaza_idChange
:
function
()
{
this
.
getZoneList
()
this
.
getGateList
()
},
getZoneList
:
function
()
{
this
.
zone_idList
=
[]
get
(
window
.
_CONF_
.
apiUrl2
+
'/zones/zoneList'
,
{
account_id
:
this
.
account_id
.
toString
(),
plaza_id
:
this
.
plaza_id
.
toString
(),
}
).
then
(
(
r
)
=>
{
this
.
zone_idList
=
r
}
)
},
onGate_idChange
:
function
()
{
this
.
getGateList
()
},
getGateList
:
function
()
{
this
.
gate_idList
=
[]
get
(
window
.
_CONF_
.
apiUrl2
+
'/gates/gateByInfo'
,
{
account_id
:
this
.
account_id
.
toString
(),
plaza_id
:
this
.
plaza_id
.
toString
(),
zone_id
:
this
.
zone_id
.
toString
(),
type
:
this
.
type6
,
}
).
then
(
(
r
)
=>
{
this
.
gate_idList
=
r
.
data
}
)
},
onTypeChange
:
function
()
{
this
.
getGateList
()
},
onMenuSelect
:
function
(
value
)
{
onMenuSelect
:
function
(
value
)
{
this
.
currentIndex6
=
value
this
.
currentIndex6
=
value
// this.pageNum1 = 1
// this.pageNum2 = 1
// this.total1 = 0
// this.total2 = 0
},
},
formatDirection
:
function
(
number
)
{
formatDirection
:
function
(
number
)
{
switch
(
number
)
switch
(
number
)
...
@@ -368,20 +434,21 @@ new Vue({
...
@@ -368,20 +434,21 @@ new Vue({
confirmSearch
:
function
()
{
confirmSearch
:
function
()
{
const
data
=
filterEmptyValueInObject
(
const
data
=
filterEmptyValueInObject
(
{
{
account_id
:
this
.
account
Val
.
toString
(),
account_id
:
this
.
account
_id
.
toString
(),
// account_id: 16,
// account_id: 16,
type
:
this
.
type6
,
type
:
this
.
type6
,
// type: 3,
// type: 3,
zone_id
:
this
.
mallVal
.
toString
(),
// plaza_id: 40,
plaza_id
:
this
.
plaza_id
.
toString
(),
zone_id
:
this
.
zone_id
.
toString
(),
// zone_id: 48,
// zone_id: 48,
gate_id
:
this
.
gate
Val
,
gate_id
:
this
.
gate
_id
,
// gate_id: 268,
// gate_id: 268,
direction
:
this
.
direction6
,
direction
:
this
.
direction6
,
picType
:
this
.
picType6
,
picType
:
this
.
picType6
,
personType
:
this
.
personType6
,
personType
:
this
.
personType6
,
// personType: 0,
// personType: 0,
// plaza_id: 40,
plaza_id
:
this
.
zoneValue
.
toString
(),
startTime
:
formatDate
(
this
.
time6
[
0
]),
startTime
:
formatDate
(
this
.
time6
[
0
]),
endTime
:
formatDate
(
this
.
time6
[
1
]),
endTime
:
formatDate
(
this
.
time6
[
1
]),
page
:
this
.
pageNum1
-
1
,
page
:
this
.
pageNum1
-
1
,
...
@@ -389,7 +456,7 @@ new Vue({
...
@@ -389,7 +456,7 @@ new Vue({
}
}
)
)
get
(
get
(
'http://36.112.68.214:9999'
+
'/faceRecognitions/faceRecord'
,
window
.
_CONF_
.
apiUrl2
+
'/faceRecognitions/faceRecord'
,
data
data
).
then
(
).
then
(
(
r
)
=>
{
(
r
)
=>
{
...
@@ -402,31 +469,31 @@ new Vue({
...
@@ -402,31 +469,31 @@ new Vue({
confirmSearch2
:
function
()
{
confirmSearch2
:
function
()
{
const
data
=
filterEmptyValueInObject
(
const
data
=
filterEmptyValueInObject
(
{
{
account_id
:
this
.
account
Val
.
toString
(),
account_id
:
this
.
account
_id
.
toString
(),
// account_id: 16,
// account_id: 16,
type
:
this
.
type6
,
type
:
this
.
type6
,
// type: 3,
// type: 3,
zone_id
:
this
.
mallVal
.
toString
(),
// plaza_id: 40,
plaza_id
:
this
.
plaza_id
.
toString
(),
zone_id
:
this
.
zone_id
.
toString
(),
// zone_id: 48,
// zone_id: 48,
gate_id
:
this
.
gate
Val
,
gate_id
:
this
.
gate
_id
,
// gate_id: 268,
// gate_id: 268,
direction
:
this
.
direction6
,
direction
:
this
.
direction6
,
picType
:
this
.
picType6
,
picType
:
this
.
picType6
,
personType
:
this
.
personType6
,
personType
:
this
.
personType6
,
// personType: 0,
// personType: 0,
// plaza_id: 40,
plaza_id
:
this
.
zoneValue
.
toString
(),
startTime
:
formatDate
(
this
.
time6
[
0
]),
startTime
:
formatDate
(
this
.
time6
[
0
]),
endTime
:
formatDate
(
this
.
time6
[
1
]),
endTime
:
formatDate
(
this
.
time6
[
1
]),
minPic
:
this
.
minPic
,
maxPic
:
this
.
maxPic
,
page
:
this
.
pageNum2
-
1
,
page
:
this
.
pageNum2
-
1
,
pageSize
:
this
.
pageSize2
,
pageSize
:
this
.
pageSize2
,
minPic
:
this
.
minPic
,
maxPic
:
this
.
maxPic
,
}
}
)
)
get
(
get
(
'http://36.112.68.214:9999'
+
'/faceRecognitions/faceRecordGroup'
,
window
.
_CONF_
.
apiUrl2
+
'/faceRecognitions/faceRecordGroup'
,
data
data
).
then
(
).
then
(
(
r
)
=>
{
(
r
)
=>
{
...
@@ -555,7 +622,7 @@ new Vue({
...
@@ -555,7 +622,7 @@ new Vue({
getZone
()
{
getZone
()
{
let
_this
=
this
let
_this
=
this
_this
.
mallOpts
=
[]
_this
.
mallOpts
=
[]
get
(
'http://36.112.68.214:9999'
+
'/zones/zoneList'
,
{
get
(
window
.
_CONF_
.
apiUrl2
+
'/zones/zoneList'
,
{
account_id
:
_this
.
accountVal
.
join
(
","
),
account_id
:
_this
.
accountVal
.
join
(
","
),
plaza_id
:
_this
.
mallVal
.
join
(
","
)
plaza_id
:
_this
.
mallVal
.
join
(
","
)
// account_id: 16,
// account_id: 16,
...
@@ -659,6 +726,17 @@ new Vue({
...
@@ -659,6 +726,17 @@ new Vue({
_this
.
getChannel
()
_this
.
getChannel
()
})
})
},
},
getGate2
:
function
()
{
var
_this
=
this
get
(
window
.
_CONF_
.
apiUrl2
+
'/gates/gateByInfo'
,
{
account_id
:
_this
.
accountVal
.
toString
(),
plaza_id
:
_this
.
mallVal
.
toString
(),
zone_id
:
_this
.
zoneValue
.
toString
(),
type
:
_this
.
type6
,
}).
then
(
function
(
data
)
{
log
(
data
)
})
},
getDevice
:
function
()
{
getDevice
:
function
()
{
var
_this
=
this
var
_this
=
this
get
(
window
.
_CONF_
.
apiUrl
+
API
.
Devices
,
{
get
(
window
.
_CONF_
.
apiUrl
+
API
.
Devices
,
{
...
@@ -714,6 +792,26 @@ new Vue({
...
@@ -714,6 +792,26 @@ new Vue({
_this
.
channelOpt
.
length
>
0
?
_this
.
channelOpt
[
0
].
value
:
""
_this
.
channelOpt
.
length
>
0
?
_this
.
channelOpt
[
0
].
value
:
""
})
})
},
},
getChannel2
()
{
var
_this
=
this
get
(
window
.
_CONF_
.
apiUrl
+
API
.
Channels
,
{
// accountIds: _this.accountVal.join(","),
// mallIds: _this.mallVal.join(','),
gateId
:
this
.
gateVal
}).
then
(
function
(
data
)
{
_this
.
channelOpt
=
[]
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
var
temp
=
{}
temp
.
name
=
data
[
i
]
temp
.
value
=
data
[
i
]
temp
.
id
=
i
_this
.
channelOpt
.
push
(
temp
)
}
_this
.
channelVal
=
_this
.
channelOpt
.
length
>
0
?
_this
.
channelOpt
[
0
].
value
:
""
})
},
clearDiv
()
{
clearDiv
()
{
$
(
"#showDiv"
).
empty
()
$
(
"#showDiv"
).
empty
()
},
},
...
...
static/js/request.js
View file @
f50e422
...
@@ -7,12 +7,34 @@ const Axios = axios.create({
...
@@ -7,12 +7,34 @@ const Axios = axios.create({
}
}
})
})
const
getUrlQueryByName
=
function
(
name
)
{
name
=
name
.
replace
(
/
[\[\]]
/g
,
'\\$&'
)
let
regex
=
new
RegExp
(
'[?&]'
+
name
+
'(=([^&#]*)|&|#|$)'
)
let
results
=
regex
.
exec
(
window
.
location
.
href
)
if
(
!
results
)
{
return
null
}
if
(
!
results
[
2
])
{
return
''
}
return
decodeURIComponent
(
results
[
2
].
replace
(
/
\+
/g
,
' '
))
}
Axios
.
interceptors
.
request
.
use
(
Axios
.
interceptors
.
request
.
use
(
config
=>
{
config
=>
{
const
atoken
=
Cookies
.
get
(
'atoken'
)
//
const atoken = Cookies.get('atoken')
// console.log('atoken', atoken)
// console.log('atoken', atoken)
// atoken && (config.headers.Authorization = atoken)
// atoken && (config.headers.Authorization = atoken)
if
(
window
.
location
.
hostname
===
'localhost'
)
{
config
.
headers
.
Authorization
=
'a054367f-717d-47fb-b870-7c599e030e16'
config
.
headers
.
Authorization
=
'a054367f-717d-47fb-b870-7c599e030e16'
}
else
{
config
.
headers
.
Authorization
=
getUrlQueryByName
(
'authorization'
)
}
return
config
return
config
},
},
error
=>
{
error
=>
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment