Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
L
laravelzh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
冯超鹏
laravelzh
Commits
74daa78f
Commit
74daa78f
authored
May 27, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into map_model
parents
a0a019b3
f43cfe41
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
160 additions
and
75 deletions
+160
-75
swoole.php
app/Console/Commands/swoole.php
+3
-1
swooleMeTcp.php
app/Console/Commands/swooleMeTcp.php
+5
-4
AuthController.php
app/Http/Controllers/AuthController.php
+25
-8
DevicesController.php
app/Http/Controllers/DevicesController.php
+35
-21
UserController.php
app/Http/Controllers/UserController.php
+24
-1
Userslist.php
app/Http/Middleware/Userslist.php
+11
-0
composer.lock.zip
composer.lock.zip
+0
-0
auth.php
config/auth.php
+3
-3
dump.rdb
dump.rdb
+0
-0
devicelistdata.text
public/device/2020-05-26/devicelistdata.text
+1
-0
device.js
resources/js/router/modules/device.js
+1
-1
users.js
resources/js/router/modules/users.js
+1
-1
user.js
resources/js/store/modules/user.js
+3
-2
index.vue
resources/js/views/device/index.vue
+11
-2
alarms.vue
resources/js/views/history/alarms.vue
+1
-1
index.vue
resources/js/views/history/index.vue
+7
-7
index.vue
resources/js/views/login/index.vue
+18
-22
index.vue
resources/js/views/user/index.vue
+5
-1
api.php
routes/api.php
+6
-0
No files found.
app/Console/Commands/swoole.php
View file @
74daa78f
...
...
@@ -55,7 +55,9 @@ class swoole extends Command
//开启WebSocket
public
function
start
()
{
$this
->
ws
=
new
\swoole_websocket_server
(
"0.0.0.0"
,
9502
);
//创建一个端口
$url
=
config
(
'public.swoolwebsocketurl'
);
$por
=
config
(
'public.swoolwebsocketurlpor'
);
$this
->
ws
=
new
\swoole_websocket_server
(
$url
,
$por
);
//创建一个端口
$this
->
ws
->
set
(
array
(
'reactor_num'
=>
2
,
//reactor线程数
'worker_num'
=>
4
,
//worker进程数
...
...
app/Console/Commands/swooleMeTcp.php
View file @
74daa78f
...
...
@@ -54,10 +54,11 @@ class swooleMeTcp extends Command
//开启
public
function
start
()
{
$this
->
tcp
=
new
\swoole_server
(
"127.0.0.1"
,
9503
);
$this
->
tcp
->
addlistener
(
"127.0.0.1"
,
9504
,
SWOOLE_SOCK_TCP
);
// 添加 TCP端口监听
$this
->
tcp
->
addlistener
(
"127.0.0.1"
,
9505
,
SWOOLE_SOCK_TCP
);
// 添加 TCP端口监听
$this
->
tcp
->
addlistener
(
"127.0.0.1"
,
9506
,
SWOOLE_SOCK_TCP
);
// 添加 TCP端口监听
$url
=
config
(
'public.swooletcpurl'
);
$this
->
tcp
=
new
\swoole_server
(
$url
,
9503
);
$this
->
tcp
->
addlistener
(
$url
,
9504
,
SWOOLE_SOCK_TCP
);
// 添加 TCP端口监听
$this
->
tcp
->
addlistener
(
$url
,
9505
,
SWOOLE_SOCK_TCP
);
// 添加 TCP端口监听
$this
->
tcp
->
addlistener
(
$url
,
9506
,
SWOOLE_SOCK_TCP
);
// 添加 TCP端口监听
$this
->
tcp
->
set
([
'worker_num'
=>
2
,
//设置启动的 Worker 进程数
'max_request'
=>
30
,
//最大任务数
...
...
app/Http/Controllers/AuthController.php
View file @
74daa78f
...
...
@@ -29,18 +29,35 @@ class AuthController extends Controller
*/
public
function
login
(
Request
$request
,
Users
$users
)
{
$userOrAdmin
=
$request
->
input
(
'userOrAdmin'
);
$credentials
=
$request
->
only
(
'email'
,
'password'
);
if
(
!
Auth
::
attempt
(
$credentials
))
{
return
response
()
->
json
(
new
JsonResponse
([],
'login_error'
),
Response
::
HTTP_UNAUTHORIZED
);
}
if
(
$userOrAdmin
==
1
){
//用户
$BackgroundUser
=
$users
->
where
([[
'email'
,
'='
,
$credentials
[
'email'
]],[
'password'
,
'='
,
sha1
(
$credentials
[
'password'
])],[
'state'
,
'='
,
'2'
]])
->
first
();
if
(
Auth
::
attempt
(
$credentials
))
{
return
response
()
->
json
(
new
JsonResponse
([],
'login_error'
),
Response
::
HTTP_UNAUTHORIZED
);
}
if
(
$BackgroundUser
){
$BackgroundUser
=
$request
->
user
();
print_r
(
$BackgroundUser
);
die
();
$tokenResult
=
$BackgroundUser
->
createToken
(
'Personal Access Token'
);
$token
=
$tokenResult
->
token
;
$token
->
save
();
return
response
()
->
json
(
new
UserResource
(
$BackgroundUser
),
Response
::
HTTP_OK
)
->
header
(
'Authorization'
,
$tokenResult
->
accessToken
);
}
$user
=
$request
->
user
();
$tokenResult
=
$user
->
createToken
(
'Personal Access Token'
);
$token
=
$tokenResult
->
token
;
}
else
{
if
(
!
Auth
::
attempt
(
$credentials
))
{
return
response
()
->
json
(
new
JsonResponse
([],
'login_error'
),
Response
::
HTTP_UNAUTHORIZED
);
}
$user
=
$request
->
user
();
$tokenResult
=
$user
->
createToken
(
'Personal Access Token'
);
$token
=
$tokenResult
->
token
;
$token
->
save
();
$token
->
save
();
return
response
()
->
json
(
new
UserResource
(
$user
),
Response
::
HTTP_OK
)
->
header
(
'Authorization'
,
$tokenResult
->
accessToken
);
}
return
response
()
->
json
(
new
UserResource
(
$user
),
Response
::
HTTP_OK
)
->
header
(
'Authorization'
,
$tokenResult
->
accessToken
);
}
...
...
app/Http/Controllers/DevicesController.php
View file @
74daa78f
...
...
@@ -186,8 +186,9 @@ class DevicesController extends Controller
->
where
(
'dtype'
,
'='
,
$type
)
->
leftjoin
(
'device_type as dy'
,
"device.dtype"
,
'='
,
'dy.tid'
)
->
leftjoin
(
'gas as g'
,
"device.status"
,
'='
,
'g.id'
)
->
leftjoin
(
'BackgroundUser as u'
,
"device.uid"
,
'='
,
'u.id'
)
->
leftjoin
(
'status as p'
,
"device.devicepolice"
,
'='
,
'p.id'
)
->
select
(
'dy.tname'
,
'g.gas'
,
'device.*'
,
'p.status_name'
)
->
select
(
'dy.tname'
,
'g.gas'
,
'device.*'
,
'p.status_name'
,
'u.nickname as usernickname'
)
->
orderBy
(
'device.id'
,
'desc'
)
->
offset
(
$pagenNum
)
->
limit
(
$limit
)
...
...
@@ -227,8 +228,9 @@ class DevicesController extends Controller
->
where
(
'devicenum'
,
'='
,
$devicenum
)
->
leftjoin
(
'device_type as dy'
,
"device.dtype"
,
'='
,
'dy.tid'
)
->
leftjoin
(
'gas as g'
,
"device.status"
,
'='
,
'g.id'
)
->
leftjoin
(
'BackgroundUser as u'
,
"device.uid"
,
'='
,
'u.id'
)
->
leftjoin
(
'status as p'
,
"device.devicepolice"
,
'='
,
'p.id'
)
->
select
(
'dy.tname'
,
'g.gas'
,
'device.*'
,
'p.status_name'
)
->
select
(
'dy.tname'
,
'g.gas'
,
'device.*'
,
'p.status_name'
,
'u.nickname as usernickname'
)
->
orderBy
(
'device.id'
,
'desc'
)
->
offset
(
$pagenNum
)
->
limit
(
$limit
)
...
...
@@ -256,7 +258,17 @@ class DevicesController extends Controller
->
get
();
return
$this
->
jsonSuccessData
([
'devicedata'
=>
$devicedata
,
'devicedatainfo'
=>
$devicedatainfo
]);
}
// 返回设备地图详情信息
public
function
device_info
(
$id
){
$devicedata
=
Device
::
where
(
'device.id'
,
'='
,
$id
)
->
leftjoin
(
'device_type as dy'
,
"device.dtype"
,
'='
,
'dy.tid'
)
->
leftjoin
(
'gas as g'
,
"device.status"
,
'='
,
'g.id'
)
->
leftjoin
(
'BackgroundUser as u'
,
"device.uid"
,
'='
,
'u.id'
)
->
leftjoin
(
'status as p'
,
"device.devicepolice"
,
'='
,
'p.id'
)
->
select
(
'dy.tname'
,
'g.gas'
,
'device.*'
,
'p.status_name'
,
'u.nickname as usernickname'
)
->
first
();
return
$this
->
jsonSuccessData
(
$devicedata
);
}
//搜索设备账号
public
function
deviceDataSearch
(
Request
$request
)
{
...
...
@@ -272,23 +284,25 @@ class DevicesController extends Controller
//推送获取数据监测数据
public
function
equipment
()
{
/*
* 将写入文件改为时序数据库!
* */
$dalen
=
Redis
::
llen
(
'Devicesdata'
);
//返回队列长度
// $num = round($dalen / 2);
$data
=
[];
if
(
$dalen
>
0
)
{
for
(
$i
=
0
;
$i
<
$dalen
;
$i
++
)
{
array_push
(
$data
,
unserialize
(
Redis
::
lpop
(
'Devicesdata'
)));
$data
=
[];
if
(
$dalen
>
0
)
{
for
(
$i
=
0
;
$i
<
$dalen
;
$i
++
)
{
array_push
(
$data
,
unserialize
(
Redis
::
lpop
(
'Devicesdata'
)));
}
}
if
(
$data
!=
[])
{
$this
->
devicemkdir
(
$data
);
//写入文件
}
$devicelistopen
=
$this
->
devicelistopen
();
if
(
$devicelistopen
!=
105
){
return
$this
->
jsonSuccessData
(
$devicelistopen
);
}
else
{
return
$this
->
jsonErrorData
(
105
,
'暂无数据'
);
}
}
if
(
$data
!=
[])
{
$this
->
devicemkdir
(
$data
);
//写入文件
}
$devicelistopen
=
$this
->
devicelistopen
();
if
(
$devicelistopen
!=
105
){
return
$this
->
jsonSuccessData
(
$devicelistopen
);
}
else
{
return
$this
->
jsonErrorData
(
105
,
'暂无数据'
);
}
}
//历史数据查询
...
...
@@ -359,7 +373,7 @@ class DevicesController extends Controller
public
function
deviceLocation
()
{
//返回用户安装位置
return
$this
->
jsonSuccessData
(
DB
::
table
(
'device'
)
->
select
(
'id'
,
'
devicenum'
,
'devicecoord'
,
'devicepolice
'
)
->
get
());
return
$this
->
jsonSuccessData
(
DB
::
table
(
'device'
)
->
select
(
'id'
,
'
uid'
,
'nd'
,
'deviceinfo'
,
'devicenum'
,
'devicecoord'
,
'devicepolice'
,
'deviceremark'
,
'devicelinkman
'
)
->
get
());
}
//返回消防监测
public
function
control
(
Request
$request
)
...
...
@@ -371,10 +385,10 @@ class DevicesController extends Controller
return
$this
->
jsonErrorData
(
105
,
'页数或limit不能为空'
);
}
if
(
$type
==
1
){
//返回消防监测
$wherein
=
[
1
,
2
,
4
,
7
,
8
,
11
];
$wherein
=
[
2
,
4
,
6
,
7
,
8
,
9
,
11
];
}
else
{
//返回危化
$wherein
=
[
5
,
6
,
9
,
10
];
$wherein
=
[
1
,
5
,
10
];
}
$databadevice
=
DB
::
table
(
'device'
);
$devicelist
=
$databadevice
...
...
app/Http/Controllers/UserController.php
View file @
74daa78f
...
...
@@ -507,7 +507,30 @@ class UserController extends Controller
//返回用户的经纬度
public
function
userLocation
()
{
return
$this
->
jsonSuccessData
(
DB
::
table
(
'BackgroundUser'
)
->
select
(
'id'
,
'nickname'
,
'mapcenter'
,
'company'
)
->
get
());
$davicenum
=
DB
::
table
(
'BackgroundUser'
)
->
select
(
'id'
)
->
get
()
->
toArray
();
$data
=
[];
$police
=
[];
foreach
(
array_column
(
$davicenum
,
'id'
)
as
$k
=>
$value
){
$countdevice_type
=
DB
::
table
(
'device'
)
->
where
(
'uid'
,
'='
,
$value
)
->
count
();
$usernum
[
'count'
]
=
$countdevice_type
;
$usernum
[
'id'
]
=
$value
;
array_push
(
$data
,
$usernum
);
}
foreach
(
array_column
(
$davicenum
,
'id'
)
as
$k
=>
$value
){
$countdevice_type
=
DB
::
table
(
'device'
)
->
where
(
'uid'
,
'='
,
$value
)
->
where
(
'devicepolice'
,
'>'
,
'1'
)
->
count
();
$usernum
[
'count'
]
=
$countdevice_type
;
$usernum
[
'id'
]
=
$value
;
array_push
(
$police
,
$usernum
);
}
$userlist
=
DB
::
table
(
'BackgroundUser'
)
->
select
(
'id'
,
'nickname'
,
'mapcenter'
,
'company'
)
->
get
();
return
$this
->
jsonSuccessData
([
'UserDaviceNum'
=>
$data
,
'UserList'
=>
$userlist
,
'police'
=>
$police
]);
}
/*
...
...
app/Http/Middleware/Userslist.php
0 → 100644
View file @
74daa78f
<?php
namespace
App\Http\Middleware
;
use
Closure
;
use
Illuminate\Auth\Middleware\Authenticate
as
Middleware
;
class
Userslist
extends
Middleware
{
}
\ No newline at end of file
composer.lock.zip
deleted
100644 → 0
View file @
a0a019b3
File deleted
config/auth.php
View file @
74daa78f
...
...
@@ -44,12 +44,12 @@ return [
'api'
=>
[
'driver'
=>
'passport'
,
'provider'
=>
'users'
,
'hash'
=>
fals
e
,
'hash'
=>
tru
e
,
],
'admin'
=>
[
'driver'
=>
'passport'
,
'provider'
=>
'user'
,
'hash'
=>
fals
e
,
'provider'
=>
'user
s
'
,
'hash'
=>
tru
e
,
],
],
...
...
dump.rdb
View file @
74daa78f
No preview for this file type
public/device/2020-05-26/devicelistdata.text
0 → 100644
View file @
74daa78f
[{"devicenum":"ZHGAS000141031","username":"\u4f60\u597d","deviceremark":"1","devicelinkman":"1","devicephone":"1","deviceinfo":"1","tname":"\u5de5\u4e1a\u63a2\u6d4b\u5668","gas":"\u7532\u70f7","danwei":"%LEL","status_name":"\u9519\u8bef"}]
resources/js/router/modules/device.js
View file @
74daa78f
...
...
@@ -28,7 +28,7 @@ const deviceRoutes = {
path
:
'DeviceStutus'
,
component
:
()
=>
import
(
'@/views/device/devicedtutus'
),
name
:
'DeviceStutus'
,
meta
:
{
title
:
'设备
状态列表
'
,
icon
:
'devicestutus'
,
permissions
:
[
'manage user'
]
},
meta
:
{
title
:
'设备
废纸篓
'
,
icon
:
'devicestutus'
,
permissions
:
[
'manage user'
]
},
},
],
};
...
...
resources/js/router/modules/users.js
View file @
74daa78f
...
...
@@ -34,7 +34,7 @@ const usersRoutes = {
path
:
'userStatus'
,
component
:
()
=>
import
(
'@/views/user/userStatus'
),
name
:
'userStatus'
,
meta
:
{
title
:
'用户
状态
'
,
icon
:
'userstutus'
,
permissions
:
[
'manage user'
]
},
meta
:
{
title
:
'用户
废纸篓
'
,
icon
:
'userstutus'
,
permissions
:
[
'manage user'
]
},
},
{
path
:
'userStatistics'
,
...
...
resources/js/store/modules/user.js
View file @
74daa78f
...
...
@@ -41,8 +41,9 @@ const actions = {
// user login
login
({
commit
},
userInfo
)
{
const
{
email
,
password
}
=
userInfo
;
const
userOrAdmin
=
localStorage
.
getItem
(
'userOrAdmin'
);
return
new
Promise
((
resolve
,
reject
)
=>
{
login
({
email
:
email
.
trim
(),
password
:
password
})
login
({
email
:
email
.
trim
(),
password
:
password
,
userOrAdmin
:
userOrAdmin
})
.
then
(
response
=>
{
commit
(
'SET_TOKEN'
,
response
.
token
);
setToken
(
response
.
token
);
...
...
@@ -56,7 +57,7 @@ const actions = {
userlogin
({
commit
},
userInfo
)
{
const
{
email
,
password
}
=
userInfo
;
return
new
Promise
((
resolve
,
reject
)
=>
{
userlogin
({
email
:
email
.
trim
(),
password
:
password
})
userlogin
({
email
:
email
.
trim
(),
password
:
password
,
userOrAdmin
:
1
})
.
then
(
response
=>
{
commit
(
'SET_TOKEN'
,
response
.
token
);
setToken
(
response
.
token
);
...
...
resources/js/views/device/index.vue
View file @
74daa78f
...
...
@@ -11,7 +11,7 @@
{{
$t
(
'table.export'
)
}}
</el-button>
<el-badge
v-if=
"paper > 0"
:value=
"paper"
class=
"item"
style=
"margin-bottom: 8px;"
>
<el-button
size=
"small"
>
<el-button
size=
"small"
@
click=
"pucharray"
>
<svg-icon
class-name=
"custom-class"
icon-class=
"feizhilou"
/>
废纸篓
</el-button>
</el-badge>
...
...
@@ -35,6 +35,11 @@
<span>
{{
scope
.
row
.
tname
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"用户名称"
width=
"150"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
usernickname
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"介质状态"
width=
"170"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
gas
}}
</span>
...
...
@@ -202,6 +207,10 @@ export default {
handleCopy
(
text
,
event
)
{
clip
(
text
,
event
);
}
,
// 跳转废纸废纸篓
pucharray
()
{
this
.
$router
.
push
({
path
:
'/device/DeviceStutus'
}
);
}
,
deviceinfo
(
row
)
{
this
.
dialogPvVisible
=
true
;
this
.
deviceData
(
row
);
...
...
@@ -277,7 +286,7 @@ export default {
}
);
}
,
deviceDelete
(
id
,
type
)
{
this
.
$confirm
(
'是否将
用户
丢弃'
,
'提示'
,
{
this
.
$confirm
(
'是否将
设备
丢弃'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
...
...
resources/js/views/history/alarms.vue
View file @
74daa78f
...
...
@@ -21,7 +21,7 @@
<
span
@
click
=
"handleCopy(scope.row.concentration,$event)"
>
{{
scope
.
row
.
concentration
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"报警位置"
width
=
"150"
>
<
el
-
table
-
column
label
=
"报警位置"
>
<
template
slot
-
scope
=
"scope"
>
<
span
@
click
=
"handleCopy(scope.row.location,$event)"
>
{{
scope
.
row
.
location
}}
<
/span
>
<
/template
>
...
...
resources/js/views/history/index.vue
View file @
74daa78f
...
...
@@ -4,37 +4,37 @@
<el-date-picker
v-model=
"value2"
align=
"right"
type=
"date"
placeholder=
"选择日期"
:picker-options=
"pickerOptions"
value-format=
"yyyy-MM-dd"
@
change=
"dataSearch"
></el-date-picker>
</div>
<el-table
:key=
"tableKey"
:data=
"equipment"
border
fit
highlight-current-rows
>
<el-table-column
label=
"设备编号"
width=
"1
30
"
>
<el-table-column
label=
"设备编号"
width=
"1
69
"
>
<template
slot-scope=
"scope"
>
<span
@
click=
"handleCopy(scope.row.devicenum,$event)"
>
{{
scope
.
row
.
devicenum
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"用户姓名"
width=
"1
3
0"
>
<el-table-column
label=
"用户姓名"
width=
"1
4
0"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
username
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"设备备注"
width=
"1
3
0"
>
<el-table-column
label=
"设备备注"
width=
"1
4
0"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
deviceremark
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"设备联系人"
width=
"1
3
0"
>
<el-table-column
label=
"设备联系人"
width=
"1
4
0"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
devicelinkman
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"设备手机号"
width=
"1
3
0"
>
<el-table-column
label=
"设备手机号"
width=
"1
4
0"
>
<
template
slot-scope=
"scope"
>
<span
@
click=
"handleCopy(scope.row.devicephone,$event)"
>
{{
scope
.
row
.
devicephone
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"设备详情"
width=
"130"
>
<el-table-column
label=
"设备详情"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
deviceinfo
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"设备分类"
width=
"1
3
0"
>
<el-table-column
label=
"设备分类"
width=
"1
4
0"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
tname
}}
</span>
</
template
>
...
...
resources/js/views/login/index.vue
View file @
74daa78f
...
...
@@ -113,10 +113,12 @@ export default {
loginForm
:
{
email
:
''
,
password
:
''
,
userOrAdmin
:
2
,
// 管理员
},
userloginForm
:
{
email
:
''
,
password
:
''
,
userOrAdmin
:
1
,
// 用户
},
loginRules
:
{
email
:
[{
required
:
true
,
trigger
:
'blur'
,
validator
:
validateEmail
}],
...
...
@@ -167,6 +169,7 @@ export default {
}
else
if
(
this
.
loginForm
.
password
===
''
)
{
this
.
$message
.
error
(
'密码不能为空'
);
}
else
{
localStorage
.
setItem
(
'userOrAdmin'
,
'2'
);
this
.
$prompt
(
'请输入登入口令'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
...
...
@@ -197,28 +200,21 @@ export default {
}
},
userLogin
()
{
// this.$router.push({ path: '/redirect' + 'user/userslist' });
// if (this.userloginForm.email === '') {
// this.$message.error('邮箱不能为空');
// } else if (this.userloginForm.password === '') {
// this.$message.error('密码不能为空');
// } else {
// userlogin(this.userloginForm)
// .then(response => {
// this.$router.push({ path: '/user/userslist' });
// })
// .catch(err => {
// console.log(err);
// });
this
.
$store
.
dispatch
(
'user/userlogin'
,
this
.
userloginForm
)
.
then
(()
=>
{
this
.
$router
.
push
({
path
:
'/redirect'
+
'user/userslist'
});
this
.
loading
=
false
;
})
.
catch
(()
=>
{
this
.
loading
=
false
;
});
// }
if
(
this
.
userloginForm
.
email
===
''
)
{
this
.
$message
.
error
(
'邮箱不能为空'
);
}
else
if
(
this
.
userloginForm
.
password
===
''
)
{
this
.
$message
.
error
(
'密码不能为空'
);
}
else
{
localStorage
.
setItem
(
'userOrAdmin'
,
'1'
);
this
.
$store
.
dispatch
(
'user/login'
,
this
.
userloginForm
)
.
then
(()
=>
{
this
.
$router
.
push
({
path
:
'/'
});
this
.
loading
=
false
;
})
.
catch
(()
=>
{
this
.
loading
=
false
;
});
}
},
},
};
...
...
resources/js/views/user/index.vue
View file @
74daa78f
...
...
@@ -14,7 +14,7 @@
{{
$t
(
'table.export'
)
}}
</el-button>
<el-badge
v-if=
"paper > 0"
:value=
"paper"
class=
"item"
style=
"margin-bottom: 8px;"
>
<el-button
size=
"small"
>
<el-button
size=
"small"
@
click=
"userpaty"
>
<svg-icon
class-name=
"custom-class"
icon-class=
"feizhilou"
/>
废纸篓
</el-button>
</el-badge>
...
...
@@ -203,6 +203,10 @@ export default {
handleCopy
(
text
,
event
)
{
clip
(
text
,
event
);
}
,
// 用户废纸篓
userpaty
()
{
this
.
$router
.
push
({
path
:
'/users/userStatus'
}
);
}
,
// 编辑
userUpdate
(
id
)
{
this
.
dialogPvVisible
=
true
;
...
...
routes/api.php
View file @
74daa78f
...
...
@@ -62,6 +62,11 @@ Route::group(['middleware'=>'auth:api'],function (){
Route
::
post
(
'SwooleCommand/SwooleCommand'
,
'SwooleCommandController@index'
);
});
//用户路由
Route
::
group
([
'middleware'
=>
'auth:api'
],
function
(){
});
//首页路由
Route
::
group
([
'middleware'
=>
'auth:api'
],
function
(){
Route
::
get
(
'homepagecount/homepagecount'
,
'HomepageController@homepagecount'
);
//删除图片
...
...
@@ -90,6 +95,7 @@ Route::group(['middleware'=>'auth:api'],function (){
Route
::
get
(
'devices/detedevice'
,
'DevicesController@detedevice'
);
//查看历史数据
Route
::
get
(
'devices/control'
,
'DevicesController@control'
);
//返回消防监测
Route
::
get
(
'devices/deviceLocation'
,
'DevicesController@deviceLocation'
);
//返回设备安装位置
Route
::
get
(
'devices/device_info/{id}'
,
'DevicesController@device_info'
);
//返回设备地图详情信息
});
//装维中心
...
...
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