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