Commit 59624531b617e2df0549c0017d1bbe00e32b8786
1 parent
372b4a70
fix(公众号账号管理): 增、删、改、查
Showing
11 changed files
with
215 additions
and
156 deletions
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/WxAccountController.java
| @@ -25,10 +25,12 @@ import java.util.List; | @@ -25,10 +25,12 @@ import java.util.List; | ||
| 25 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 25 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 26 | import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; | 26 | import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; |
| 27 | 27 | ||
| 28 | -// TODO @亚洲:/mp/account 即可 | 28 | +/** |
| 29 | + * @author fengdan | ||
| 30 | + */ | ||
| 29 | @Api(tags = "管理后台 - 公众号账户") | 31 | @Api(tags = "管理后台 - 公众号账户") |
| 30 | @RestController | 32 | @RestController |
| 31 | -@RequestMapping("/wechatMp/wx-account") | 33 | +@RequestMapping("/wechatMp/account") |
| 32 | @Validated | 34 | @Validated |
| 33 | public class WxAccountController { | 35 | public class WxAccountController { |
| 34 | 36 | ||
| @@ -37,14 +39,14 @@ public class WxAccountController { | @@ -37,14 +39,14 @@ public class WxAccountController { | ||
| 37 | 39 | ||
| 38 | @PostMapping("/create") | 40 | @PostMapping("/create") |
| 39 | @ApiOperation("创建公众号账户") | 41 | @ApiOperation("创建公众号账户") |
| 40 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-account:create')") | 42 | + @PreAuthorize("@ss.hasPermission('wechatMp:account:create')") |
| 41 | public CommonResult<Long> createWxAccount(@Valid @RequestBody WxAccountCreateReqVO createReqVO) { | 43 | public CommonResult<Long> createWxAccount(@Valid @RequestBody WxAccountCreateReqVO createReqVO) { |
| 42 | return success(wxAccountService.createWxAccount(createReqVO)); | 44 | return success(wxAccountService.createWxAccount(createReqVO)); |
| 43 | } | 45 | } |
| 44 | 46 | ||
| 45 | @PutMapping("/update") | 47 | @PutMapping("/update") |
| 46 | @ApiOperation("更新公众号账户") | 48 | @ApiOperation("更新公众号账户") |
| 47 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-account:update')") | 49 | + @PreAuthorize("@ss.hasPermission('wechatMp:account:update')") |
| 48 | public CommonResult<Boolean> updateWxAccount(@Valid @RequestBody WxAccountUpdateReqVO updateReqVO) { | 50 | public CommonResult<Boolean> updateWxAccount(@Valid @RequestBody WxAccountUpdateReqVO updateReqVO) { |
| 49 | wxAccountService.updateWxAccount(updateReqVO); | 51 | wxAccountService.updateWxAccount(updateReqVO); |
| 50 | return success(true); | 52 | return success(true); |
| @@ -53,7 +55,7 @@ public class WxAccountController { | @@ -53,7 +55,7 @@ public class WxAccountController { | ||
| 53 | @DeleteMapping("/delete") | 55 | @DeleteMapping("/delete") |
| 54 | @ApiOperation("删除公众号账户") | 56 | @ApiOperation("删除公众号账户") |
| 55 | @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) | 57 | @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) |
| 56 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-account:delete')") | 58 | + @PreAuthorize("@ss.hasPermission('wechatMp:account:delete')") |
| 57 | public CommonResult<Boolean> deleteWxAccount(@RequestParam("id") Long id) { | 59 | public CommonResult<Boolean> deleteWxAccount(@RequestParam("id") Long id) { |
| 58 | wxAccountService.deleteWxAccount(id); | 60 | wxAccountService.deleteWxAccount(id); |
| 59 | return success(true); | 61 | return success(true); |
| @@ -62,7 +64,7 @@ public class WxAccountController { | @@ -62,7 +64,7 @@ public class WxAccountController { | ||
| 62 | @GetMapping("/get") | 64 | @GetMapping("/get") |
| 63 | @ApiOperation("获得公众号账户") | 65 | @ApiOperation("获得公众号账户") |
| 64 | @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | 66 | @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) |
| 65 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-account:query')") | 67 | + @PreAuthorize("@ss.hasPermission('wechatMp:account:query')") |
| 66 | public CommonResult<WxAccountRespVO> getWxAccount(@RequestParam("id") Long id) { | 68 | public CommonResult<WxAccountRespVO> getWxAccount(@RequestParam("id") Long id) { |
| 67 | WxAccountDO wxAccount = wxAccountService.getWxAccount(id); | 69 | WxAccountDO wxAccount = wxAccountService.getWxAccount(id); |
| 68 | return success(WxAccountConvert.INSTANCE.convert(wxAccount)); | 70 | return success(WxAccountConvert.INSTANCE.convert(wxAccount)); |
| @@ -71,7 +73,7 @@ public class WxAccountController { | @@ -71,7 +73,7 @@ public class WxAccountController { | ||
| 71 | @GetMapping("/list") | 73 | @GetMapping("/list") |
| 72 | @ApiOperation("获得公众号账户列表") | 74 | @ApiOperation("获得公众号账户列表") |
| 73 | @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) | 75 | @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) |
| 74 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-account:query')") | 76 | + @PreAuthorize("@ss.hasPermission('wechatMp:account:query')") |
| 75 | public CommonResult<List<WxAccountRespVO>> getWxAccountList(@RequestParam("ids") Collection<Long> ids) { | 77 | public CommonResult<List<WxAccountRespVO>> getWxAccountList(@RequestParam("ids") Collection<Long> ids) { |
| 76 | List<WxAccountDO> list = wxAccountService.getWxAccountList(ids); | 78 | List<WxAccountDO> list = wxAccountService.getWxAccountList(ids); |
| 77 | return success(WxAccountConvert.INSTANCE.convertList(list)); | 79 | return success(WxAccountConvert.INSTANCE.convertList(list)); |
| @@ -79,7 +81,7 @@ public class WxAccountController { | @@ -79,7 +81,7 @@ public class WxAccountController { | ||
| 79 | 81 | ||
| 80 | @GetMapping("/page") | 82 | @GetMapping("/page") |
| 81 | @ApiOperation("获得公众号账户分页") | 83 | @ApiOperation("获得公众号账户分页") |
| 82 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-account:query')") | 84 | + @PreAuthorize("@ss.hasPermission('wechatMp:account:query')") |
| 83 | public CommonResult<PageResult<WxAccountRespVO>> getWxAccountPage(@Valid WxAccountPageReqVO pageVO) { | 85 | public CommonResult<PageResult<WxAccountRespVO>> getWxAccountPage(@Valid WxAccountPageReqVO pageVO) { |
| 84 | PageResult<WxAccountDO> pageResult = wxAccountService.getWxAccountPage(pageVO); | 86 | PageResult<WxAccountDO> pageResult = wxAccountService.getWxAccountPage(pageVO); |
| 85 | return success(WxAccountConvert.INSTANCE.convertPage(pageResult)); | 87 | return success(WxAccountConvert.INSTANCE.convertPage(pageResult)); |
| @@ -87,7 +89,7 @@ public class WxAccountController { | @@ -87,7 +89,7 @@ public class WxAccountController { | ||
| 87 | 89 | ||
| 88 | @GetMapping("/export-excel") | 90 | @GetMapping("/export-excel") |
| 89 | @ApiOperation("导出公众号账户 Excel") | 91 | @ApiOperation("导出公众号账户 Excel") |
| 90 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-account:export')") | 92 | + @PreAuthorize("@ss.hasPermission('wechatMp:account:export')") |
| 91 | @OperateLog(type = EXPORT) | 93 | @OperateLog(type = EXPORT) |
| 92 | public void exportWxAccountExcel(@Valid WxAccountExportReqVO exportReqVO, | 94 | public void exportWxAccountExcel(@Valid WxAccountExportReqVO exportReqVO, |
| 93 | HttpServletResponse response) throws IOException { | 95 | HttpServletResponse response) throws IOException { |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountBaseVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; |
| 2 | 2 | ||
| 3 | -import lombok.*; | ||
| 4 | -import io.swagger.annotations.*; | 3 | +import io.swagger.annotations.ApiModelProperty; |
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import javax.validation.constraints.NotNull; | ||
| 5 | 7 | ||
| 6 | /** | 8 | /** |
| 7 | -* 公众号账户 Base VO,提供给添加、修改、详细的子 VO 使用 | ||
| 8 | -* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | ||
| 9 | -*/ | 9 | + * 公众号账户 Base VO,提供给添加、修改、详细的子 VO 使用 |
| 10 | + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | ||
| 11 | + * | ||
| 12 | + * @author fengdan | ||
| 13 | + */ | ||
| 10 | @Data | 14 | @Data |
| 11 | public class WxAccountBaseVO { | 15 | public class WxAccountBaseVO { |
| 12 | 16 | ||
| 13 | - @ApiModelProperty(value = "公众号名称") | 17 | + @ApiModelProperty(value = "公众号名称", required = true) |
| 18 | + @NotNull(message = "公众号名称不能为空") | ||
| 14 | private String name; | 19 | private String name; |
| 15 | 20 | ||
| 16 | - @ApiModelProperty(value = "公众号账户") | 21 | + @ApiModelProperty(value = "公众号账户", required = true) |
| 22 | + @NotNull(message = "公众号账户不能为空") | ||
| 17 | private String account; | 23 | private String account; |
| 18 | 24 | ||
| 19 | - @ApiModelProperty(value = "公众号appid") | ||
| 20 | - private String appid; | 25 | + @ApiModelProperty(value = "公众号appid", required = true) |
| 26 | + @NotNull(message = "公众号appid不能为空") | ||
| 27 | + private String appId; | ||
| 21 | 28 | ||
| 22 | - @ApiModelProperty(value = "公众号密钥") | ||
| 23 | - private String appsecret; | 29 | + @ApiModelProperty(value = "公众号密钥", required = true) |
| 30 | + @NotNull(message = "公众号密钥不能为空") | ||
| 31 | + private String appSecret; | ||
| 24 | 32 | ||
| 25 | @ApiModelProperty(value = "公众号token") | 33 | @ApiModelProperty(value = "公众号token") |
| 26 | private String token; | 34 | private String token; |
| 27 | 35 | ||
| 28 | @ApiModelProperty(value = "加密密钥") | 36 | @ApiModelProperty(value = "加密密钥") |
| 29 | - private String aeskey; | 37 | + private String aesKey; |
| 30 | 38 | ||
| 31 | @ApiModelProperty(value = "备注") | 39 | @ApiModelProperty(value = "备注") |
| 32 | private String remark; | 40 | private String remark; |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountCreateReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; |
| 2 | 2 | ||
| 3 | -import lombok.*; | ||
| 4 | -import io.swagger.annotations.*; | 3 | +import io.swagger.annotations.ApiModel; |
| 4 | +import lombok.Data; | ||
| 5 | +import lombok.EqualsAndHashCode; | ||
| 6 | +import lombok.ToString; | ||
| 5 | 7 | ||
| 8 | +/** | ||
| 9 | + * @author fengdan | ||
| 10 | + */ | ||
| 6 | @ApiModel("管理后台 - 公众号账户创建 Request VO") | 11 | @ApiModel("管理后台 - 公众号账户创建 Request VO") |
| 7 | @Data | 12 | @Data |
| 8 | @EqualsAndHashCode(callSuper = true) | 13 | @EqualsAndHashCode(callSuper = true) |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountExcelVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; |
| 2 | 2 | ||
| 3 | -import lombok.*; | ||
| 4 | -import java.util.*; | ||
| 5 | - | ||
| 6 | import com.alibaba.excel.annotation.ExcelProperty; | 3 | import com.alibaba.excel.annotation.ExcelProperty; |
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import java.util.Date; | ||
| 7 | + | ||
| 7 | 8 | ||
| 8 | /** | 9 | /** |
| 9 | * 公众号账户 Excel VO | 10 | * 公众号账户 Excel VO |
| @@ -23,10 +24,7 @@ public class WxAccountExcelVO { | @@ -23,10 +24,7 @@ public class WxAccountExcelVO { | ||
| 23 | private String account; | 24 | private String account; |
| 24 | 25 | ||
| 25 | @ExcelProperty("公众号appid") | 26 | @ExcelProperty("公众号appid") |
| 26 | - private String appid; | ||
| 27 | - | ||
| 28 | - @ExcelProperty("公众号密钥") | ||
| 29 | - private String appsecret; | 27 | + private String appId; |
| 30 | 28 | ||
| 31 | @ExcelProperty("公众号url") | 29 | @ExcelProperty("公众号url") |
| 32 | private String url; | 30 | private String url; |
| @@ -35,7 +33,7 @@ public class WxAccountExcelVO { | @@ -35,7 +33,7 @@ public class WxAccountExcelVO { | ||
| 35 | private String token; | 33 | private String token; |
| 36 | 34 | ||
| 37 | @ExcelProperty("加密密钥") | 35 | @ExcelProperty("加密密钥") |
| 38 | - private String aeskey; | 36 | + private String aesKey; |
| 39 | 37 | ||
| 40 | @ExcelProperty("二维码图片URL") | 38 | @ExcelProperty("二维码图片URL") |
| 41 | private String qrCodeUrl; | 39 | private String qrCodeUrl; |
| @@ -45,5 +43,4 @@ public class WxAccountExcelVO { | @@ -45,5 +43,4 @@ public class WxAccountExcelVO { | ||
| 45 | 43 | ||
| 46 | @ExcelProperty("创建时间") | 44 | @ExcelProperty("创建时间") |
| 47 | private Date createTime; | 45 | private Date createTime; |
| 48 | - | ||
| 49 | } | 46 | } |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountExportReqVO.java
| @@ -7,6 +7,9 @@ import org.springframework.format.annotation.DateTimeFormat; | @@ -7,6 +7,9 @@ import org.springframework.format.annotation.DateTimeFormat; | ||
| 7 | 7 | ||
| 8 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | 8 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| 9 | 9 | ||
| 10 | +/** | ||
| 11 | + * @author fengdan | ||
| 12 | + */ | ||
| 10 | @ApiModel(value = "管理后台 - 公众号账户 Excel 导出 Request VO", description = "参数和 WxAccountPageReqVO 是一致的") | 13 | @ApiModel(value = "管理后台 - 公众号账户 Excel 导出 Request VO", description = "参数和 WxAccountPageReqVO 是一致的") |
| 11 | @Data | 14 | @Data |
| 12 | public class WxAccountExportReqVO { | 15 | public class WxAccountExportReqVO { |
| @@ -18,7 +21,7 @@ public class WxAccountExportReqVO { | @@ -18,7 +21,7 @@ public class WxAccountExportReqVO { | ||
| 18 | private String account; | 21 | private String account; |
| 19 | 22 | ||
| 20 | @ApiModelProperty(value = "公众号appid") | 23 | @ApiModelProperty(value = "公众号appid") |
| 21 | - private String appid; | 24 | + private String appId; |
| 22 | 25 | ||
| 23 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | 26 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 24 | @ApiModelProperty(value = "开始创建时间") | 27 | @ApiModelProperty(value = "开始创建时间") |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountPageReqVO.java
| @@ -8,12 +8,14 @@ import org.springframework.format.annotation.DateTimeFormat; | @@ -8,12 +8,14 @@ import org.springframework.format.annotation.DateTimeFormat; | ||
| 8 | 8 | ||
| 9 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | 9 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| 10 | 10 | ||
| 11 | +/** | ||
| 12 | + * @author fengdan | ||
| 13 | + */ | ||
| 11 | @ApiModel("管理后台 - 公众号账户分页 Request VO") | 14 | @ApiModel("管理后台 - 公众号账户分页 Request VO") |
| 12 | @Data | 15 | @Data |
| 13 | @EqualsAndHashCode(callSuper = true) | 16 | @EqualsAndHashCode(callSuper = true) |
| 14 | @ToString(callSuper = true) | 17 | @ToString(callSuper = true) |
| 15 | public class WxAccountPageReqVO extends PageParam { | 18 | public class WxAccountPageReqVO extends PageParam { |
| 16 | - | ||
| 17 | @ApiModelProperty(value = "公众号名称") | 19 | @ApiModelProperty(value = "公众号名称") |
| 18 | private String name; | 20 | private String name; |
| 19 | 21 | ||
| @@ -21,7 +23,7 @@ public class WxAccountPageReqVO extends PageParam { | @@ -21,7 +23,7 @@ public class WxAccountPageReqVO extends PageParam { | ||
| 21 | private String account; | 23 | private String account; |
| 22 | 24 | ||
| 23 | @ApiModelProperty(value = "公众号appid") | 25 | @ApiModelProperty(value = "公众号appid") |
| 24 | - private String appid; | 26 | + private String appId; |
| 25 | 27 | ||
| 26 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | 28 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 27 | @ApiModelProperty(value = "开始创建时间") | 29 | @ApiModelProperty(value = "开始创建时间") |
| @@ -30,5 +32,4 @@ public class WxAccountPageReqVO extends PageParam { | @@ -30,5 +32,4 @@ public class WxAccountPageReqVO extends PageParam { | ||
| 30 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | 32 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 31 | @ApiModelProperty(value = "结束创建时间") | 33 | @ApiModelProperty(value = "结束创建时间") |
| 32 | private Date endCreateTime; | 34 | private Date endCreateTime; |
| 33 | - | ||
| 34 | } | 35 | } |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountRespVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; |
| 2 | 2 | ||
| 3 | -import lombok.*; | ||
| 4 | -import java.util.*; | ||
| 5 | -import io.swagger.annotations.*; | 3 | +import io.swagger.annotations.ApiModel; |
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.Data; | ||
| 6 | +import lombok.EqualsAndHashCode; | ||
| 7 | +import lombok.ToString; | ||
| 6 | 8 | ||
| 9 | +import java.util.Date; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * @author fengdan | ||
| 13 | + */ | ||
| 7 | @ApiModel("管理后台 - 公众号账户 Response VO") | 14 | @ApiModel("管理后台 - 公众号账户 Response VO") |
| 8 | @Data | 15 | @Data |
| 9 | @EqualsAndHashCode(callSuper = true) | 16 | @EqualsAndHashCode(callSuper = true) |
| @@ -22,4 +29,6 @@ public class WxAccountRespVO extends WxAccountBaseVO { | @@ -22,4 +29,6 @@ public class WxAccountRespVO extends WxAccountBaseVO { | ||
| 22 | @ApiModelProperty(value = "创建时间", required = true) | 29 | @ApiModelProperty(value = "创建时间", required = true) |
| 23 | private Date createTime; | 30 | private Date createTime; |
| 24 | 31 | ||
| 32 | + @ApiModelProperty(value = "公众号密钥", required = true) | ||
| 33 | + private String appSecret; | ||
| 25 | } | 34 | } |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountUpdateReqVO.java
| @@ -4,6 +4,9 @@ import lombok.*; | @@ -4,6 +4,9 @@ import lombok.*; | ||
| 4 | import io.swagger.annotations.*; | 4 | import io.swagger.annotations.*; |
| 5 | import javax.validation.constraints.*; | 5 | import javax.validation.constraints.*; |
| 6 | 6 | ||
| 7 | +/** | ||
| 8 | + * @author fengdan | ||
| 9 | + */ | ||
| 7 | @ApiModel("管理后台 - 公众号账户更新 Request VO") | 10 | @ApiModel("管理后台 - 公众号账户更新 Request VO") |
| 8 | @Data | 11 | @Data |
| 9 | @EqualsAndHashCode(callSuper = true) | 12 | @EqualsAndHashCode(callSuper = true) |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/account/WxAccountMapper.java
| @@ -22,7 +22,7 @@ public interface WxAccountMapper extends BaseMapperX<WxAccountDO> { | @@ -22,7 +22,7 @@ public interface WxAccountMapper extends BaseMapperX<WxAccountDO> { | ||
| 22 | return selectPage(reqVO, new LambdaQueryWrapperX<WxAccountDO>() | 22 | return selectPage(reqVO, new LambdaQueryWrapperX<WxAccountDO>() |
| 23 | .likeIfPresent(WxAccountDO::getName, reqVO.getName()) | 23 | .likeIfPresent(WxAccountDO::getName, reqVO.getName()) |
| 24 | .eqIfPresent(WxAccountDO::getAccount, reqVO.getAccount()) | 24 | .eqIfPresent(WxAccountDO::getAccount, reqVO.getAccount()) |
| 25 | - .eqIfPresent(WxAccountDO::getAppId, reqVO.getAppid()) | 25 | + .eqIfPresent(WxAccountDO::getAppId, reqVO.getAppId()) |
| 26 | .betweenIfPresent(WxAccountDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | 26 | .betweenIfPresent(WxAccountDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) |
| 27 | .orderByDesc(WxAccountDO::getId)); | 27 | .orderByDesc(WxAccountDO::getId)); |
| 28 | } | 28 | } |
| @@ -31,7 +31,7 @@ public interface WxAccountMapper extends BaseMapperX<WxAccountDO> { | @@ -31,7 +31,7 @@ public interface WxAccountMapper extends BaseMapperX<WxAccountDO> { | ||
| 31 | return selectList(new LambdaQueryWrapperX<WxAccountDO>() | 31 | return selectList(new LambdaQueryWrapperX<WxAccountDO>() |
| 32 | .likeIfPresent(WxAccountDO::getName, reqVO.getName()) | 32 | .likeIfPresent(WxAccountDO::getName, reqVO.getName()) |
| 33 | .eqIfPresent(WxAccountDO::getAccount, reqVO.getAccount()) | 33 | .eqIfPresent(WxAccountDO::getAccount, reqVO.getAccount()) |
| 34 | - .eqIfPresent(WxAccountDO::getAppId, reqVO.getAppid()) | 34 | + .eqIfPresent(WxAccountDO::getAppId, reqVO.getAppId()) |
| 35 | .betweenIfPresent(WxAccountDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | 35 | .betweenIfPresent(WxAccountDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) |
| 36 | .orderByDesc(WxAccountDO::getId)); | 36 | .orderByDesc(WxAccountDO::getId)); |
| 37 | } | 37 | } |
yudao-ui-admin/src/api/wechatMp/wxAccount.js
| 1 | import request from '@/utils/request' | 1 | import request from '@/utils/request' |
| 2 | 2 | ||
| 3 | // 创建公众号账户 | 3 | // 创建公众号账户 |
| 4 | -export function createWxAccount(data) { | 4 | +export function createAccount(data) { |
| 5 | return request({ | 5 | return request({ |
| 6 | - url: '/wechatMp/wx-account/create', | 6 | + url: '/wechatMp/account/create', |
| 7 | method: 'post', | 7 | method: 'post', |
| 8 | data: data | 8 | data: data |
| 9 | }) | 9 | }) |
| 10 | } | 10 | } |
| 11 | 11 | ||
| 12 | // 更新公众号账户 | 12 | // 更新公众号账户 |
| 13 | -export function updateWxAccount(data) { | 13 | +export function updateAccount(data) { |
| 14 | return request({ | 14 | return request({ |
| 15 | - url: '/wechatMp/wx-account/update', | 15 | + url: '/wechatMp/account/update', |
| 16 | method: 'put', | 16 | method: 'put', |
| 17 | data: data | 17 | data: data |
| 18 | }) | 18 | }) |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | // 删除公众号账户 | 21 | // 删除公众号账户 |
| 22 | -export function deleteWxAccount(id) { | 22 | +export function deleteAccount(id) { |
| 23 | return request({ | 23 | return request({ |
| 24 | - url: '/wechatMp/wx-account/delete?id=' + id, | 24 | + url: '/wechatMp/account/delete?id=' + id, |
| 25 | method: 'delete' | 25 | method: 'delete' |
| 26 | }) | 26 | }) |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | // 获得公众号账户 | 29 | // 获得公众号账户 |
| 30 | -export function getWxAccount(id) { | 30 | +export function getAccount(id) { |
| 31 | return request({ | 31 | return request({ |
| 32 | - url: '/wechatMp/wx-account/get?id=' + id, | 32 | + url: '/wechatMp/account/get?id=' + id, |
| 33 | method: 'get' | 33 | method: 'get' |
| 34 | }) | 34 | }) |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | // 获得公众号账户分页 | 37 | // 获得公众号账户分页 |
| 38 | -export function getWxAccountPage(query) { | 38 | +export function getAccountPage(query) { |
| 39 | return request({ | 39 | return request({ |
| 40 | - url: '/wechatMp/wx-account/page', | 40 | + url: '/wechatMp/account/page', |
| 41 | method: 'get', | 41 | method: 'get', |
| 42 | params: query | 42 | params: query |
| 43 | }) | 43 | }) |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | // 导出公众号账户 Excel | 46 | // 导出公众号账户 Excel |
| 47 | -export function exportWxAccountExcel(query) { | 47 | +export function exportAccountExcel(query) { |
| 48 | return request({ | 48 | return request({ |
| 49 | - url: '/wechatMp/wx-account/export-excel', | 49 | + url: '/wechatMp/account/export-excel', |
| 50 | method: 'get', | 50 | method: 'get', |
| 51 | params: query, | 51 | params: query, |
| 52 | responseType: 'blob' | 52 | responseType: 'blob' |
yudao-ui-admin/src/views/wechatMp/wxAccount/index.vue
| @@ -3,18 +3,13 @@ | @@ -3,18 +3,13 @@ | ||
| 3 | 3 | ||
| 4 | <!-- 搜索工作栏 --> | 4 | <!-- 搜索工作栏 --> |
| 5 | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> | 5 | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| 6 | - <el-form-item label="公众号名称" prop="name"> | ||
| 7 | - <el-input v-model="queryParams.name" placeholder="请输入公众号名称" clearable @keyup.enter.native="handleQuery"/> | ||
| 8 | - </el-form-item> | ||
| 9 | - <el-form-item label="公众号账户" prop="account"> | ||
| 10 | - <el-input v-model="queryParams.account" placeholder="请输入公众号账户" clearable @keyup.enter.native="handleQuery"/> | ||
| 11 | - </el-form-item> | ||
| 12 | - <el-form-item label="公众号appId" prop="appId"> | ||
| 13 | - <el-input v-model="queryParams.appId" placeholder="请输入公众号appId" clearable @keyup.enter.native="handleQuery"/> | 6 | + <el-form-item label="名称" prop="name"> |
| 7 | + <el-input v-model="queryParams.name" placeholder="请输入公众号名称" clearable | ||
| 8 | + @keyup.enter.native="handleQuery"/> | ||
| 14 | </el-form-item> | 9 | </el-form-item> |
| 15 | <el-form-item label="创建时间"> | 10 | <el-form-item label="创建时间"> |
| 16 | <el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd" | 11 | <el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd" |
| 17 | - type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" /> | 12 | + type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"/> |
| 18 | </el-form-item> | 13 | </el-form-item> |
| 19 | <el-form-item> | 14 | <el-form-item> |
| 20 | <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> | 15 | <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> |
| @@ -26,27 +21,29 @@ | @@ -26,27 +21,29 @@ | ||
| 26 | <el-row :gutter="10" class="mb8"> | 21 | <el-row :gutter="10" class="mb8"> |
| 27 | <el-col :span="1.5"> | 22 | <el-col :span="1.5"> |
| 28 | <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" | 23 | <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" |
| 29 | - v-hasPermi="['wechatMp:wx-account:create']">新增</el-button> | 24 | + v-hasPermi="['wechatMp:account:create']">新增 |
| 25 | + </el-button> | ||
| 30 | </el-col> | 26 | </el-col> |
| 31 | <el-col :span="1.5"> | 27 | <el-col :span="1.5"> |
| 32 | - <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" | ||
| 33 | - v-hasPermi="['wechatMp:wx-account:export']">导出</el-button> | 28 | + <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" |
| 29 | + :loading="exportLoading" | ||
| 30 | + v-hasPermi="['wechatMp:account:export']">导出 | ||
| 31 | + </el-button> | ||
| 34 | </el-col> | 32 | </el-col> |
| 35 | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | 33 | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| 36 | </el-row> | 34 | </el-row> |
| 37 | 35 | ||
| 38 | <!-- 列表 --> | 36 | <!-- 列表 --> |
| 39 | <el-table v-loading="loading" :data="list"> | 37 | <el-table v-loading="loading" :data="list"> |
| 40 | - <el-table-column label="编号" align="center" prop="id" /> | ||
| 41 | - <el-table-column label="公众号名称" align="center" prop="name" /> | ||
| 42 | - <el-table-column label="公众号账户" align="center" prop="account" /> | ||
| 43 | - <el-table-column label="公众号appId" align="center" prop="appId"/> | ||
| 44 | - <el-table-column label="公众号密钥" align="center" prop="appSecret"/> | ||
| 45 | - <el-table-column label="公众号url" align="center" prop="url" /> | ||
| 46 | - <el-table-column label="公众号token" align="center" prop="token" /> | 38 | + <el-table-column label="编号" align="center" prop="id"/> |
| 39 | + <el-table-column label="名称" align="center" prop="name"/> | ||
| 40 | + <el-table-column label="微信原始ID" align="center" prop="account"/> | ||
| 41 | + <el-table-column label="appId" align="center" prop="appId"/> | ||
| 42 | + <el-table-column label="url" align="center" prop="url"/> | ||
| 43 | + <el-table-column label="Token" align="center" prop="token"/> | ||
| 47 | <el-table-column label="加密密钥" align="center" prop="aesKey"/> | 44 | <el-table-column label="加密密钥" align="center" prop="aesKey"/> |
| 48 | - <el-table-column label="二维码图片URL" align="center" prop="qrCodeUrl"/> | ||
| 49 | - <el-table-column label="备注" align="center" prop="remark" /> | 45 | + <el-table-column label="二维码" align="center" prop="qrCodeUrl"/> |
| 46 | + <el-table-column label="备注" align="center" prop="remark"/> | ||
| 50 | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> | 47 | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| 51 | <template slot-scope="scope"> | 48 | <template slot-scope="scope"> |
| 52 | <span>{{ parseTime(scope.row.createTime) }}</span> | 49 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| @@ -55,9 +52,11 @@ | @@ -55,9 +52,11 @@ | ||
| 55 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | 52 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 56 | <template slot-scope="scope"> | 53 | <template slot-scope="scope"> |
| 57 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" | 54 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| 58 | - v-hasPermi="['wechatMp:wx-account:update']">修改</el-button> | 55 | + v-hasPermi="['wechatMp:account:update']">修改 |
| 56 | + </el-button> | ||
| 59 | <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" | 57 | <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" |
| 60 | - v-hasPermi="['wechatMp:wx-account:delete']">删除</el-button> | 58 | + v-hasPermi="['wechatMp:account:delete']">删除 |
| 59 | + </el-button> | ||
| 61 | </template> | 60 | </template> |
| 62 | </el-table-column> | 61 | </el-table-column> |
| 63 | </el-table> | 62 | </el-table> |
| @@ -69,25 +68,41 @@ | @@ -69,25 +68,41 @@ | ||
| 69 | <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> | 68 | <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> |
| 70 | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> | 69 | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| 71 | <el-form-item label="公众号名称" prop="name"> | 70 | <el-form-item label="公众号名称" prop="name"> |
| 72 | - <el-input v-model="form.name" placeholder="请输入公众号名称" /> | ||
| 73 | - </el-form-item> | ||
| 74 | - <el-form-item label="公众号账户" prop="account"> | ||
| 75 | - <el-input v-model="form.account" placeholder="请输入公众号账户" /> | ||
| 76 | - </el-form-item> | ||
| 77 | - <el-form-item label="公众号appId" prop="appId"> | ||
| 78 | - <el-input v-model="form.appId" placeholder="请输入公众号appId"/> | 71 | + <el-input v-model="form.name" placeholder="请输入公众号名称"/> |
| 79 | </el-form-item> | 72 | </el-form-item> |
| 80 | - <el-form-item label="公众号密钥" prop="appSecret"> | ||
| 81 | - <el-input v-model="form.appSecret" placeholder="请输入公众号密钥"/> | ||
| 82 | - </el-form-item> | ||
| 83 | - <el-form-item label="公众号token" prop="token"> | ||
| 84 | - <el-input v-model="form.token" placeholder="请输入公众号token" /> | 73 | + |
| 74 | + <el-tooltip class="item" effect="dark" | ||
| 75 | + content="在微信公众平台(mp.weixin.qq.com)的菜单【设置】-【公众号设置】-【帐号详情】中能找到原始ID" | ||
| 76 | + placement="right"> | ||
| 77 | + <el-form-item label="微信原始ID" prop="account"> | ||
| 78 | + <el-input v-model="form.account" placeholder="请输入微信原始ID" :disabled='disabled'/> | ||
| 79 | + </el-form-item> | ||
| 80 | + </el-tooltip> | ||
| 81 | + | ||
| 82 | + <el-tooltip class="item" effect="dark" | ||
| 83 | + content="在微信公众平台(mp.weixin.qq.com)的菜单【开发】-【基本配置】中能找到AppID " | ||
| 84 | + placement="right"> | ||
| 85 | + <el-form-item label="AppID" prop="appId"> | ||
| 86 | + <el-input v-model="form.appId" placeholder="请输入公众号appId" :disabled='disabled'/> | ||
| 87 | + </el-form-item> | ||
| 88 | + </el-tooltip> | ||
| 89 | + | ||
| 90 | + <el-tooltip class="item" effect="dark" | ||
| 91 | + content="在微信公众平台(mp.weixin.qq.com)的菜单【开发】-【基本配置】中能找到AppSecret" | ||
| 92 | + placement="right"> | ||
| 93 | + <el-form-item label="AppSecret" prop="appSecret"> | ||
| 94 | + <el-input v-model="form.appSecret" placeholder="请输入公众号密钥" :disabled='disabled'/> | ||
| 95 | + </el-form-item> | ||
| 96 | + </el-tooltip> | ||
| 97 | + | ||
| 98 | + <el-form-item label="token" prop="token"> | ||
| 99 | + <el-input v-model="form.token" placeholder="请输入公众号token"/> | ||
| 85 | </el-form-item> | 100 | </el-form-item> |
| 86 | <el-form-item label="加密密钥" prop="aesKey"> | 101 | <el-form-item label="加密密钥" prop="aesKey"> |
| 87 | <el-input v-model="form.aesKey" placeholder="请输入加密密钥"/> | 102 | <el-input v-model="form.aesKey" placeholder="请输入加密密钥"/> |
| 88 | </el-form-item> | 103 | </el-form-item> |
| 89 | <el-form-item label="备注" prop="remark"> | 104 | <el-form-item label="备注" prop="remark"> |
| 90 | - <el-input v-model="form.remark" placeholder="请输入备注" /> | 105 | + <el-input v-model="form.remark" placeholder="请输入备注"/> |
| 91 | </el-form-item> | 106 | </el-form-item> |
| 92 | </el-form> | 107 | </el-form> |
| 93 | <div slot="footer" class="dialog-footer"> | 108 | <div slot="footer" class="dialog-footer"> |
| @@ -99,12 +114,18 @@ | @@ -99,12 +114,18 @@ | ||
| 99 | </template> | 114 | </template> |
| 100 | 115 | ||
| 101 | <script> | 116 | <script> |
| 102 | -import { createWxAccount, updateWxAccount, deleteWxAccount, getWxAccount, getWxAccountPage, exportWxAccountExcel } from "@/api/wechatMp/wxAccount"; | 117 | +import { |
| 118 | + createAccount, | ||
| 119 | + deleteAccount, | ||
| 120 | + exportAccountExcel, | ||
| 121 | + getAccount, | ||
| 122 | + getAccountPage, | ||
| 123 | + updateAccount | ||
| 124 | +} from '@/api/wechatMp/wxAccount' | ||
| 103 | 125 | ||
| 104 | export default { | 126 | export default { |
| 105 | - name: "WxAccount", | ||
| 106 | - components: { | ||
| 107 | - }, | 127 | + name: 'wxAccount', |
| 128 | + components: {}, | ||
| 108 | data() { | 129 | data() { |
| 109 | return { | 130 | return { |
| 110 | // 遮罩层 | 131 | // 遮罩层 |
| @@ -118,7 +139,7 @@ export default { | @@ -118,7 +139,7 @@ export default { | ||
| 118 | // 公众号账户列表 | 139 | // 公众号账户列表 |
| 119 | list: [], | 140 | list: [], |
| 120 | // 弹出层标题 | 141 | // 弹出层标题 |
| 121 | - title: "", | 142 | + title: '', |
| 122 | // 是否显示弹出层 | 143 | // 是否显示弹出层 |
| 123 | open: false, | 144 | open: false, |
| 124 | dateRangeCreateTime: [], | 145 | dateRangeCreateTime: [], |
| @@ -134,30 +155,37 @@ export default { | @@ -134,30 +155,37 @@ export default { | ||
| 134 | form: {}, | 155 | form: {}, |
| 135 | // 表单校验 | 156 | // 表单校验 |
| 136 | rules: { | 157 | rules: { |
| 137 | - } | ||
| 138 | - }; | 158 | + name: [{required: true, message: '公众号名称不能为空', trigger: 'blur'}], |
| 159 | + account: [{required: true, message: '公众号账户不能为空', trigger: 'blur'}], | ||
| 160 | + appId: [{required: true, message: '公众号appid不能为空', trigger: 'blur'}], | ||
| 161 | + appSecret: [{required: true, message: '公众号密钥不能为空', trigger: 'blur'}], | ||
| 162 | + }, | ||
| 163 | + // 禁用属性 | ||
| 164 | + disabled: false, | ||
| 165 | + } | ||
| 139 | }, | 166 | }, |
| 140 | created() { | 167 | created() { |
| 141 | - this.getList(); | 168 | + this.getList() |
| 142 | }, | 169 | }, |
| 143 | methods: { | 170 | methods: { |
| 144 | /** 查询列表 */ | 171 | /** 查询列表 */ |
| 145 | getList() { | 172 | getList() { |
| 146 | - this.loading = true; | 173 | + this.loading = true |
| 147 | // 处理查询参数 | 174 | // 处理查询参数 |
| 148 | - let params = {...this.queryParams}; | ||
| 149 | - this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime'); | 175 | + let params = {...this.queryParams} |
| 176 | + this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime') | ||
| 150 | // 执行查询 | 177 | // 执行查询 |
| 151 | - getWxAccountPage(params).then(response => { | ||
| 152 | - this.list = response.data.list; | ||
| 153 | - this.total = response.data.total; | ||
| 154 | - this.loading = false; | ||
| 155 | - }); | 178 | + getAccountPage(params).then(response => { |
| 179 | + this.list = response.data.list | ||
| 180 | + this.total = response.data.total | ||
| 181 | + this.loading = false | ||
| 182 | + }) | ||
| 156 | }, | 183 | }, |
| 157 | /** 取消按钮 */ | 184 | /** 取消按钮 */ |
| 158 | cancel() { | 185 | cancel() { |
| 159 | - this.open = false; | ||
| 160 | - this.reset(); | 186 | + this.open = false |
| 187 | + this.disabled = false | ||
| 188 | + this.reset() | ||
| 161 | }, | 189 | }, |
| 162 | /** 表单重置 */ | 190 | /** 表单重置 */ |
| 163 | reset() { | 191 | reset() { |
| @@ -170,85 +198,88 @@ export default { | @@ -170,85 +198,88 @@ export default { | ||
| 170 | token: undefined, | 198 | token: undefined, |
| 171 | aesKey: undefined, | 199 | aesKey: undefined, |
| 172 | remark: undefined, | 200 | remark: undefined, |
| 173 | - }; | ||
| 174 | - this.resetForm("form"); | 201 | + } |
| 202 | + this.resetForm('form') | ||
| 175 | }, | 203 | }, |
| 176 | /** 搜索按钮操作 */ | 204 | /** 搜索按钮操作 */ |
| 177 | handleQuery() { | 205 | handleQuery() { |
| 178 | - this.queryParams.pageNo = 1; | ||
| 179 | - this.getList(); | 206 | + this.queryParams.pageNo = 1 |
| 207 | + this.getList() | ||
| 180 | }, | 208 | }, |
| 181 | /** 重置按钮操作 */ | 209 | /** 重置按钮操作 */ |
| 182 | resetQuery() { | 210 | resetQuery() { |
| 183 | - this.dateRangeCreateTime = []; | ||
| 184 | - this.resetForm("queryForm"); | ||
| 185 | - this.handleQuery(); | 211 | + this.dateRangeCreateTime = [] |
| 212 | + this.resetForm('queryForm') | ||
| 213 | + this.handleQuery() | ||
| 186 | }, | 214 | }, |
| 187 | /** 新增按钮操作 */ | 215 | /** 新增按钮操作 */ |
| 188 | handleAdd() { | 216 | handleAdd() { |
| 189 | - this.reset(); | ||
| 190 | - this.open = true; | ||
| 191 | - this.title = "添加公众号账户"; | 217 | + this.reset() |
| 218 | + this.open = true | ||
| 219 | + this.title = '添加公众号账户' | ||
| 192 | }, | 220 | }, |
| 193 | /** 修改按钮操作 */ | 221 | /** 修改按钮操作 */ |
| 194 | handleUpdate(row) { | 222 | handleUpdate(row) { |
| 195 | - this.reset(); | ||
| 196 | - const id = row.id; | ||
| 197 | - getWxAccount(id).then(response => { | ||
| 198 | - this.form = response.data; | ||
| 199 | - this.open = true; | ||
| 200 | - this.title = "修改公众号账户"; | ||
| 201 | - }); | 223 | + this.reset() |
| 224 | + const id = row.id | ||
| 225 | + getAccount(id).then(response => { | ||
| 226 | + this.form = response.data | ||
| 227 | + this.open = true | ||
| 228 | + this.title = '修改公众号账户' | ||
| 229 | + this.disabled = true | ||
| 230 | + }) | ||
| 202 | }, | 231 | }, |
| 203 | /** 提交按钮 */ | 232 | /** 提交按钮 */ |
| 204 | submitForm() { | 233 | submitForm() { |
| 205 | - this.$refs["form"].validate(valid => { | 234 | + this.$refs['form'].validate(valid => { |
| 206 | if (!valid) { | 235 | if (!valid) { |
| 207 | - return; | 236 | + return |
| 208 | } | 237 | } |
| 209 | // 修改的提交 | 238 | // 修改的提交 |
| 210 | if (this.form.id != null) { | 239 | if (this.form.id != null) { |
| 211 | - updateWxAccount(this.form).then(response => { | ||
| 212 | - this.$modal.msgSuccess("修改成功"); | ||
| 213 | - this.open = false; | ||
| 214 | - this.getList(); | ||
| 215 | - }); | ||
| 216 | - return; | 240 | + updateAccount(this.form).then(response => { |
| 241 | + this.$modal.msgSuccess('修改成功') | ||
| 242 | + this.open = false | ||
| 243 | + this.getList() | ||
| 244 | + }) | ||
| 245 | + return | ||
| 217 | } | 246 | } |
| 218 | // 添加的提交 | 247 | // 添加的提交 |
| 219 | - createWxAccount(this.form).then(response => { | ||
| 220 | - this.$modal.msgSuccess("新增成功"); | ||
| 221 | - this.open = false; | ||
| 222 | - this.getList(); | ||
| 223 | - }); | ||
| 224 | - }); | 248 | + createAccount(this.form).then(response => { |
| 249 | + this.$modal.msgSuccess('新增成功') | ||
| 250 | + this.open = false | ||
| 251 | + this.getList() | ||
| 252 | + }) | ||
| 253 | + }) | ||
| 225 | }, | 254 | }, |
| 226 | /** 删除按钮操作 */ | 255 | /** 删除按钮操作 */ |
| 227 | handleDelete(row) { | 256 | handleDelete(row) { |
| 228 | - const id = row.id; | ||
| 229 | - this.$modal.confirm('是否确认删除公众号账户编号为"' + id + '"的数据项?').then(function() { | ||
| 230 | - return deleteWxAccount(id); | ||
| 231 | - }).then(() => { | ||
| 232 | - this.getList(); | ||
| 233 | - this.$modal.msgSuccess("删除成功"); | ||
| 234 | - }).catch(() => {}); | 257 | + const id = row.id |
| 258 | + this.$modal.confirm('是否确认删除公众号账户编号为"' + id + '"的数据项?').then(function () { | ||
| 259 | + return deleteAccount(id) | ||
| 260 | + }).then(() => { | ||
| 261 | + this.getList() | ||
| 262 | + this.$modal.msgSuccess('删除成功') | ||
| 263 | + }).catch(() => { | ||
| 264 | + }) | ||
| 235 | }, | 265 | }, |
| 236 | /** 导出按钮操作 */ | 266 | /** 导出按钮操作 */ |
| 237 | handleExport() { | 267 | handleExport() { |
| 238 | // 处理查询参数 | 268 | // 处理查询参数 |
| 239 | - let params = {...this.queryParams}; | ||
| 240 | - params.pageNo = undefined; | ||
| 241 | - params.pageSize = undefined; | ||
| 242 | - this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime'); | 269 | + let params = {...this.queryParams} |
| 270 | + params.pageNo = undefined | ||
| 271 | + params.pageSize = undefined | ||
| 272 | + this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime') | ||
| 243 | // 执行导出 | 273 | // 执行导出 |
| 244 | this.$modal.confirm('是否确认导出所有公众号账户数据项?').then(() => { | 274 | this.$modal.confirm('是否确认导出所有公众号账户数据项?').then(() => { |
| 245 | - this.exportLoading = true; | ||
| 246 | - return exportWxAccountExcel(params); | ||
| 247 | - }).then(response => { | ||
| 248 | - this.$download.excel(response, '公众号账户.xls'); | ||
| 249 | - this.exportLoading = false; | ||
| 250 | - }).catch(() => {}); | 275 | + this.exportLoading = true |
| 276 | + return exportAccountExcel(params) | ||
| 277 | + }).then(response => { | ||
| 278 | + this.$download.excel(response, '公众号账户.xls') | ||
| 279 | + this.exportLoading = false | ||
| 280 | + }).catch(() => { | ||
| 281 | + }) | ||
| 251 | } | 282 | } |
| 252 | } | 283 | } |
| 253 | -}; | 284 | +} |
| 254 | </script> | 285 | </script> |