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
1da5945d
Commit
1da5945d
authored
Apr 26, 2020
by
冯超鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新模块
parent
0bd713ac
Pipeline
#29
failed with stages
Changes
10
Pipelines
1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
192 additions
and
297 deletions
+192
-297
WxuserController.php
app/Http/Controllers/WxuserController.php
+38
-2
dump.rdb
dump.rdb
+0
-0
wxuser.js
resources/js/api/wxuser.js
+30
-0
device.svg
resources/js/icons/svg/device.svg
+1
-0
devicelist.svg
resources/js/icons/svg/devicelist.svg
+1
-0
index.js
resources/js/router/index.js
+3
-1
device.js
resources/js/router/modules/device.js
+23
-0
index.vue
resources/js/views/device/index.vue
+9
-0
index.vue
resources/js/views/wx_user/index.vue
+86
-294
api.php
routes/api.php
+1
-0
No files found.
app/Http/Controllers/WxuserController.php
View file @
1da5945d
...
...
@@ -9,7 +9,7 @@
namespace
App\Http\Controllers
;
use
App\Laravue\Models\wxUser
;
use
App\Laravue\Models\wxUser
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Http\Resources\Json\ResourceCollection
;
...
...
@@ -26,18 +26,54 @@ class WxuserController extends Controller
* */
$pagenNum
=
$request
->
input
(
'page'
)
-
1
;
//页数
$limit
=
$request
->
input
(
'limit'
);
if
(
$pagenNum
===
''
||
$limit
==
''
){
return
$this
->
jsonErrorData
(
105
,
'页数或limit不能为空'
);
}
$cont
=
Wxuser
::
count
();
$Wxuser
=
Wxuser
::
select
(
'nickname'
,
'id'
,
'openid'
,
'sex'
,
'province'
,
'city'
,
'mobile'
,
'country'
,
'headimgurl'
,
'created_at'
,
'state'
)
->
offset
(
$pagenNum
)
->
orderBy
(
'id'
,
'desc'
)
->
limit
(
$limit
)
->
get
();
$data
=
[
'Wxuser'
=>
$Wxuser
,
'cont'
=>
$cont
];
if
(
$Wxuser
){
return
$this
->
jsonSuccessData
(
$
Wxuser
);
return
$this
->
jsonSuccessData
(
$
data
);
}
else
{
return
$this
->
jsonErrorData
(
'105'
,
'获取数据失败'
);
}
}
//用户搜索
public
function
seek
(
Request
$request
){
$keys
=
$request
->
all
();
$handle
=
DB
::
table
(
'wx_User'
);
foreach
(
$keys
as
$key
=>
$val
)
{
if
(
$key
==
'page'
)
{
unset
(
$keys
[
$key
]);
}
elseif
(
$key
==
'limit'
){
unset
(
$keys
[
$key
]);
}
}
foreach
(
$keys
as
$k
=>
$v
)
{
if
(
$k
==
'sex'
){
if
(
$v
==
'男'
){
$v
=
1
;
}
else
if
(
$v
==
'女'
){
$v
=
2
;
}
}
else
if
(
$k
==
'state'
){
if
(
$v
==
'正常'
){
$v
=
2
;
}
else
if
(
'禁用'
){
$v
=
1
;
}
}
$keys
[
$key
]
&&
$handle
->
where
(
$k
,
'like'
,
'%'
.
$v
.
'%'
);
}
$datas
=
$handle
->
get
();
$cont
=
$handle
->
count
();
$data
=
[
'Wxuser'
=>
$datas
,
'cont'
=>
$cont
];
return
$this
->
jsonSuccessData
(
$data
);
}
}
\ No newline at end of file
dump.rdb
View file @
1da5945d
No preview for this file type
resources/js/api/wxuser.js
0 → 100644
View file @
1da5945d
import
request
from
'@/utils/request'
;
import
Resource
from
'@/api/resource'
;
class
UserResource
extends
Resource
{
constructor
()
{
super
(
'wxuser/wxlist'
);
}
permissions
(
id
)
{
return
request
({
url
:
'/'
+
this
.
uri
+
'/'
+
id
+
'/permissions'
,
method
:
'get'
,
});
}
fetchArticle
(
data
)
{
return
request
({
url
:
'/wxuser/seek'
,
method
:
'post'
,
data
,
});
}
updatePermission
(
id
,
permissions
)
{
return
request
({
url
:
'/'
+
this
.
uri
+
'/'
+
id
+
'/permissions'
,
method
:
'put'
,
data
:
permissions
,
});
}
}
export
{
UserResource
as
default
};
resources/js/icons/svg/device.svg
0 → 100644
View file @
1da5945d
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
t=
"1587887688558"
class=
"icon"
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"1201"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"200"
height=
"200"
><defs><style
type=
"text/css"
></style></defs><path
d=
"M860.16 184.32H163.84a122.88 122.88 0 0 0-122.88 122.88v40.96a122.88 122.88 0 0 0 122.88 122.88h696.32a122.88 122.88 0 0 0 122.88-122.88v-40.96a122.88 122.88 0 0 0-122.88-122.88z m81.92 163.84a81.92 81.92 0 0 1-81.92 81.92H163.84a81.92 81.92 0 0 1-81.92-81.92v-40.96a81.92 81.92 0 0 1 81.92-81.92h696.32a81.92 81.92 0 0 1 81.92 81.92zM860.16 552.96H163.84a122.88 122.88 0 0 0-122.88 122.88v40.96a122.88 122.88 0 0 0 122.88 122.88h696.32a122.88 122.88 0 0 0 122.88-122.88v-40.96a122.88 122.88 0 0 0-122.88-122.88z m81.92 163.84a81.92 81.92 0 0 1-81.92 81.92H163.84a81.92 81.92 0 0 1-81.92-81.92v-40.96a81.92 81.92 0 0 1 81.92-81.92h696.32a81.92 81.92 0 0 1 81.92 81.92z"
p-id=
"1202"
></path><path
d=
"M184.32 266.24a61.44 61.44 0 1 0 61.44 61.44 61.44 61.44 0 0 0-61.44-61.44z m0 81.92a20.48 20.48 0 1 1 20.48-20.48 20.48 20.48 0 0 1-20.48 20.48zM839.68 634.88a61.44 61.44 0 1 0 61.44 61.44 61.44 61.44 0 0 0-61.44-61.44z m0 81.92a20.48 20.48 0 1 1 20.48-20.48 20.48 20.48 0 0 1-20.48 20.48zM204.8 614.4a81.92 81.92 0 0 0-79.0528 102.4h43.8272A40.96 40.96 0 0 1 163.84 696.32a40.96 40.96 0 0 1 40.96-40.96h81.92v-40.96zM860.16 327.68a40.96 40.96 0 0 1-5.7344 20.48h43.8272A81.92 81.92 0 0 0 819.2 245.76v40.96a40.96 40.96 0 0 1 40.96 40.96zM737.28 245.76h40.96v40.96h-40.96z"
p-id=
"1203"
></path></svg>
\ No newline at end of file
resources/js/icons/svg/devicelist.svg
0 → 100644
View file @
1da5945d
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
t=
"1587888568774"
class=
"icon"
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"1355"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"200"
height=
"200"
><defs><style
type=
"text/css"
></style></defs><path
d=
"M448 416h-64a32 32 0 1 1 0-64h64a32 32 0 1 1 0 64z m320 256H256a32 32 0 0 1 0-64h512a32 32 0 0 1 0 64z m0 128H256a32 32 0 0 1 0-64h512a32 32 0 0 1 0 64z m-32-256H288a64 64 0 0 1-64-64V288a64 64 0 0 1 64-64h448a64 64 0 0 1 64 64v192a64 64 0 0 1-64 64zM288 288v192h448V288H288z"
p-id=
"1356"
></path></svg>
\ No newline at end of file
resources/js/router/index.js
View file @
1da5945d
...
...
@@ -18,6 +18,7 @@ import componentRoutes from './modules/components';
import
chartsRoutes
from
'./modules/charts'
;
import
tableRoutes
from
'./modules/table'
;
import
adminRoutes
from
'./modules/admin'
;
import
deviceRoutes
from
'./modules/device'
;
import
nestedRoutes
from
'./modules/nested'
;
import
errorRoutes
from
'./modules/error'
;
import
excelRoutes
from
'./modules/excel'
;
...
...
@@ -128,6 +129,7 @@ export const asyncRoutes = [
nestedRoutes
,
tableRoutes
,
adminRoutes
,
deviceRoutes
,
{
path
:
'/theme'
,
component
:
Layout
,
...
...
@@ -210,7 +212,7 @@ export const asyncRoutes = [
meta
:
{
permissions
:
[
'view menu wx_user'
]
},
children
:
[
{
path
:
'
index
'
,
path
:
'
wxuser/wxlist
'
,
component
:
()
=>
import
(
'@/views/wx_user'
),
name
:
'wx_user'
,
meta
:
{
title
:
'wx_user'
,
icon
:
'wechat'
},
...
...
resources/js/router/modules/device.js
0 → 100644
View file @
1da5945d
import
Layout
from
'@/layout'
;
const
deviceRoutes
=
{
path
:
'/device'
,
component
:
Layout
,
redirect
:
'/device/index'
,
name
:
'Device'
,
alwaysShow
:
true
,
meta
:
{
title
:
'device'
,
icon
:
'device'
,
permissions
:
[
'view menu administrator'
],
},
children
:
[
{
path
:
'device'
,
component
:
()
=>
import
(
'@/views/device/index'
),
name
:
'Device'
,
meta
:
{
title
:
'设备管理'
,
icon
:
'devicelist'
,
permissions
:
[
'manage user'
]
},
},
],
};
export
default
deviceRoutes
;
resources/js/views/device/index.vue
0 → 100644
View file @
1da5945d
<
template
>
<div></div>
</
template
>
<
script
>
</
script
>
<
style
>
</
style
>
resources/js/views/wx_user/index.vue
View file @
1da5945d
This diff is collapsed.
Click to expand it.
routes/api.php
View file @
1da5945d
...
...
@@ -28,6 +28,7 @@ Route::group(['middleware' => 'auth:api'], function () {
Route
::
apiResource
(
'permissions'
,
'PermissionController'
)
->
middleware
(
'permission:'
.
\App\Laravue\Acl
::
PERMISSION_PERMISSION_MANAGE
);
Route
::
get
(
'wxuser/wxlist'
,
'WxuserController@wxlist'
);
//微信用户列表
Route
::
post
(
'wxuser/seek'
,
'WxuserController@seek'
);
//微信搜索
Route
::
get
(
'user/HUserList'
,
'UserController@HUserList'
);
//用户列表
Route
::
post
(
'user/addUser'
,
'UserController@addUser'
)
->
middleware
(
'permission:'
.
\App\Laravue\Acl
::
PERMISSION_PERMISSION_MANAGE
);
//新增用户
Route
::
post
(
'user/deleteuser'
,
'UserController@deleteuser'
)
->
middleware
(
'permission:'
.
\App\Laravue\Acl
::
PERMISSION_PERMISSION_MANAGE
);
//删除用户
...
...
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