商店:bug修复
This commit is contained in:
@@ -52,12 +52,12 @@ export class ShopHandler {
|
||||
let sid = session.get('sid');
|
||||
let serverId = session.get('serverId');
|
||||
|
||||
let { activityId, shopItemId, count } = msg;
|
||||
let { activityId = 0, shopItemId, count } = msg;
|
||||
if( count < 0) return resResult(STATUS.WRONG_PARMS);
|
||||
|
||||
let dicShopItem = await getShopDicById(activityId, shopItemId, roleId, serverId);
|
||||
if(!dicShopItem) return STATUS.DIC_DATA_NOT_FOUND;
|
||||
if(dicShopItem['productID']) return resResult(STATUS.CAN_NOT_PURCHASE);
|
||||
if(dicShopItem['productID'] && dicShopItem['productID'] != '&') return resResult(STATUS.CAN_NOT_PURCHASE);
|
||||
|
||||
let userShop = await UserShopModel.findByRoleAndItem(roleId, activityId, dicShopItem);
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ async function getShopListByData(shop: number, type: number, userShopRecs: UserS
|
||||
|
||||
|
||||
export async function getShopDicById(activityId: number, itemId: number, roleId: string, serverId: number) {
|
||||
if(activityId == 0) {
|
||||
if(!activityId || activityId == 0) {
|
||||
return gameData.shopItem.get(itemId);
|
||||
} else {
|
||||
let activityData = await getShopActivityById(roleId, serverId, activityId);
|
||||
|
||||
Reference in New Issue
Block a user