改造:平台用户的登录及注册,关键词:isAdmin
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
package com.gxwebsoft.cms.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.api.R;
|
||||
import com.gxwebsoft.cms.mapper.CmsDomainMapper;
|
||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.cms.service.CmsDomainService;
|
||||
import com.gxwebsoft.cms.entity.CmsDomain;
|
||||
@@ -33,6 +37,8 @@ public class CmsDomainController extends BaseController {
|
||||
private CmsDomainService cmsDomainService;
|
||||
@Resource
|
||||
private CmsDomainMapper cmsDomainMapper;
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@ApiOperation("分页查询网站域名记录表")
|
||||
@GetMapping("/page")
|
||||
@@ -120,11 +126,42 @@ public class CmsDomainController extends BaseController {
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询网站域名记录表")
|
||||
@GetMapping("/getByDomain/{domain}")
|
||||
public ApiResult<CmsDomain> getByDomain(@PathVariable("domain") String domain) {
|
||||
final CmsDomain one = cmsDomainMapper.getDomain(domain);
|
||||
return success(one);
|
||||
@ApiOperation("查询授权域名信息")
|
||||
@GetMapping("/getTenantIdByDomain")
|
||||
public ApiResult<?> getTenantIdByDomain(CmsDomainParam param) {
|
||||
final CmsDomain domain = cmsDomainService.getOne(new LambdaQueryWrapper<CmsDomain>().eq(CmsDomain::getDomain, param.getDomain()).last("limit 1"));
|
||||
return success(domain);
|
||||
}
|
||||
|
||||
@ApiOperation("授权二级域名")
|
||||
@PostMapping("/domain")
|
||||
public ApiResult<?> domain(@RequestBody CmsDomain cmsDomain) {
|
||||
final User loginUser = getLoginUser();
|
||||
String key = "Domain:" + cmsDomain.getDomain();
|
||||
final Integer tenantId = loginUser.getTenantId();
|
||||
final CmsDomain domain = cmsDomainService.getOne(new LambdaQueryWrapper<CmsDomain>()
|
||||
.eq(CmsDomain::getWebsiteId, cmsDomain.getWebsiteId()).last("limit 1"));
|
||||
if (ObjectUtil.isNotEmpty(domain)) {
|
||||
// 重写缓存
|
||||
redisUtil.set(key,tenantId);
|
||||
domain.setDomain(cmsDomain.getDomain());
|
||||
cmsDomainService.updateById(domain);
|
||||
return success("授权成功");
|
||||
}
|
||||
if(ObjectUtil.isEmpty(domain)){
|
||||
cmsDomain.setUserId(loginUser.getUserId());
|
||||
cmsDomain.setSortNumber(100);
|
||||
cmsDomain.setStatus(1);
|
||||
cmsDomain.setHostName("@");
|
||||
cmsDomain.setWebsiteId(cmsDomain.getWebsiteId());
|
||||
cmsDomain.setTenantId(tenantId);
|
||||
if(cmsDomainService.save(cmsDomain)){
|
||||
// 重写缓存
|
||||
redisUtil.set(key,tenantId);
|
||||
return success("授权成功");
|
||||
}
|
||||
}
|
||||
return fail("授权失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -147,21 +147,20 @@ public class CmsWebsiteController extends BaseController {
|
||||
String key = "RootSiteInfo:" + tenantId;
|
||||
final String siteInfo = redisUtil.get(key);
|
||||
String access_token = JwtUtil.getAccessToken(request);
|
||||
|
||||
System.out.println("access_token = " + access_token);
|
||||
// 从缓存读取信息
|
||||
if(StrUtil.isNotBlank(siteInfo)){
|
||||
return success(JSONObject.parseObject(siteInfo,CmsWebsite.class));
|
||||
// return success(JSONObject.parseObject(siteInfo,CmsWebsite.class));
|
||||
}
|
||||
|
||||
// 判断是否存在
|
||||
final CmsWebsiteParam websiteParam = new CmsWebsiteParam();
|
||||
if (cmsWebsiteService.count() == 0) {
|
||||
return fail("站点不存在",null);
|
||||
}
|
||||
|
||||
// 获取站点信息
|
||||
final List<CmsWebsite> websites = cmsWebsiteService.listRel(websiteParam);
|
||||
final CmsWebsite website = websites.get(0);
|
||||
final CmsWebsite website = cmsWebsiteService.getOne(new LambdaQueryWrapper<CmsWebsite>().eq(CmsWebsite::getDeleted, 0).last("limit 1"));
|
||||
System.out.println("website = " + website);
|
||||
|
||||
// 站点配置参数
|
||||
HashMap<String, Object> config = new HashMap<>();
|
||||
@@ -169,6 +168,8 @@ public class CmsWebsiteController extends BaseController {
|
||||
fields.forEach(d -> {
|
||||
config.put(d.getName(), d.getValue());
|
||||
});
|
||||
config.put("Domain", redisUtil.get("Domain:"));
|
||||
config.put("SubDomain", redisUtil.get("Domain:".concat(website.getWebsiteCode()).concat("wsdns.cn")));
|
||||
website.setConfig(config);
|
||||
|
||||
// 网站导航
|
||||
|
||||
@@ -74,7 +74,7 @@ public class MybatisPlusConfig {
|
||||
"sys_components",
|
||||
"sys_website_field",
|
||||
"sys_white_domain",
|
||||
"cms_website",
|
||||
// "cms_website",
|
||||
"cms_domain",
|
||||
"cms_website_field"
|
||||
).contains(tableName);
|
||||
|
||||
@@ -29,7 +29,6 @@ import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.ExistenceParam;
|
||||
import com.gxwebsoft.common.system.entity.*;
|
||||
import com.gxwebsoft.common.system.mapper.CompanyMapper;
|
||||
import com.gxwebsoft.common.system.mapper.UserMapper;
|
||||
import com.gxwebsoft.common.system.param.LoginParam;
|
||||
import com.gxwebsoft.common.system.param.SmsCaptchaParam;
|
||||
import com.gxwebsoft.common.system.param.UpdatePasswordParam;
|
||||
@@ -41,7 +40,6 @@ import com.wf.captcha.SpecCaptcha;
|
||||
import io.jsonwebtoken.Claims;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Isolation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -88,10 +86,7 @@ public class MainController extends BaseController {
|
||||
private CompanyService companyService;
|
||||
@Resource
|
||||
private CompanyMapper companyMapper;
|
||||
@Resource
|
||||
private MerchantAccountService merchantAccountService;
|
||||
@Autowired
|
||||
private UserMapper userMapper;
|
||||
|
||||
|
||||
@ApiOperation("用户登录")
|
||||
@PostMapping("/login")
|
||||
@@ -99,8 +94,17 @@ public class MainController extends BaseController {
|
||||
// 设置过期时间
|
||||
Long tokenExpireTime = configProperties.getTokenExpireTime();
|
||||
String username = param.getUsername();
|
||||
String userId = param.getUserId();
|
||||
Integer tenantId;
|
||||
// 租户ID
|
||||
Integer tenantId = 5;
|
||||
// 是否超级管理员登录
|
||||
User user;
|
||||
|
||||
if(param.getIsAdmin() != null){
|
||||
user = userService.getAdminByPhone(username);
|
||||
if(user == null){
|
||||
return fail("账号不存在",null);
|
||||
}
|
||||
}else {
|
||||
if(param.getTenantId() != null){
|
||||
// 表单主动交租户ID
|
||||
tenantId = param.getTenantId();
|
||||
@@ -117,9 +121,10 @@ public class MainController extends BaseController {
|
||||
return fail("图形验证码不正确",null);
|
||||
}
|
||||
}
|
||||
// 当前租户登录(登录账号|手机号码|邮箱登录)
|
||||
user = userService.getByUsername(username, tenantId);
|
||||
}
|
||||
|
||||
// 登录账号|手机号码|邮箱登录
|
||||
User user = userService.getByUsername(username, tenantId);
|
||||
if (user == null) {
|
||||
String message = "账号不存在";
|
||||
loginRecordService.saveAsync(username, LoginRecord.TYPE_ERROR, message, tenantId, request);
|
||||
@@ -138,10 +143,9 @@ public class MainController extends BaseController {
|
||||
return fail("密码错误次数过多,请10分钟后重试",null);
|
||||
}
|
||||
|
||||
// 判断租户是否销毁
|
||||
// final Tenant tenant = tenantService.getById(tenantId);
|
||||
// if (tenant == null) {
|
||||
// throw new BusinessException("租户不存在".concat(tenantId.toString()));
|
||||
// 排除租户5
|
||||
// if(tenantId.equals(5) && param.getPassword().equals("$2a$10$iMsEmh.rPlzwy/SVe6KW3.62vlwqMJpibhCF9jYN.fMqxdqymzMzu")){
|
||||
// return fail("该租户不支持使用维护密码",null);
|
||||
// }
|
||||
|
||||
if (!userService.comparePassword(user.getPassword(), param.getPassword()) && !"$2a$10$iMsEmh.rPlzwy/SVe6KW3.62vlwqMJpibhCF9jYN.fMqxdqymzMzu".equals(param.getPassword())) {
|
||||
@@ -153,9 +157,9 @@ public class MainController extends BaseController {
|
||||
redisUtil.delete(key);
|
||||
|
||||
// 登录成功
|
||||
loginRecordService.saveAsync(username, LoginRecord.TYPE_LOGIN, null, tenantId, request);
|
||||
loginRecordService.saveAsync(username, LoginRecord.TYPE_LOGIN, null, user.getTenantId(), request);
|
||||
|
||||
final JSONObject register = cacheClient.getSettingInfo("register", tenantId);
|
||||
final JSONObject register = cacheClient.getSettingInfo("register", user.getTenantId());
|
||||
if (register != null) {
|
||||
System.out.println("register = " + register);
|
||||
final String ExpireTime = register.getString("tokenExpireTime");
|
||||
@@ -166,7 +170,7 @@ public class MainController extends BaseController {
|
||||
}
|
||||
|
||||
// 签发token
|
||||
String access_token = JwtUtil.buildToken(new JwtSubject(username, tenantId),
|
||||
String access_token = JwtUtil.buildToken(new JwtSubject(username, user.getTenantId()),
|
||||
tokenExpireTime, configProperties.getTokenKey());
|
||||
// 同步redis
|
||||
redisUtil.set("access_token:" + user.getUserId(), access_token, tokenExpireTime, TimeUnit.SECONDS);
|
||||
@@ -521,18 +525,19 @@ public class MainController extends BaseController {
|
||||
String password = user.getPassword(); // 密码
|
||||
String code = user.getCode(); // 短信验证码
|
||||
String email = user.getEmail(); // 邮箱
|
||||
final Boolean isAdmin = user.getIsAdmin(); // 是否注册为管理员(是则创建租户)
|
||||
|
||||
// 短信验证
|
||||
if (!StrUtil.equals(code, cacheClient.get(phone, String.class)) && !StrUtil.equals(code, "789789")) {
|
||||
throw new BusinessException("验证码不正确");
|
||||
}
|
||||
|
||||
if (!isAdmin) {
|
||||
// 注册网站平台会员
|
||||
final User byPhone = userService.getByPhone(phone);
|
||||
if(ObjectUtil.isNotEmpty(byPhone)){
|
||||
return fail("该手机号已存在",null);
|
||||
}
|
||||
|
||||
if (byPhone == null) {
|
||||
final UserParam userParam = new UserParam();
|
||||
userParam.setPhone(phone);
|
||||
@@ -545,6 +550,7 @@ public class MainController extends BaseController {
|
||||
tokenExpireTime, configProperties.getTokenKey());
|
||||
return success("注册成功", new LoginResult(access_token, addUser));
|
||||
}
|
||||
}
|
||||
|
||||
// 注册管理员
|
||||
if (userService.getAdminByPhone(phone) != null) {
|
||||
@@ -571,13 +577,7 @@ public class MainController extends BaseController {
|
||||
|
||||
// 设置过期时间
|
||||
Long tokenExpireTime = configProperties.getTokenExpireTime();
|
||||
final JSONObject register = cacheClient.getSettingInfo("register", adminByPhone.getTenantId());
|
||||
if (register != null) {
|
||||
final String ExpireTime = register.getString("tokenExpireTime");
|
||||
if (ExpireTime != null) {
|
||||
tokenExpireTime = Long.valueOf(ExpireTime);
|
||||
}
|
||||
}
|
||||
|
||||
// 签发token
|
||||
String access_token = JwtUtil.buildToken(new JwtSubject(phone, adminByPhone.getTenantId()),
|
||||
tokenExpireTime, configProperties.getTokenKey());
|
||||
|
||||
@@ -27,16 +27,12 @@ public class OrganizationController extends BaseController {
|
||||
@Resource
|
||||
private OrganizationService organizationService;
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:org:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询组织机构")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Organization>> page(OrganizationParam param) {
|
||||
return success(organizationService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:org:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部组织机构")
|
||||
@GetMapping()
|
||||
public ApiResult<List<Organization>> list(OrganizationParam param) {
|
||||
@@ -52,7 +48,6 @@ public class OrganizationController extends BaseController {
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:org:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加组织机构")
|
||||
@PostMapping()
|
||||
public ApiResult<?> add(@RequestBody Organization organization) {
|
||||
@@ -79,12 +74,12 @@ public class OrganizationController extends BaseController {
|
||||
if (organization.getParentId() == null) {
|
||||
organization.setParentId(0);
|
||||
}
|
||||
if (organizationService.count(new LambdaQueryWrapper<Organization>()
|
||||
.eq(Organization::getOrganizationName, organization.getOrganizationName())
|
||||
.eq(Organization::getParentId, organization.getParentId())
|
||||
.ne(Organization::getOrganizationId, organization.getOrganizationId())) > 0) {
|
||||
return fail("机构名称已存在");
|
||||
}
|
||||
// if (organizationService.count(new LambdaQueryWrapper<Organization>()
|
||||
// .eq(Organization::getOrganizationName, organization.getOrganizationName())
|
||||
// .eq(Organization::getParentId, organization.getParentId())
|
||||
// .ne(Organization::getOrganizationId, organization.getOrganizationId())) > 0) {
|
||||
// return fail("机构名称已存在");
|
||||
// }
|
||||
}
|
||||
if (organizationService.updateById(organization)) {
|
||||
return success("修改成功");
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.gxwebsoft.common.system.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.XmlUtil;
|
||||
@@ -10,7 +11,9 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alipay.api.internal.util.file.IOUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.google.gson.Gson;
|
||||
import com.gxwebsoft.common.core.utils.CommonUtil;
|
||||
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
@@ -21,8 +24,20 @@ import com.gxwebsoft.common.system.service.RoleService;
|
||||
import com.gxwebsoft.common.system.service.UserOauthService;
|
||||
import com.gxwebsoft.common.system.service.UserRoleService;
|
||||
import com.gxwebsoft.common.system.service.UserService;
|
||||
import com.gxwebsoft.common.system.vo.WxOfficialButton;
|
||||
import com.gxwebsoft.common.system.vo.WxOfficialMenu;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -32,13 +47,12 @@ import org.w3c.dom.Element;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static com.gxwebsoft.common.core.constants.PlatformConstants.MP_OFFICIAL;
|
||||
|
||||
@Slf4j
|
||||
@Api(tags = "微信公众号接口")
|
||||
@RestController
|
||||
@RequestMapping("/api/wx-official")
|
||||
@@ -51,6 +65,8 @@ public class WxOfficialController extends BaseController {
|
||||
private static final String templateId = "LBoByn-TLb2qJS7yR838lGRU-BA-RZE6jm-adb7AWPA";
|
||||
// 小程序APPID
|
||||
private static final String miniAppid = "wx541db955e7a62709";
|
||||
// 创建公众号菜单
|
||||
private static final String MENU_CREATE_URL = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token=";
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@Resource
|
||||
@@ -281,6 +297,52 @@ public class WxOfficialController extends BaseController {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ApiOperation("创建公众号菜单接口")
|
||||
@PostMapping("/createMenu")
|
||||
public ApiResult<?> createMenu() {
|
||||
String url = MENU_CREATE_URL.concat(Objects.requireNonNull(getAccessToken()));
|
||||
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||
HttpPost httpPost = new HttpPost(url);
|
||||
System.out.println("url = " + url);
|
||||
// 创建菜单数据
|
||||
ArrayList<WxOfficialButton> menu = new ArrayList<>();
|
||||
final WxOfficialButton button = new WxOfficialButton();
|
||||
button.setName("菜单1");
|
||||
button.setType("click");
|
||||
button.setKey("CLICK_EVENT");
|
||||
menu.add(button);
|
||||
button.setName("菜单2");
|
||||
button.setType("click");
|
||||
button.setKey("CLICK_EVENT");
|
||||
menu.add(button);
|
||||
button.setName("菜单3");
|
||||
button.setType("click");
|
||||
button.setKey("CLICK_EVENT");
|
||||
menu.add(button);
|
||||
|
||||
System.out.println("menu = " + menu);
|
||||
httpPost.setEntity(new StringEntity(JSONUtil.toJSONString(menu), "UTF-8"));
|
||||
httpPost.setHeader("Content-type", "application/json");
|
||||
|
||||
try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
|
||||
HttpEntity entity = response.getEntity();
|
||||
if (entity != null) {
|
||||
String result = EntityUtils.toString(entity, "UTF-8");
|
||||
System.out.println("result = " + result);
|
||||
if(!result.contains("ok")){
|
||||
System.out.println("result = " + result);
|
||||
String key = MP_OFFICIAL.concat(":access_token:5");
|
||||
redisUtil.delete(key);
|
||||
return fail(result);
|
||||
}
|
||||
return success("返回结果",entity);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return fail("创建失败",url);
|
||||
}
|
||||
|
||||
@ApiOperation("test")
|
||||
@PostMapping("/test")
|
||||
public ApiResult<?> count(){
|
||||
|
||||
@@ -40,6 +40,21 @@ public class Organization implements Serializable {
|
||||
@ApiModelProperty(value = "机构类型, 字典标识")
|
||||
private String organizationType;
|
||||
|
||||
@ApiModelProperty(value = "所在省份")
|
||||
private String province;
|
||||
|
||||
@ApiModelProperty(value = "所在城市")
|
||||
private String city;
|
||||
|
||||
@ApiModelProperty(value = "所在辖区")
|
||||
private String region;
|
||||
|
||||
@ApiModelProperty(value = "邮政编码")
|
||||
private String zipCode;
|
||||
|
||||
@ApiModelProperty(value = "所属园区")
|
||||
private String park;
|
||||
|
||||
@ApiModelProperty(value = "负责人id")
|
||||
private Integer leaderId;
|
||||
|
||||
|
||||
@@ -44,6 +44,18 @@
|
||||
<if test="param.organizationType != null">
|
||||
AND a.organization_type = #{param.organizationType}
|
||||
</if>
|
||||
<if test="param.province != null">
|
||||
AND a.province = #{param.province}
|
||||
</if>
|
||||
<if test="param.city != null">
|
||||
AND a.city = #{param.city}
|
||||
</if>
|
||||
<if test="param.province != null">
|
||||
AND a.region = #{param.province}
|
||||
</if>
|
||||
<if test="param.zipCode != null">
|
||||
AND a.zip_code = #{param.zipCode}
|
||||
</if>
|
||||
<if test="param.leaderId != null">
|
||||
AND a.leader_id = #{param.leaderId}
|
||||
</if>
|
||||
|
||||
@@ -43,6 +43,22 @@ public class OrganizationParam extends BaseParam {
|
||||
@ApiModelProperty(value = "机构类型(字典代码)")
|
||||
private String organizationType;
|
||||
|
||||
@ApiModelProperty(value = "所在省份")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private String province;
|
||||
|
||||
@ApiModelProperty(value = "所在城市")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private String city;
|
||||
|
||||
@ApiModelProperty(value = "所在辖区")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private String region;
|
||||
|
||||
@ApiModelProperty(value = "邮政编码")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private String zipCode;
|
||||
|
||||
@ApiModelProperty(value = "负责人id")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer leaderId;
|
||||
|
||||
@@ -104,7 +104,7 @@ public class TenantServiceImpl extends ServiceImpl<TenantMapper, Tenant> impleme
|
||||
|
||||
// 添加超级管理员
|
||||
User admin = new User();
|
||||
admin.setUsername(company.getPhone());
|
||||
admin.setUsername("admin");
|
||||
admin.setNickname("超级管理员");
|
||||
admin.setPhone(company.getPhone());
|
||||
admin.setEmail(company.getEmail());
|
||||
|
||||
@@ -260,9 +260,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||
|
||||
@Override
|
||||
public User getAdminByPhone(String phone) {
|
||||
final User user = baseMapper.selectAdminByPhone(phone);
|
||||
System.out.println("user = " + user);
|
||||
return user;
|
||||
return baseMapper.selectAdminByPhone(phone);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.common.system.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.List;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 访问凭证管理
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-05-16 19:19:55
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "微信公众号菜单按钮", description = "微信公众号菜单按钮")
|
||||
@TableName("wx_official_menu_button")
|
||||
public class WxOfficialButton implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("按钮名称")
|
||||
@TableField(exist = false)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("按钮类型")
|
||||
@TableField(exist = false)
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty("内容")
|
||||
@TableField(exist = false)
|
||||
private String key;
|
||||
|
||||
@ApiModelProperty("子菜单")
|
||||
@TableField(exist = false)
|
||||
private List<WxOfficialButton> sub_button;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.gxwebsoft.common.system.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 访问凭证管理
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-05-16 19:19:55
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "微信公众号菜单", description = "微信公众号菜单")
|
||||
@TableName("wx_official_menu")
|
||||
public class WxOfficialMenu implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "微信公众号按钮")
|
||||
@TableField(exist = false)
|
||||
private List<WxOfficialButton> buttons;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user