Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-activity-platform
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
李奇
8 years ago
Commit
285b6f67aeb40567b5797053d32d8e3c216caf82
1 parent
a3cd4e36
导出修改
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
66 additions
and
15 deletions
apps/admin/controllers/activity.js
apps/admin/controllers/user.js
apps/admin/views/action/login.hbs
apps/article/controllers/article.js
apps/passport/controllers/user.js
doraemon/middleware/auth.js
doraemon/models/user.js
doraemon/views/error/403.hbs
doraemon/views/error/404.hbs
doraemon/views/error/500.hbs
doraemon/views/layout.hbs
public/scss/admin/user.page.css
apps/admin/controllers/activity.js
View file @
285b6f6
...
...
@@ -232,7 +232,7 @@ const activity = {
cols
:
[
{
caption
:
'文章ID'
,
type
:
'
string
'
type
:
'
number
'
},
{
caption
:
'赞数'
,
...
...
apps/admin/controllers/user.js
View file @
285b6f6
...
...
@@ -110,7 +110,7 @@ const userController = {
let
exportFile
=
excelExport
.
execute
(
conf
);
res
.
setHeader
(
'Content-Type'
,
'application/vnd.openxmlformats'
);
res
.
setHeader
(
'Content-Disposition'
,
'attachment; filename=
article
List.xlsx'
);
res
.
setHeader
(
'Content-Disposition'
,
'attachment; filename=
user
List.xlsx'
);
res
.
end
(
exportFile
,
'binary'
);
})
.
catch
(
next
);
...
...
apps/admin/views/action/login.hbs
View file @
285b6f6
...
...
@@ -8,8 +8,8 @@
<title>
YOHO!Activity Admin
</title>
{{#if
devEnv
}}
<link
rel=
"stylesheet"
media=
"all"
href=
"//
{{
devHost
}}
:5001/common.css?t=
{{
startTime
}}
"
>
<link
rel=
"stylesheet"
media=
"all"
href=
"//
{{
devHost
}}
:5001/
{{
module
}}
.
{{
page
}}
.css?t=
{{
startTime
}}
"
>
<link
rel=
"stylesheet"
media=
"all"
href=
"//
{{
devHost
}}
:5001/css/common.css?t=
{{
startTime
}}
"
>
<link
rel=
"stylesheet"
media=
"all"
href=
"//
{{
devHost
}}
:5001/css/
{{
module
}}
.
{{
page
}}
.css?t=
{{
startTime
}}
"
>
{{^}}
<link
rel=
"stylesheet"
media=
"all"
href=
"/yoho-activity-platform/
{{
version
}}
/css/common.css?t=
{{
startTime
}}
"
>
<link
rel=
"stylesheet"
media=
"all"
href=
"/yoho-activity-platform/
{{
version
}}
/css/
{{
module
}}
.
{{
page
}}
.css?t=
{{
startTime
}}
"
>
...
...
@@ -47,7 +47,7 @@
</div>
{{#if
devEnv
}}
<script
src=
"//
{{
devHost
}}
:5001/libs.js"
></script>
<script
src=
"//
{{
devHost
}}
:5001/
{{
module
}}
.
{{
page
}}
.js"
></script>
<script
src=
"//
{{
devHost
}}
:5001/
js/
{{
module
}}
.
{{
page
}}
.js"
></script>
{{^}}
<script
src=
"/yoho-activity-platform/
{{
version
}}
/libs.js?t=
{{
startTime
}}
"
></script>
<script
src=
"/yoho-activity-platform/
{{
version
}}
/js/
{{
module
}}
.
{{
page
}}
.js?t=
{{
startTime
}}
"
></script>
...
...
apps/article/controllers/article.js
View file @
285b6f6
...
...
@@ -74,8 +74,8 @@ const article = {
res
.
json
({
code
:
200
,
data
:
list
,
pageNo
,
pageSize
,
pageNo
:
+
pageNo
,
pageSize
:
+
pageSize
,
totalCount
,
totalPage
:
Math
.
ceil
(
totalCount
/
pageSize
),
message
:
GET_SUCCESS
...
...
apps/passport/controllers/user.js
View file @
285b6f6
...
...
@@ -28,6 +28,7 @@ const userController = {
// 用户ID
_
.
set
(
req
.
session
,
'user.id'
,
user
.
id
);
_
.
set
(
req
.
session
,
'user.phone'
,
user
.
user_phone
);
res
.
json
({
code
:
200
,
...
...
@@ -55,6 +56,7 @@ const userController = {
// 用户ID
_
.
set
(
req
.
session
,
'user.id'
,
id
);
_
.
set
(
req
.
session
,
'user.phone'
,
mobile
);
res
.
json
({
code
:
200
,
...
...
doraemon/middleware/auth.js
View file @
285b6f6
...
...
@@ -6,9 +6,11 @@
'use strict'
;
const
_
=
require
(
'lodash'
);
const
UserModel
=
require
(
'../models/user'
);
module
.
exports
=
(
req
,
res
,
next
)
=>
{
const
userId
=
_
.
get
(
req
.
session
,
'user.id'
,
0
);
const
userPhone
=
_
.
get
(
req
.
session
,
'user.phone'
);
if
(
!
userId
)
{
if
(
req
.
xhr
)
{
...
...
@@ -21,5 +23,16 @@ module.exports = (req, res, next) => {
}
}
next
();
req
.
ctx
(
UserModel
).
isUserExisted
(
userPhone
)
.
then
(
result
=>
{
if
(
!
result
.
length
)
{
return
res
.
json
({
code
:
403
,
message
:
'抱歉,您暂未验证'
});
}
next
();
})
.
catch
(
next
);
};
...
...
doraemon/models/user.js
0 → 100644
View file @
285b6f6
/**
* 用户鉴权model
* @author: leo <qi.li@yoho.cn>
* @date: 28/06/2017
*/
const
mysqlCli
=
global
.
yoho
.
utils
.
mysqlCli
;
const
TABLE_USER
=
'user'
;
class
UserModel
extends
global
.
yoho
.
BaseModel
{
constructor
(
ctx
)
{
super
(
ctx
);
}
/**
* 判断用户是否存在
* @param phone
* @returns {*}
*/
isUserExisted
(
phone
)
{
return
mysqlCli
.
query
(
`
select
*
from
$
{
TABLE_USER
}
where
user_phone
=
:
phone
;
`
,
{
phone
}
);
}
}
module
.
exports
=
UserModel
;
...
...
doraemon/views/error/403.hbs
View file @
285b6f6
...
...
@@ -8,7 +8,7 @@
<title>
YOHO!活动平台
</title>
{{#if
devEnv
}}
<link
rel=
"stylesheet"
media=
"all"
href=
"//
{{
devHost
}}
:5001/common.css?t=
{{
startTime
}}
"
>
<link
rel=
"stylesheet"
media=
"all"
href=
"//
{{
devHost
}}
:5001/c
ss/c
ommon.css?t=
{{
startTime
}}
"
>
{{^}}
<link
rel=
"stylesheet"
media=
"all"
href=
"/yoho-activity-platform/
{{
version
}}
/css/common.css?t=
{{
startTime
}}
"
>
...
...
doraemon/views/error/404.hbs
View file @
285b6f6
...
...
@@ -8,7 +8,7 @@
<title>
YOHO!活动平台
</title>
{{#if
devEnv
}}
<link
rel=
"stylesheet"
media=
"all"
href=
"//
{{
devHost
}}
:5001/common.css?t=
{{
startTime
}}
"
>
<link
rel=
"stylesheet"
media=
"all"
href=
"//
{{
devHost
}}
:5001/c
ss/c
ommon.css?t=
{{
startTime
}}
"
>
{{^}}
<link
rel=
"stylesheet"
media=
"all"
href=
"/yoho-activity-platform/
{{
version
}}
/css/common.css?t=
{{
startTime
}}
"
>
...
...
doraemon/views/error/500.hbs
View file @
285b6f6
...
...
@@ -8,7 +8,7 @@
<title>
YOHO!活动平台
</title>
{{#if
devEnv
}}
<link
rel=
"stylesheet"
media=
"all"
href=
"//
{{
devHost
}}
:5001/common.css?t=
{{
startTime
}}
"
>
<link
rel=
"stylesheet"
media=
"all"
href=
"//
{{
devHost
}}
:5001/c
ss/c
ommon.css?t=
{{
startTime
}}
"
>
{{^}}
<link
rel=
"stylesheet"
media=
"all"
href=
"/yoho-activity-platform/
{{
version
}}
/css/common.css?t=
{{
startTime
}}
"
>
...
...
doraemon/views/layout.hbs
View file @
285b6f6
...
...
@@ -8,8 +8,8 @@
<title>
YOHO!活动平台
</title>
{{#if
devEnv
}}
<link
rel=
"stylesheet"
media=
"all"
href=
"//
{{
devHost
}}
:5001/common.css?t=
{{
startTime
}}
"
>
<link
rel=
"stylesheet"
media=
"all"
href=
"//
{{
devHost
}}
:5001/
{{
module
}}
.
{{
page
}}
.css?t=
{{
startTime
}}
"
>
<link
rel=
"stylesheet"
media=
"all"
href=
"//
{{
devHost
}}
:5001/css/common.css?t=
{{
startTime
}}
"
>
<link
rel=
"stylesheet"
media=
"all"
href=
"//
{{
devHost
}}
:5001/css/
{{
module
}}
.
{{
page
}}
.css?t=
{{
startTime
}}
"
>
{{^}}
<link
rel=
"stylesheet"
media=
"all"
href=
"/yoho-activity-platform/
{{
version
}}
/css/common.css?t=
{{
startTime
}}
"
>
<link
rel=
"stylesheet"
media=
"all"
...
...
@@ -109,10 +109,10 @@
</div>
{{#if
devEnv
}}
<script
src=
"//
{{
devHost
}}
:5001/libs.js"
></script>
<script
src=
"//
{{
devHost
}}
:5001/
{{
module
}}
.
{{
page
}}
.js"
></script>
<script
src=
"//
{{
devHost
}}
:5001/
js/
{{
module
}}
.
{{
page
}}
.js"
></script>
{{^}}
<script
src=
"/yoho-activity-platform/
{{
version
}}
/libs.js?t=
{{
startTime
}}
"
></script>
<script
src=
"/yoho-activity-platform/
{{
version
}}
/js/
{{
module
}}
.
{{
page
}}
.js?t=
{{
startTime
}}
"
></script>
<script
src=
"/yoho-activity-platform/
{{
version
}}
/js/
{{
module
}}
.
{{
page
}}
.js?t=
{{
startTime
}}
"
></script>
{{/if}}
</body>
</html>
...
...
public/scss/admin/user.page.css
0 → 100644
View file @
285b6f6
.test
{
color
:
cadetblue
;
}
...
...
Please
register
or
login
to post a comment