商家后台登录bug修复
This commit is contained in:
parent
92ec2f5735
commit
18d504cbe7
14
README.MD
14
README.MD
@ -32,6 +32,14 @@ docker ps -aq | xargs docker inspect --format='{{.LogPath}}' | xargs truncate -s
|
||||
查看哪个文件夹占空间
|
||||
du -sh * | sort -h
|
||||
|
||||
找到日志文件,清空:
|
||||
#find . -name "*.log" -type f -exec rm -rf {} \;
|
||||
cat /dev/null > 日志文件名
|
||||
cd /data/docker/overlay2
|
||||
查看哪个文件夹占空间
|
||||
du -sh * | sort -h
|
||||
|
||||
进入到 大文件的目录下,执行以下脚本
|
||||
for file in *log*; do
|
||||
cat /dev/null > "$file"
|
||||
done
|
||||
|
||||
或者递归删除log 文件
|
||||
find overlay2 -type f -name "*.log.*" -print0 | xargs -0 -I {} cat /dev/null > {}
|
||||
@ -2466,11 +2466,11 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
}
|
||||
|
||||
// 发送短信或邮件验证码
|
||||
// if (getVerifyCode(mobileOrEmail)) {
|
||||
return CommonResult.success(new JSONObject().put("number", mobileOrEmail));
|
||||
//}
|
||||
if (getVerifyCode(mobileOrEmail)) {
|
||||
return CommonResult.success(new JSONObject().put("number", mobileOrEmail));
|
||||
}
|
||||
|
||||
//return CommonResult.failed();
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
|
||||
@ -2577,6 +2577,11 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO 此处测试用途, 生产部署之后,正式加上验证校验
|
||||
if ("9999".equals(verifyCode)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 带国家码手机号码
|
||||
number = PhoneNumberUtils.convZhPhoneNumber(number);
|
||||
|
||||
@ -2823,8 +2828,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
}
|
||||
|
||||
String verifyMobile = PhoneNumberUtils.convZhPhoneNumber(user_mobile);
|
||||
// if (!checkVerifyCode(verifyMobile, verify_code)) {
|
||||
if (!"9999".equals(verify_code)) {
|
||||
if (!checkVerifyCode(verifyMobile, verify_code)) {
|
||||
// TODO 切换到正式平台
|
||||
return CommonResult.failed(_("验证码错误!"));
|
||||
}
|
||||
|
||||
@ -22,10 +22,11 @@ import com.suisung.mall.common.modules.admin.*;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreBase;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreEmployee;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreEmployeeRightsGroup;
|
||||
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
||||
import com.suisung.mall.common.utils.CheckUtil;
|
||||
import com.suisung.mall.common.utils.I18nUtil;
|
||||
import com.suisung.mall.common.utils.UserInfoService;
|
||||
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -44,6 +45,7 @@ import static com.suisung.mall.common.utils.ContextUtil.getCurrentUser;
|
||||
* @author Xinze
|
||||
* @since 2021-03-26
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class AdminBaseMenuServiceImpl extends BaseServiceImpl<AdminBaseMenuMapper, AdminBaseMenu> implements AdminBaseMenuService {
|
||||
|
||||
@ -76,6 +78,7 @@ public class AdminBaseMenuServiceImpl extends BaseServiceImpl<AdminBaseMenuMappe
|
||||
@Override
|
||||
public List<Router> getRouterList() {
|
||||
UserDto user = getCurrentUser();
|
||||
// log.debug("##### 当前登录用户:{}###", JsonUtil.object2json(user));
|
||||
|
||||
if (ObjectUtil.isEmpty(user)) {
|
||||
throw new ApiException(ResultCode.UNAUTHORIZED);
|
||||
@ -86,8 +89,10 @@ public class AdminBaseMenuServiceImpl extends BaseServiceImpl<AdminBaseMenuMappe
|
||||
//获取所有protocol
|
||||
List<AdminBaseProtocol> protocolList = adminBaseProtocolService.find(new QueryWrapper<>());
|
||||
|
||||
// 服务端返回rid 角色编号 0-用户;2-商家;3-门店;9-平台;
|
||||
// 获取所有目录
|
||||
if (role_id == RoleIdEnum.PLATFORM.getState()) {
|
||||
// menu_role 角色类型(LIST):1-平台;2-商家管理端;3-门店
|
||||
List<AdminBaseMenu> menus = find(new QueryWrapper<AdminBaseMenu>().eq("menu_role", 1)
|
||||
.eq("menu_enable", 1).orderByAsc("menu_order"));
|
||||
|
||||
@ -106,7 +111,6 @@ public class AdminBaseMenuServiceImpl extends BaseServiceImpl<AdminBaseMenuMappe
|
||||
|
||||
//有效权限rights_id
|
||||
List<Integer> userRightsList = new ArrayList<>();
|
||||
|
||||
for (List<Integer> sr : rightsIds) {
|
||||
userRightsList.addAll(sr);
|
||||
}
|
||||
@ -158,10 +162,9 @@ public class AdminBaseMenuServiceImpl extends BaseServiceImpl<AdminBaseMenuMappe
|
||||
}
|
||||
|
||||
//移除空菜单-无下级菜单的Layout
|
||||
|
||||
|
||||
return BuildRouters(menus, 0);
|
||||
} else if (role_id == RoleIdEnum.STORE.getState()) {
|
||||
// menu_role 角色类型(LIST):1-平台;2-商家管理端;3-门店
|
||||
List<AdminBaseMenu> menus = find(new QueryWrapper<AdminBaseMenu>().eq("menu_role", 2)
|
||||
.eq("menu_enable", 1).orderByAsc("menu_order"));
|
||||
|
||||
@ -239,7 +242,9 @@ public class AdminBaseMenuServiceImpl extends BaseServiceImpl<AdminBaseMenuMappe
|
||||
}
|
||||
}
|
||||
return BuildRouters(menus, 8);
|
||||
|
||||
} else if (role_id == RoleIdEnum.CHAIN.getState()) {
|
||||
// menu_role 角色类型(LIST):1-平台;2-商家管理端;3-门店
|
||||
List<AdminBaseMenu> menus = find(new QueryWrapper<AdminBaseMenu>().eq("menu_role", 3)
|
||||
.eq("menu_enable", 1).orderByAsc("menu_order"));
|
||||
|
||||
|
||||
@ -38,7 +38,9 @@ public class ContextUtil {
|
||||
*/
|
||||
public static UserDto getCurrentUser() {
|
||||
try {
|
||||
return staticUserInfoService.getUser();
|
||||
UserDto loginUser = staticUserInfoService.getUser();
|
||||
log.info("##### 当前登录用户:{}###", JsonUtil.object2json(loginUser));
|
||||
return loginUser;
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
|
||||
@ -3090,60 +3090,60 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
throw new ApiException(I18nUtil._("新增店铺失败"));
|
||||
}
|
||||
|
||||
// 如果商家是企业,则保存商家公司信息
|
||||
if (CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMerchEntry.getEntity_type())) {
|
||||
// shop_store_company
|
||||
ShopStoreCompany shopStoreCompany = new ShopStoreCompany();
|
||||
shopStoreCompany.setUser_id(userId);
|
||||
shopStoreCompany.setStore_id(storeId);
|
||||
// 如果商家是企业,则保存商家公司信息, 是个人的,也需要保存相关应有信息,公司信息不能空着
|
||||
// shop_store_company
|
||||
ShopStoreCompany shopStoreCompany = new ShopStoreCompany();
|
||||
shopStoreCompany.setUser_id(userId);
|
||||
shopStoreCompany.setStore_id(storeId);
|
||||
|
||||
// 公司名
|
||||
shopStoreCompany.setCompany_name(shopMerchEntry.getBiz_license_company());
|
||||
shopStoreCompany.setCompany_area(shopStoreBase.getStore_area());
|
||||
shopStoreCompany.setCompany_address(shopMerchEntry.getStore_address());
|
||||
// 联系人
|
||||
shopStoreCompany.setContacts_name(shopMerchEntry.getContact_name());
|
||||
shopStoreCompany.setContacts_phone(shopMerchEntry.getLogin_mobile());
|
||||
|
||||
// 营业执照
|
||||
shopStoreCompany.setBusiness_id(shopMerchEntry.getBiz_license_number());
|
||||
shopStoreCompany.setBusiness_license_electronic(shopMerchEntry.getBiz_license_image());
|
||||
// 公司名
|
||||
String companyName = shopMerchEntry.getBiz_license_company();
|
||||
companyName = StrUtil.isBlank(companyName) ? shopMerchEntry.getStore_name() : companyName;
|
||||
shopStoreCompany.setCompany_name(companyName);
|
||||
shopStoreCompany.setCompany_area(shopStoreBase.getStore_area());
|
||||
shopStoreCompany.setCompany_address(shopMerchEntry.getStore_address());
|
||||
|
||||
// 企业法人
|
||||
shopStoreCompany.setLegal_person(shopMerchEntry.getLegal_person_name());
|
||||
shopStoreCompany.setLegal_person_number(shopMerchEntry.getLegal_person_id_number());
|
||||
shopStoreCompany.setLegal_person_electronic(shopMerchEntry.getLegal_person_id_images());
|
||||
// 营业执照
|
||||
shopStoreCompany.setBusiness_id(shopMerchEntry.getBiz_license_number());
|
||||
shopStoreCompany.setBusiness_license_electronic(shopMerchEntry.getBiz_license_image());
|
||||
|
||||
// 联系人
|
||||
shopStoreCompany.setContacts_name(shopMerchEntry.getContact_name());
|
||||
shopStoreCompany.setContacts_phone(shopMerchEntry.getLogin_mobile());
|
||||
// 企业法人
|
||||
shopStoreCompany.setLegal_person(shopMerchEntry.getLegal_person_name());
|
||||
shopStoreCompany.setLegal_person_number(shopMerchEntry.getLegal_person_id_number());
|
||||
shopStoreCompany.setLegal_person_electronic(shopMerchEntry.getLegal_person_id_images());
|
||||
|
||||
// 银行对公账号
|
||||
shopStoreCompany.setBank_account_name(shopMerchEntry.getAccount_holder_name());
|
||||
shopStoreCompany.setBank_account_number(shopMerchEntry.getAccount_number());
|
||||
shopStoreCompany.setBank_name(shopMerchEntry.getBank_name());
|
||||
// 银行对公账号
|
||||
shopStoreCompany.setBank_account_name(shopMerchEntry.getAccount_holder_name());
|
||||
shopStoreCompany.setBank_account_number(shopMerchEntry.getAccount_number());
|
||||
shopStoreCompany.setBank_name(shopMerchEntry.getBank_name());
|
||||
|
||||
Date today = new Date();
|
||||
shopStoreCompany.setOrganization_code_start(today);
|
||||
shopStoreCompany.setOrganization_code_end(DateUtil.offsetDay(today, 365 * 5));
|
||||
shopStoreCompany.setEstablish_date(today);
|
||||
shopStoreCompany.setBusiness_licence_start(today);
|
||||
shopStoreCompany.setBusiness_licence_end(DateUtil.offsetDay(today, 365 * 5));
|
||||
Date today = new Date();
|
||||
shopStoreCompany.setOrganization_code_start(today);
|
||||
shopStoreCompany.setOrganization_code_end(DateUtil.offsetDay(today, 365 * 5));
|
||||
shopStoreCompany.setEstablish_date(today);
|
||||
shopStoreCompany.setBusiness_licence_start(today);
|
||||
shopStoreCompany.setBusiness_licence_end(DateUtil.offsetDay(today, 365 * 5));
|
||||
|
||||
shopStoreCompany.setCompany_description("");
|
||||
shopStoreCompany.setStore_class_ids("");
|
||||
shopStoreCompany.setStore_class_names("");
|
||||
shopStoreCompany.setStore_class_commission("");
|
||||
shopStoreCompany.setCompany_description(shopMerchEntry.getStore_name());
|
||||
shopStoreCompany.setStore_class_ids("");
|
||||
shopStoreCompany.setStore_class_names("");
|
||||
shopStoreCompany.setStore_class_commission("");
|
||||
|
||||
// 待补充
|
||||
if (!shopStoreCompanyService.save(shopStoreCompany)) {
|
||||
logger.error("生成店铺:新增店铺公司失败");
|
||||
throw new ApiException(I18nUtil._("新增店铺公司失败"));
|
||||
}
|
||||
// 待补充
|
||||
if (!shopStoreCompanyService.save(shopStoreCompany)) {
|
||||
logger.error("生成店铺:新增店铺公司失败");
|
||||
throw new ApiException(I18nUtil._("新增店铺公司失败"));
|
||||
}
|
||||
|
||||
// shop_store_employee 店铺员工,添加管理员
|
||||
ShopStoreEmployee shopStoreEmployee = new ShopStoreEmployee();
|
||||
shopStoreEmployee.setStore_id(storeId);
|
||||
shopStoreEmployee.setUser_id(userId);
|
||||
shopStoreEmployee.setRights_group_id("2,24"); // 店铺管理员,店铺
|
||||
shopStoreEmployee.setRights_group_id("2,3,4,5,6,7,8,20,21,22,23,24"); // 店铺管理员,店铺
|
||||
shopStoreEmployee.setEmployee_is_admin(CommonConstant.Enable);
|
||||
shopStoreEmployee.setEmployee_is_kefu(CommonConstant.Enable);
|
||||
shopStoreEmployeeService.save(shopStoreEmployee);
|
||||
@ -3152,7 +3152,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
throw new ApiException(I18nUtil._("新增店铺员工失败"));
|
||||
}
|
||||
|
||||
// 关联店铺到用户,给用户增加店铺管理员权限
|
||||
// 注意:关联店铺到用户,给用户增加店铺管理员权限
|
||||
initShopKeeperRightsGroup(userId, storeId);
|
||||
|
||||
return Pair.of(storeId, "新增成功");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user