mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-02-18 18:20:32 +08:00
fix(公众号账号管理): 增、删、改、查
This commit is contained in:
parent
372b4a70aa
commit
59624531b6
@ -25,10 +25,12 @@ import java.util.List;
|
|||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
|
|
||||||
// TODO @亚洲:/mp/account 即可
|
/**
|
||||||
|
* @author fengdan
|
||||||
|
*/
|
||||||
@Api(tags = "管理后台 - 公众号账户")
|
@Api(tags = "管理后台 - 公众号账户")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/wechatMp/wx-account")
|
@RequestMapping("/wechatMp/account")
|
||||||
@Validated
|
@Validated
|
||||||
public class WxAccountController {
|
public class WxAccountController {
|
||||||
|
|
||||||
@ -37,14 +39,14 @@ public class WxAccountController {
|
|||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@ApiOperation("创建公众号账户")
|
@ApiOperation("创建公众号账户")
|
||||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account:create')")
|
@PreAuthorize("@ss.hasPermission('wechatMp:account:create')")
|
||||||
public CommonResult<Long> createWxAccount(@Valid @RequestBody WxAccountCreateReqVO createReqVO) {
|
public CommonResult<Long> createWxAccount(@Valid @RequestBody WxAccountCreateReqVO createReqVO) {
|
||||||
return success(wxAccountService.createWxAccount(createReqVO));
|
return success(wxAccountService.createWxAccount(createReqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@ApiOperation("更新公众号账户")
|
@ApiOperation("更新公众号账户")
|
||||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account:update')")
|
@PreAuthorize("@ss.hasPermission('wechatMp:account:update')")
|
||||||
public CommonResult<Boolean> updateWxAccount(@Valid @RequestBody WxAccountUpdateReqVO updateReqVO) {
|
public CommonResult<Boolean> updateWxAccount(@Valid @RequestBody WxAccountUpdateReqVO updateReqVO) {
|
||||||
wxAccountService.updateWxAccount(updateReqVO);
|
wxAccountService.updateWxAccount(updateReqVO);
|
||||||
return success(true);
|
return success(true);
|
||||||
@ -53,7 +55,7 @@ public class WxAccountController {
|
|||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@ApiOperation("删除公众号账户")
|
@ApiOperation("删除公众号账户")
|
||||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account:delete')")
|
@PreAuthorize("@ss.hasPermission('wechatMp:account:delete')")
|
||||||
public CommonResult<Boolean> deleteWxAccount(@RequestParam("id") Long id) {
|
public CommonResult<Boolean> deleteWxAccount(@RequestParam("id") Long id) {
|
||||||
wxAccountService.deleteWxAccount(id);
|
wxAccountService.deleteWxAccount(id);
|
||||||
return success(true);
|
return success(true);
|
||||||
@ -62,7 +64,7 @@ public class WxAccountController {
|
|||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@ApiOperation("获得公众号账户")
|
@ApiOperation("获得公众号账户")
|
||||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account:query')")
|
@PreAuthorize("@ss.hasPermission('wechatMp:account:query')")
|
||||||
public CommonResult<WxAccountRespVO> getWxAccount(@RequestParam("id") Long id) {
|
public CommonResult<WxAccountRespVO> getWxAccount(@RequestParam("id") Long id) {
|
||||||
WxAccountDO wxAccount = wxAccountService.getWxAccount(id);
|
WxAccountDO wxAccount = wxAccountService.getWxAccount(id);
|
||||||
return success(WxAccountConvert.INSTANCE.convert(wxAccount));
|
return success(WxAccountConvert.INSTANCE.convert(wxAccount));
|
||||||
@ -71,7 +73,7 @@ public class WxAccountController {
|
|||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@ApiOperation("获得公众号账户列表")
|
@ApiOperation("获得公众号账户列表")
|
||||||
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account:query')")
|
@PreAuthorize("@ss.hasPermission('wechatMp:account:query')")
|
||||||
public CommonResult<List<WxAccountRespVO>> getWxAccountList(@RequestParam("ids") Collection<Long> ids) {
|
public CommonResult<List<WxAccountRespVO>> getWxAccountList(@RequestParam("ids") Collection<Long> ids) {
|
||||||
List<WxAccountDO> list = wxAccountService.getWxAccountList(ids);
|
List<WxAccountDO> list = wxAccountService.getWxAccountList(ids);
|
||||||
return success(WxAccountConvert.INSTANCE.convertList(list));
|
return success(WxAccountConvert.INSTANCE.convertList(list));
|
||||||
@ -79,7 +81,7 @@ public class WxAccountController {
|
|||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@ApiOperation("获得公众号账户分页")
|
@ApiOperation("获得公众号账户分页")
|
||||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account:query')")
|
@PreAuthorize("@ss.hasPermission('wechatMp:account:query')")
|
||||||
public CommonResult<PageResult<WxAccountRespVO>> getWxAccountPage(@Valid WxAccountPageReqVO pageVO) {
|
public CommonResult<PageResult<WxAccountRespVO>> getWxAccountPage(@Valid WxAccountPageReqVO pageVO) {
|
||||||
PageResult<WxAccountDO> pageResult = wxAccountService.getWxAccountPage(pageVO);
|
PageResult<WxAccountDO> pageResult = wxAccountService.getWxAccountPage(pageVO);
|
||||||
return success(WxAccountConvert.INSTANCE.convertPage(pageResult));
|
return success(WxAccountConvert.INSTANCE.convertPage(pageResult));
|
||||||
@ -87,7 +89,7 @@ public class WxAccountController {
|
|||||||
|
|
||||||
@GetMapping("/export-excel")
|
@GetMapping("/export-excel")
|
||||||
@ApiOperation("导出公众号账户 Excel")
|
@ApiOperation("导出公众号账户 Excel")
|
||||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account:export')")
|
@PreAuthorize("@ss.hasPermission('wechatMp:account:export')")
|
||||||
@OperateLog(type = EXPORT)
|
@OperateLog(type = EXPORT)
|
||||||
public void exportWxAccountExcel(@Valid WxAccountExportReqVO exportReqVO,
|
public void exportWxAccountExcel(@Valid WxAccountExportReqVO exportReqVO,
|
||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
|
@ -1,32 +1,40 @@
|
|||||||
package cn.iocoder.yudao.module.mp.controller.admin.account.vo;
|
package cn.iocoder.yudao.module.mp.controller.admin.account.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import io.swagger.annotations.*;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公众号账户 Base VO,提供给添加、修改、详细的子 VO 使用
|
* 公众号账户 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||||
*/
|
*
|
||||||
|
* @author fengdan
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class WxAccountBaseVO {
|
public class WxAccountBaseVO {
|
||||||
|
|
||||||
@ApiModelProperty(value = "公众号名称")
|
@ApiModelProperty(value = "公众号名称", required = true)
|
||||||
|
@NotNull(message = "公众号名称不能为空")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@ApiModelProperty(value = "公众号账户")
|
@ApiModelProperty(value = "公众号账户", required = true)
|
||||||
|
@NotNull(message = "公众号账户不能为空")
|
||||||
private String account;
|
private String account;
|
||||||
|
|
||||||
@ApiModelProperty(value = "公众号appid")
|
@ApiModelProperty(value = "公众号appid", required = true)
|
||||||
private String appid;
|
@NotNull(message = "公众号appid不能为空")
|
||||||
|
private String appId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "公众号密钥")
|
@ApiModelProperty(value = "公众号密钥", required = true)
|
||||||
private String appsecret;
|
@NotNull(message = "公众号密钥不能为空")
|
||||||
|
private String appSecret;
|
||||||
|
|
||||||
@ApiModelProperty(value = "公众号token")
|
@ApiModelProperty(value = "公众号token")
|
||||||
private String token;
|
private String token;
|
||||||
|
|
||||||
@ApiModelProperty(value = "加密密钥")
|
@ApiModelProperty(value = "加密密钥")
|
||||||
private String aeskey;
|
private String aesKey;
|
||||||
|
|
||||||
@ApiModelProperty(value = "备注")
|
@ApiModelProperty(value = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
package cn.iocoder.yudao.module.mp.controller.admin.account.vo;
|
package cn.iocoder.yudao.module.mp.controller.admin.account.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.*;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author fengdan
|
||||||
|
*/
|
||||||
@ApiModel("管理后台 - 公众号账户创建 Request VO")
|
@ApiModel("管理后台 - 公众号账户创建 Request VO")
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
package cn.iocoder.yudao.module.mp.controller.admin.account.vo;
|
package cn.iocoder.yudao.module.mp.controller.admin.account.vo;
|
||||||
|
|
||||||
import lombok.*;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公众号账户 Excel VO
|
* 公众号账户 Excel VO
|
||||||
@ -23,10 +24,7 @@ public class WxAccountExcelVO {
|
|||||||
private String account;
|
private String account;
|
||||||
|
|
||||||
@ExcelProperty("公众号appid")
|
@ExcelProperty("公众号appid")
|
||||||
private String appid;
|
private String appId;
|
||||||
|
|
||||||
@ExcelProperty("公众号密钥")
|
|
||||||
private String appsecret;
|
|
||||||
|
|
||||||
@ExcelProperty("公众号url")
|
@ExcelProperty("公众号url")
|
||||||
private String url;
|
private String url;
|
||||||
@ -35,7 +33,7 @@ public class WxAccountExcelVO {
|
|||||||
private String token;
|
private String token;
|
||||||
|
|
||||||
@ExcelProperty("加密密钥")
|
@ExcelProperty("加密密钥")
|
||||||
private String aeskey;
|
private String aesKey;
|
||||||
|
|
||||||
@ExcelProperty("二维码图片URL")
|
@ExcelProperty("二维码图片URL")
|
||||||
private String qrCodeUrl;
|
private String qrCodeUrl;
|
||||||
@ -45,5 +43,4 @@ public class WxAccountExcelVO {
|
|||||||
|
|
||||||
@ExcelProperty("创建时间")
|
@ExcelProperty("创建时间")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,9 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author fengdan
|
||||||
|
*/
|
||||||
@ApiModel(value = "管理后台 - 公众号账户 Excel 导出 Request VO", description = "参数和 WxAccountPageReqVO 是一致的")
|
@ApiModel(value = "管理后台 - 公众号账户 Excel 导出 Request VO", description = "参数和 WxAccountPageReqVO 是一致的")
|
||||||
@Data
|
@Data
|
||||||
public class WxAccountExportReqVO {
|
public class WxAccountExportReqVO {
|
||||||
@ -18,7 +21,7 @@ public class WxAccountExportReqVO {
|
|||||||
private String account;
|
private String account;
|
||||||
|
|
||||||
@ApiModelProperty(value = "公众号appid")
|
@ApiModelProperty(value = "公众号appid")
|
||||||
private String appid;
|
private String appId;
|
||||||
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
@ApiModelProperty(value = "开始创建时间")
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
@ -8,12 +8,14 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author fengdan
|
||||||
|
*/
|
||||||
@ApiModel("管理后台 - 公众号账户分页 Request VO")
|
@ApiModel("管理后台 - 公众号账户分页 Request VO")
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class WxAccountPageReqVO extends PageParam {
|
public class WxAccountPageReqVO extends PageParam {
|
||||||
|
|
||||||
@ApiModelProperty(value = "公众号名称")
|
@ApiModelProperty(value = "公众号名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@ -21,7 +23,7 @@ public class WxAccountPageReqVO extends PageParam {
|
|||||||
private String account;
|
private String account;
|
||||||
|
|
||||||
@ApiModelProperty(value = "公众号appid")
|
@ApiModelProperty(value = "公众号appid")
|
||||||
private String appid;
|
private String appId;
|
||||||
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
@ApiModelProperty(value = "开始创建时间")
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
@ -30,5 +32,4 @@ public class WxAccountPageReqVO extends PageParam {
|
|||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
@ApiModelProperty(value = "结束创建时间")
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
private Date endCreateTime;
|
private Date endCreateTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,16 @@
|
|||||||
package cn.iocoder.yudao.module.mp.controller.admin.account.vo;
|
package cn.iocoder.yudao.module.mp.controller.admin.account.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import io.swagger.annotations.ApiModel;
|
||||||
import java.util.*;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import io.swagger.annotations.*;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author fengdan
|
||||||
|
*/
|
||||||
@ApiModel("管理后台 - 公众号账户 Response VO")
|
@ApiModel("管理后台 - 公众号账户 Response VO")
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ -22,4 +29,6 @@ public class WxAccountRespVO extends WxAccountBaseVO {
|
|||||||
@ApiModelProperty(value = "创建时间", required = true)
|
@ApiModelProperty(value = "创建时间", required = true)
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "公众号密钥", required = true)
|
||||||
|
private String appSecret;
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,9 @@ import lombok.*;
|
|||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author fengdan
|
||||||
|
*/
|
||||||
@ApiModel("管理后台 - 公众号账户更新 Request VO")
|
@ApiModel("管理后台 - 公众号账户更新 Request VO")
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ -22,7 +22,7 @@ public interface WxAccountMapper extends BaseMapperX<WxAccountDO> {
|
|||||||
return selectPage(reqVO, new LambdaQueryWrapperX<WxAccountDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<WxAccountDO>()
|
||||||
.likeIfPresent(WxAccountDO::getName, reqVO.getName())
|
.likeIfPresent(WxAccountDO::getName, reqVO.getName())
|
||||||
.eqIfPresent(WxAccountDO::getAccount, reqVO.getAccount())
|
.eqIfPresent(WxAccountDO::getAccount, reqVO.getAccount())
|
||||||
.eqIfPresent(WxAccountDO::getAppId, reqVO.getAppid())
|
.eqIfPresent(WxAccountDO::getAppId, reqVO.getAppId())
|
||||||
.betweenIfPresent(WxAccountDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
.betweenIfPresent(WxAccountDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
||||||
.orderByDesc(WxAccountDO::getId));
|
.orderByDesc(WxAccountDO::getId));
|
||||||
}
|
}
|
||||||
@ -31,7 +31,7 @@ public interface WxAccountMapper extends BaseMapperX<WxAccountDO> {
|
|||||||
return selectList(new LambdaQueryWrapperX<WxAccountDO>()
|
return selectList(new LambdaQueryWrapperX<WxAccountDO>()
|
||||||
.likeIfPresent(WxAccountDO::getName, reqVO.getName())
|
.likeIfPresent(WxAccountDO::getName, reqVO.getName())
|
||||||
.eqIfPresent(WxAccountDO::getAccount, reqVO.getAccount())
|
.eqIfPresent(WxAccountDO::getAccount, reqVO.getAccount())
|
||||||
.eqIfPresent(WxAccountDO::getAppId, reqVO.getAppid())
|
.eqIfPresent(WxAccountDO::getAppId, reqVO.getAppId())
|
||||||
.betweenIfPresent(WxAccountDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
.betweenIfPresent(WxAccountDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
||||||
.orderByDesc(WxAccountDO::getId));
|
.orderByDesc(WxAccountDO::getId));
|
||||||
}
|
}
|
||||||
|
@ -1,52 +1,52 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
// 创建公众号账户
|
// 创建公众号账户
|
||||||
export function createWxAccount(data) {
|
export function createAccount(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/wechatMp/wx-account/create',
|
url: '/wechatMp/account/create',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新公众号账户
|
// 更新公众号账户
|
||||||
export function updateWxAccount(data) {
|
export function updateAccount(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/wechatMp/wx-account/update',
|
url: '/wechatMp/account/update',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除公众号账户
|
// 删除公众号账户
|
||||||
export function deleteWxAccount(id) {
|
export function deleteAccount(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/wechatMp/wx-account/delete?id=' + id,
|
url: '/wechatMp/account/delete?id=' + id,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获得公众号账户
|
// 获得公众号账户
|
||||||
export function getWxAccount(id) {
|
export function getAccount(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/wechatMp/wx-account/get?id=' + id,
|
url: '/wechatMp/account/get?id=' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获得公众号账户分页
|
// 获得公众号账户分页
|
||||||
export function getWxAccountPage(query) {
|
export function getAccountPage(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/wechatMp/wx-account/page',
|
url: '/wechatMp/account/page',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出公众号账户 Excel
|
// 导出公众号账户 Excel
|
||||||
export function exportWxAccountExcel(query) {
|
export function exportAccountExcel(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/wechatMp/wx-account/export-excel',
|
url: '/wechatMp/account/export-excel',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query,
|
params: query,
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
|
@ -3,18 +3,13 @@
|
|||||||
|
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="公众号名称" prop="name">
|
<el-form-item label="名称" prop="name">
|
||||||
<el-input v-model="queryParams.name" placeholder="请输入公众号名称" clearable @keyup.enter.native="handleQuery"/>
|
<el-input v-model="queryParams.name" placeholder="请输入公众号名称" clearable
|
||||||
</el-form-item>
|
@keyup.enter.native="handleQuery"/>
|
||||||
<el-form-item label="公众号账户" prop="account">
|
|
||||||
<el-input v-model="queryParams.account" placeholder="请输入公众号账户" clearable @keyup.enter.native="handleQuery"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="公众号appId" prop="appId">
|
|
||||||
<el-input v-model="queryParams.appId" placeholder="请输入公众号appId" clearable @keyup.enter.native="handleQuery"/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="创建时间">
|
<el-form-item label="创建时间">
|
||||||
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
|
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
|
||||||
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
|
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||||
@ -26,27 +21,29 @@
|
|||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||||
v-hasPermi="['wechatMp:wx-account:create']">新增</el-button>
|
v-hasPermi="['wechatMp:account:create']">新增
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||||
v-hasPermi="['wechatMp:wx-account:export']">导出</el-button>
|
:loading="exportLoading"
|
||||||
|
v-hasPermi="['wechatMp:account:export']">导出
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<el-table v-loading="loading" :data="list">
|
<el-table v-loading="loading" :data="list">
|
||||||
<el-table-column label="编号" align="center" prop="id" />
|
<el-table-column label="编号" align="center" prop="id"/>
|
||||||
<el-table-column label="公众号名称" align="center" prop="name" />
|
<el-table-column label="名称" align="center" prop="name"/>
|
||||||
<el-table-column label="公众号账户" align="center" prop="account" />
|
<el-table-column label="微信原始ID" align="center" prop="account"/>
|
||||||
<el-table-column label="公众号appId" align="center" prop="appId"/>
|
<el-table-column label="appId" align="center" prop="appId"/>
|
||||||
<el-table-column label="公众号密钥" align="center" prop="appSecret"/>
|
<el-table-column label="url" align="center" prop="url"/>
|
||||||
<el-table-column label="公众号url" align="center" prop="url" />
|
<el-table-column label="Token" align="center" prop="token"/>
|
||||||
<el-table-column label="公众号token" align="center" prop="token" />
|
|
||||||
<el-table-column label="加密密钥" align="center" prop="aesKey"/>
|
<el-table-column label="加密密钥" align="center" prop="aesKey"/>
|
||||||
<el-table-column label="二维码图片URL" align="center" prop="qrCodeUrl"/>
|
<el-table-column label="二维码" align="center" prop="qrCodeUrl"/>
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark"/>
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
@ -55,9 +52,11 @@
|
|||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['wechatMp:wx-account:update']">修改</el-button>
|
v-hasPermi="['wechatMp:account:update']">修改
|
||||||
|
</el-button>
|
||||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['wechatMp:wx-account:delete']">删除</el-button>
|
v-hasPermi="['wechatMp:account:delete']">删除
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -69,25 +68,41 @@
|
|||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="公众号名称" prop="name">
|
<el-form-item label="公众号名称" prop="name">
|
||||||
<el-input v-model="form.name" placeholder="请输入公众号名称" />
|
<el-input v-model="form.name" placeholder="请输入公众号名称"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="公众号账户" prop="account">
|
|
||||||
<el-input v-model="form.account" placeholder="请输入公众号账户" />
|
<el-tooltip class="item" effect="dark"
|
||||||
|
content="在微信公众平台(mp.weixin.qq.com)的菜单【设置】-【公众号设置】-【帐号详情】中能找到原始ID"
|
||||||
|
placement="right">
|
||||||
|
<el-form-item label="微信原始ID" prop="account">
|
||||||
|
<el-input v-model="form.account" placeholder="请输入微信原始ID" :disabled='disabled'/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="公众号appId" prop="appId">
|
</el-tooltip>
|
||||||
<el-input v-model="form.appId" placeholder="请输入公众号appId"/>
|
|
||||||
|
<el-tooltip class="item" effect="dark"
|
||||||
|
content="在微信公众平台(mp.weixin.qq.com)的菜单【开发】-【基本配置】中能找到AppID "
|
||||||
|
placement="right">
|
||||||
|
<el-form-item label="AppID" prop="appId">
|
||||||
|
<el-input v-model="form.appId" placeholder="请输入公众号appId" :disabled='disabled'/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="公众号密钥" prop="appSecret">
|
</el-tooltip>
|
||||||
<el-input v-model="form.appSecret" placeholder="请输入公众号密钥"/>
|
|
||||||
|
<el-tooltip class="item" effect="dark"
|
||||||
|
content="在微信公众平台(mp.weixin.qq.com)的菜单【开发】-【基本配置】中能找到AppSecret"
|
||||||
|
placement="right">
|
||||||
|
<el-form-item label="AppSecret" prop="appSecret">
|
||||||
|
<el-input v-model="form.appSecret" placeholder="请输入公众号密钥" :disabled='disabled'/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="公众号token" prop="token">
|
</el-tooltip>
|
||||||
<el-input v-model="form.token" placeholder="请输入公众号token" />
|
|
||||||
|
<el-form-item label="token" prop="token">
|
||||||
|
<el-input v-model="form.token" placeholder="请输入公众号token"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="加密密钥" prop="aesKey">
|
<el-form-item label="加密密钥" prop="aesKey">
|
||||||
<el-input v-model="form.aesKey" placeholder="请输入加密密钥"/>
|
<el-input v-model="form.aesKey" placeholder="请输入加密密钥"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
<el-input v-model="form.remark" placeholder="请输入备注"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@ -99,12 +114,18 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { createWxAccount, updateWxAccount, deleteWxAccount, getWxAccount, getWxAccountPage, exportWxAccountExcel } from "@/api/wechatMp/wxAccount";
|
import {
|
||||||
|
createAccount,
|
||||||
|
deleteAccount,
|
||||||
|
exportAccountExcel,
|
||||||
|
getAccount,
|
||||||
|
getAccountPage,
|
||||||
|
updateAccount
|
||||||
|
} from '@/api/wechatMp/wxAccount'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "WxAccount",
|
name: 'wxAccount',
|
||||||
components: {
|
components: {},
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
@ -118,7 +139,7 @@ export default {
|
|||||||
// 公众号账户列表
|
// 公众号账户列表
|
||||||
list: [],
|
list: [],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
title: '',
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
dateRangeCreateTime: [],
|
dateRangeCreateTime: [],
|
||||||
@ -134,30 +155,37 @@ export default {
|
|||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
|
name: [{required: true, message: '公众号名称不能为空', trigger: 'blur'}],
|
||||||
|
account: [{required: true, message: '公众号账户不能为空', trigger: 'blur'}],
|
||||||
|
appId: [{required: true, message: '公众号appid不能为空', trigger: 'blur'}],
|
||||||
|
appSecret: [{required: true, message: '公众号密钥不能为空', trigger: 'blur'}],
|
||||||
|
},
|
||||||
|
// 禁用属性
|
||||||
|
disabled: false,
|
||||||
}
|
}
|
||||||
};
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true
|
||||||
// 处理查询参数
|
// 处理查询参数
|
||||||
let params = {...this.queryParams};
|
let params = {...this.queryParams}
|
||||||
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
|
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime')
|
||||||
// 执行查询
|
// 执行查询
|
||||||
getWxAccountPage(params).then(response => {
|
getAccountPage(params).then(response => {
|
||||||
this.list = response.data.list;
|
this.list = response.data.list
|
||||||
this.total = response.data.total;
|
this.total = response.data.total
|
||||||
this.loading = false;
|
this.loading = false
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
/** 取消按钮 */
|
/** 取消按钮 */
|
||||||
cancel() {
|
cancel() {
|
||||||
this.open = false;
|
this.open = false
|
||||||
this.reset();
|
this.disabled = false
|
||||||
|
this.reset()
|
||||||
},
|
},
|
||||||
/** 表单重置 */
|
/** 表单重置 */
|
||||||
reset() {
|
reset() {
|
||||||
@ -170,85 +198,88 @@ export default {
|
|||||||
token: undefined,
|
token: undefined,
|
||||||
aesKey: undefined,
|
aesKey: undefined,
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
};
|
}
|
||||||
this.resetForm("form");
|
this.resetForm('form')
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParams.pageNo = 1;
|
this.queryParams.pageNo = 1
|
||||||
this.getList();
|
this.getList()
|
||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.dateRangeCreateTime = [];
|
this.dateRangeCreateTime = []
|
||||||
this.resetForm("queryForm");
|
this.resetForm('queryForm')
|
||||||
this.handleQuery();
|
this.handleQuery()
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset()
|
||||||
this.open = true;
|
this.open = true
|
||||||
this.title = "添加公众号账户";
|
this.title = '添加公众号账户'
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset()
|
||||||
const id = row.id;
|
const id = row.id
|
||||||
getWxAccount(id).then(response => {
|
getAccount(id).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data
|
||||||
this.open = true;
|
this.open = true
|
||||||
this.title = "修改公众号账户";
|
this.title = '修改公众号账户'
|
||||||
});
|
this.disabled = true
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs['form'].validate(valid => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
// 修改的提交
|
// 修改的提交
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateWxAccount(this.form).then(response => {
|
updateAccount(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess('修改成功')
|
||||||
this.open = false;
|
this.open = false
|
||||||
this.getList();
|
this.getList()
|
||||||
});
|
})
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
// 添加的提交
|
// 添加的提交
|
||||||
createWxAccount(this.form).then(response => {
|
createAccount(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess('新增成功')
|
||||||
this.open = false;
|
this.open = false
|
||||||
this.getList();
|
this.getList()
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const id = row.id;
|
const id = row.id
|
||||||
this.$modal.confirm('是否确认删除公众号账户编号为"' + id + '"的数据项?').then(function() {
|
this.$modal.confirm('是否确认删除公众号账户编号为"' + id + '"的数据项?').then(function () {
|
||||||
return deleteWxAccount(id);
|
return deleteAccount(id)
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.getList();
|
this.getList()
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess('删除成功')
|
||||||
}).catch(() => {});
|
}).catch(() => {
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
// 处理查询参数
|
// 处理查询参数
|
||||||
let params = {...this.queryParams};
|
let params = {...this.queryParams}
|
||||||
params.pageNo = undefined;
|
params.pageNo = undefined
|
||||||
params.pageSize = undefined;
|
params.pageSize = undefined
|
||||||
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
|
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime')
|
||||||
// 执行导出
|
// 执行导出
|
||||||
this.$modal.confirm('是否确认导出所有公众号账户数据项?').then(() => {
|
this.$modal.confirm('是否确认导出所有公众号账户数据项?').then(() => {
|
||||||
this.exportLoading = true;
|
this.exportLoading = true
|
||||||
return exportWxAccountExcel(params);
|
return exportAccountExcel(params)
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
this.$download.excel(response, '公众号账户.xls');
|
this.$download.excel(response, '公众号账户.xls')
|
||||||
this.exportLoading = false;
|
this.exportLoading = false
|
||||||
}).catch(() => {});
|
}).catch(() => {
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user