Commit 1e2c2369 authored by 任国军's avatar 任国军

actImageList remove auth

parent 528d8d20
Pipeline #26863 passed with stage
in 4 seconds
...@@ -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');// 获取礼品列表
}; };
...@@ -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;
} }
......
...@@ -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 };
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment