Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
51business
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
方斌
51business
Commits
1e2c2369
Commit
1e2c2369
authored
Jul 27, 2020
by
任国军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
actImageList remove auth
parent
528d8d20
Pipeline
#26863
passed with stage
in 4 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
course_v5.js
app/router/course_v5.js
+3
-3
option.js
app/service/course/v5/option.js
+3
-3
user.js
app/service/course/v5/user.js
+9
-9
No files found.
app/router/course_v5.js
View file @
1e2c2369
...
@@ -17,8 +17,8 @@ module.exports = app => {
...
@@ -17,8 +17,8 @@ module.exports = app => {
router
.
get
(
'third'
,
'/user/address'
,
auth
({
is_force
:
1
}),
'course.v5.user.getUserAddress'
);
// 获取用户收货地址
router
.
get
(
'third'
,
'/user/address'
,
auth
({
is_force
:
1
}),
'course.v5.user.getUserAddress'
);
// 获取用户收货地址
router
.
get
(
'third'
,
'/user/order/all'
,
auth
({
is_force
:
1
}),
'course.v5.user.getUserOrderList'
);
// 获取订单列表
router
.
get
(
'third'
,
'/user/order/all'
,
auth
({
is_force
:
1
}),
'course.v5.user.getUserOrderList'
);
// 获取订单列表
router
.
post
(
'third'
,
'/user/redeem/class'
,
auth
({
is_force
:
1
}),
'course.v5.user.redeemClass'
);
// 兑换课程
router
.
post
(
'third'
,
'/user/redeem/class'
,
auth
({
is_force
:
1
}),
'course.v5.user.redeemClass'
);
// 兑换课程
router
.
post
(
'third'
,
'/user/act/image'
,
auth
({
is_force
:
1
}),
'course.v5.user.addUserActImages'
);
// 更新用户礼品列表
router
.
post
(
'third'
,
'/user/act/image'
,
auth
({
is_force
:
1
}),
'course.v5.user.addUserActImages'
);
// 更新用户礼品列表
router
.
get
(
'third'
,
'/user/act/image/all'
,
auth
({
is_force
:
1
}),
'course.v5.user.getUserActImageList'
);
// 获取用户礼品列表
router
.
get
(
'third'
,
'/user/act/image/all'
,
auth
({
is_force
:
1
}),
'course.v5.user.getUserActImageList'
);
// 获取用户礼品列表
router
.
get
(
'third'
,
'/category/all'
,
auth
({
is_force
:
0
}),
'course.v5.option.getCategoryList'
);
// 获取分类列表
router
.
get
(
'third'
,
'/category/all'
,
auth
({
is_force
:
0
}),
'course.v5.option.getCategoryList'
);
// 获取分类列表
router
.
get
(
'third'
,
'/banner/all'
,
'course.v5.option.getBannerList'
);
// 获取banner列表
router
.
get
(
'third'
,
'/banner/all'
,
'course.v5.option.getBannerList'
);
// 获取banner列表
...
@@ -66,5 +66,5 @@ module.exports = app => {
...
@@ -66,5 +66,5 @@ module.exports = app => {
router
.
post
(
'third'
,
'/order/class/:class_id'
,
auth
({
is_force
:
1
}),
'course.v5.user.buyClass'
);
// 购买课程
router
.
post
(
'third'
,
'/order/class/:class_id'
,
auth
({
is_force
:
1
}),
'course.v5.user.buyClass'
);
// 购买课程
router
.
get
(
'third'
,
'/act/image/all'
,
auth
({
is_force
:
1
}),
'course.v5.option.getActImageList'
);
// 获取礼品列表
router
.
get
(
'third'
,
'/act/image/all'
,
'course.v5.option.getActImageList'
);
// 获取礼品列表
};
};
app/service/course/v5/option.js
View file @
1e2c2369
...
@@ -378,12 +378,12 @@ class OptionService extends Service {
...
@@ -378,12 +378,12 @@ class OptionService extends Service {
// 获取礼品页
// 获取礼品页
async
getActImageList
()
{
async
getActImageList
()
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
giftList
=
await
ctx
.
classModel
.
CourseActImage
.
findAll
({
where
:
{
status
:
1
,
is_deleted
:
0
},
attributes
:[
'id'
,
'selected_image'
,
'unselected_image'
]
});
const
giftList
=
await
ctx
.
classModel
.
CourseActImage
.
findAll
({
where
:
{
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'id'
,
'selected_image'
,
'unselected_image'
]
});
const
ret
=
{
const
ret
=
{
list
:
giftList
,
list
:
giftList
,
}
}
;
return
ret
;
return
ret
;
}
}
...
...
app/service/course/v5/user.js
View file @
1e2c2369
...
@@ -522,7 +522,7 @@ class UserService extends Service {
...
@@ -522,7 +522,7 @@ class UserService extends Service {
// app登录
// app登录
async
loginByApp
()
{
async
loginByApp
()
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
appUserId
=
ctx
.
cookies
.
get
(
'app_user_id'
,
{
signed
:
false
});
const
appUserId
=
ctx
.
cookies
.
get
(
'app_user_id'
,
{
signed
:
false
});
const
token
=
ctx
.
cookies
.
get
(
'token'
,
{
signed
:
false
});
const
token
=
ctx
.
cookies
.
get
(
'token'
,
{
signed
:
false
});
const
userId
=
ctx
.
cookies
.
get
(
'user_id'
,
{
signed
:
false
});
const
userId
=
ctx
.
cookies
.
get
(
'user_id'
,
{
signed
:
false
});
...
@@ -540,7 +540,7 @@ class UserService extends Service {
...
@@ -540,7 +540,7 @@ class UserService extends Service {
if
(
ctx
.
isEmpty
(
token
))
{
if
(
ctx
.
isEmpty
(
token
))
{
const
jianbing_customer_id
=
ctx
.
cookies
.
get
(
'jianbing_customer_id'
,
{
signed
:
false
});
const
jianbing_customer_id
=
ctx
.
cookies
.
get
(
'jianbing_customer_id'
,
{
signed
:
false
});
const
auth_token
=
ctx
.
cookies
.
get
(
'auth_token'
,
{
signed
:
false
});
const
auth_token
=
ctx
.
cookies
.
get
(
'auth_token'
,
{
signed
:
false
});
params
=
await
this
.
service
.
user
.
goRegister
({
jianbing_customer_id
,
auth_token
});
params
=
await
this
.
service
.
user
.
goRegister
({
jianbing_customer_id
,
auth_token
});
}
}
const
result
=
await
ctx
.
helper
.
send_request
(
ctx
.
app
.
config
.
NODE_URL
+
'/user/auth'
,
params
,
{
const
result
=
await
ctx
.
helper
.
send_request
(
ctx
.
app
.
config
.
NODE_URL
+
'/user/auth'
,
params
,
{
...
@@ -601,20 +601,20 @@ class UserService extends Service {
...
@@ -601,20 +601,20 @@ class UserService extends Service {
// 获取用户的礼品列表
// 获取用户的礼品列表
async
getUserActImageList
()
{
async
getUserActImageList
()
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
userImageList
=
await
ctx
.
classModel
.
CourseUserActImage
.
findAll
({
where
:
{
user_uuid
:
ctx
.
userUuid
,
status
:
1
,
is_deleted
:
0
}
});
const
userImageList
=
await
ctx
.
classModel
.
CourseUserActImage
.
findAll
({
where
:
{
user_uuid
:
ctx
.
userUuid
,
status
:
1
,
is_deleted
:
0
}
});
const
imageList
=
await
ctx
.
classModel
.
CourseActImage
.
findAll
({
where
:
{
id
:
{
$in
:
R
.
pluck
(
'image_id'
,
userImageList
)}},
attributes
:
[
'id'
,
'selected_image'
,
'unselected_image'
]
});
const
imageList
=
await
ctx
.
classModel
.
CourseActImage
.
findAll
({
where
:
{
id
:
{
$in
:
R
.
pluck
(
'image_id'
,
userImageList
)
}
},
attributes
:
[
'id'
,
'selected_image'
,
'unselected_image'
]
});
const
ret
=
{
const
ret
=
{
list
:
imageList
,
list
:
imageList
,
}
}
;
return
ret
;
return
ret
;
}
}
// 更新用户的礼品列表
// 更新用户的礼品列表
async
addUserActImages
(
input
)
{
async
addUserActImages
(
input
)
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
let
ids
=
input
.
ids
||
''
;
let
ids
=
input
.
ids
||
''
;
if
(
ctx
.
isEmpty
(
ids
))
{
if
(
ctx
.
isEmpty
(
ids
))
{
ctx
.
failed
(
'ids is empty'
);
ctx
.
failed
(
'ids is empty'
);
...
@@ -622,10 +622,10 @@ class UserService extends Service {
...
@@ -622,10 +622,10 @@ class UserService extends Service {
ids
=
ids
.
split
(
','
);
ids
=
ids
.
split
(
','
);
for
(
const
id
of
ids
)
{
for
(
const
id
of
ids
)
{
await
ctx
.
classModel
.
CourseUserActImage
.
findOrCreate
({
where
:
{
user_uuid
:
ctx
.
userUuid
,
image_id
:
id
,
is_deleted
:
0
},
defaults
:
{
user_uuid
:
ctx
.
userUuid
,
image_id
:
id
}
});
await
ctx
.
classModel
.
CourseUserActImage
.
findOrCreate
({
where
:
{
user_uuid
:
ctx
.
userUuid
,
image_id
:
id
,
is_deleted
:
0
},
defaults
:
{
user_uuid
:
ctx
.
userUuid
,
image_id
:
id
}
});
}
}
return
{
result
:
true
};
return
{
result
:
true
};
}
}
}
}
...
...
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