微信参数配置

master
382696293@qq.com 2 years ago
parent 0ee579595b
commit f9662eab18

@ -0,0 +1,221 @@
package com.flossom.common.core.domain.entity;
import com.flossom.common.core.annotation.Excel;
import com.flossom.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* wx_parameter_setting
*
* @author flossom
* @date 2023-12-13
*/
public class WxParameterSetting extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* $column.columnComment
*/
private Long id;
/**
* appid
*/
@Excel(name = "小程序appid")
private String appid;
/**
*
*/
@Excel(name = "小程序密钥")
private String appkey;
/**
*
*/
@Excel(name = "商户号")
private String merchantId;
/**
* API
*/
@Excel(name = "商户号API密钥")
private String merchantApiKey;
/**
* key(32)
*/
@Excel(name = "开放key(32位)")
private String openKey;
/**
* (64)
*/
@Excel(name = "开放密钥(64位)")
private String openSecret;
/**
* ipip
*/
@Excel(name = "绑定ip多个ip““分割")
private String bindingIp;
/**
* key
*/
@Excel(name = "数云key")
private String syKey;
/**
*
*/
@Excel(name = "数云密钥")
private String sySecret;
/**
*
*/
@Excel(name = "数云请求地址")
private String syUrl;
/**
* id
*/
@Excel(name = "数云店铺id")
private String syShopId;
/**
* 0 1
*/
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private Integer status;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setAppid(String appid) {
this.appid = appid;
}
public String getAppid() {
return appid;
}
public void setAppkey(String appkey) {
this.appkey = appkey;
}
public String getAppkey() {
return appkey;
}
public void setMerchantId(String merchantId) {
this.merchantId = merchantId;
}
public String getMerchantId() {
return merchantId;
}
public void setMerchantApiKey(String merchantApiKey) {
this.merchantApiKey = merchantApiKey;
}
public String getMerchantApiKey() {
return merchantApiKey;
}
public void setOpenKey(String openKey) {
this.openKey = openKey;
}
public String getOpenKey() {
return openKey;
}
public void setOpenSecret(String openSecret) {
this.openSecret = openSecret;
}
public String getOpenSecret() {
return openSecret;
}
public void setBindingIp(String bindingIp) {
this.bindingIp = bindingIp;
}
public String getBindingIp() {
return bindingIp;
}
public void setSyKey(String syKey) {
this.syKey = syKey;
}
public String getSyKey() {
return syKey;
}
public void setSySecret(String sySecret) {
this.sySecret = sySecret;
}
public String getSySecret() {
return sySecret;
}
public void setSyUrl(String syUrl) {
this.syUrl = syUrl;
}
public String getSyUrl() {
return syUrl;
}
public void setSyShopId(String syShopId) {
this.syShopId = syShopId;
}
public String getSyShopId() {
return syShopId;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getStatus() {
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("appid", getAppid())
.append("appkey", getAppkey())
.append("merchantId", getMerchantId())
.append("merchantApiKey", getMerchantApiKey())
.append("openKey", getOpenKey())
.append("openSecret", getOpenSecret())
.append("bindingIp", getBindingIp())
.append("syKey", getSyKey())
.append("sySecret", getSySecret())
.append("syUrl", getSyUrl())
.append("syShopId", getSyShopId())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

@ -0,0 +1,61 @@
package com.flossom.hzMapper.mapper;
import com.flossom.common.core.domain.entity.WxParameterSetting;
import java.util.List;
/**
* Mapper
*
* @author flossom
* @date 2023-12-13
*/
public interface WxParameterSettingMapper {
/**
*
*
* @param id
* @return
*/
public WxParameterSetting selectWxParameterSettingById(Long id);
/**
*
*
* @param wxParameterSetting
* @return
*/
public List<WxParameterSetting> selectWxParameterSettingList(WxParameterSetting wxParameterSetting);
/**
*
*
* @param wxParameterSetting
* @return
*/
public int insertWxParameterSetting(WxParameterSetting wxParameterSetting);
/**
*
*
* @param wxParameterSetting
* @return
*/
public int updateWxParameterSetting(WxParameterSetting wxParameterSetting);
/**
*
*
* @param id
* @return
*/
public int deleteWxParameterSettingById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteWxParameterSettingByIds(Long[] ids);
}

@ -0,0 +1,133 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.flossom.hzMapper.mapper.WxParameterSettingMapper">
<resultMap type="WxParameterSetting" id="WxParameterSettingResult">
<result property="id" column="id" />
<result property="appid" column="appid" />
<result property="appkey" column="appkey" />
<result property="merchantId" column="merchant_id" />
<result property="merchantApiKey" column="merchant_api_key" />
<result property="openKey" column="open_key" />
<result property="openSecret" column="open_secret" />
<result property="bindingIp" column="binding_ip" />
<result property="syKey" column="sy_key" />
<result property="sySecret" column="sy_secret" />
<result property="syUrl" column="sy_url" />
<result property="syShopId" column="sy_shop_id" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectWxParameterSettingVo">
select id, appid, appkey, merchant_id, merchant_api_key, open_key, open_secret, binding_ip, sy_key, sy_secret, sy_url, sy_shop_id, status, create_by, create_time, update_by, update_time, remark from wx_parameter_setting
</sql>
<select id="selectWxParameterSettingList" parameterType="WxParameterSetting" resultMap="WxParameterSettingResult">
<include refid="selectWxParameterSettingVo"/>
<where>
<if test="appid != null and appid != ''"> and appid = #{appid}</if>
<if test="appkey != null and appkey != ''"> and appkey = #{appkey}</if>
<if test="merchantId != null and merchantId != ''"> and merchant_id = #{merchantId}</if>
<if test="merchantApiKey != null and merchantApiKey != ''"> and merchant_api_key = #{merchantApiKey}</if>
<if test="openKey != null and openKey != ''"> and open_key = #{openKey}</if>
<if test="openSecret != null and openSecret != ''"> and open_secret = #{openSecret}</if>
<if test="bindingIp != null and bindingIp != ''"> and binding_ip = #{bindingIp}</if>
<if test="syKey != null and syKey != ''"> and sy_key = #{syKey}</if>
<if test="sySecret != null and sySecret != ''"> and sy_secret = #{sySecret}</if>
<if test="syUrl != null and syUrl != ''"> and sy_url = #{syUrl}</if>
<if test="syShopId != null and syShopId != ''"> and sy_shop_id = #{syShopId}</if>
<if test="status != null "> and status = #{status}</if>
</where>
</select>
<select id="selectWxParameterSettingById" parameterType="Long" resultMap="WxParameterSettingResult">
<include refid="selectWxParameterSettingVo"/>
where id = #{id}
</select>
<insert id="insertWxParameterSetting" parameterType="WxParameterSetting">
insert into wx_parameter_setting
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="appid != null">appid,</if>
<if test="appkey != null">appkey,</if>
<if test="merchantId != null">merchant_id,</if>
<if test="merchantApiKey != null">merchant_api_key,</if>
<if test="openKey != null">open_key,</if>
<if test="openSecret != null">open_secret,</if>
<if test="bindingIp != null">binding_ip,</if>
<if test="syKey != null">sy_key,</if>
<if test="sySecret != null">sy_secret,</if>
<if test="syUrl != null">sy_url,</if>
<if test="syShopId != null">sy_shop_id,</if>
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="appid != null">#{appid},</if>
<if test="appkey != null">#{appkey},</if>
<if test="merchantId != null">#{merchantId},</if>
<if test="merchantApiKey != null">#{merchantApiKey},</if>
<if test="openKey != null">#{openKey},</if>
<if test="openSecret != null">#{openSecret},</if>
<if test="bindingIp != null">#{bindingIp},</if>
<if test="syKey != null">#{syKey},</if>
<if test="sySecret != null">#{sySecret},</if>
<if test="syUrl != null">#{syUrl},</if>
<if test="syShopId != null">#{syShopId},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateWxParameterSetting" parameterType="WxParameterSetting">
update wx_parameter_setting
<trim prefix="SET" suffixOverrides=",">
<if test="appid != null">appid = #{appid},</if>
<if test="appkey != null">appkey = #{appkey},</if>
<if test="merchantId != null">merchant_id = #{merchantId},</if>
<if test="merchantApiKey != null">merchant_api_key = #{merchantApiKey},</if>
<if test="openKey != null">open_key = #{openKey},</if>
<if test="openSecret != null">open_secret = #{openSecret},</if>
<if test="bindingIp != null">binding_ip = #{bindingIp},</if>
<if test="syKey != null">sy_key = #{syKey},</if>
<if test="sySecret != null">sy_secret = #{sySecret},</if>
<if test="syUrl != null">sy_url = #{syUrl},</if>
<if test="syShopId != null">sy_shop_id = #{syShopId},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWxParameterSettingById" parameterType="Long">
delete from wx_parameter_setting where id = #{id}
</delete>
<delete id="deleteWxParameterSettingByIds" parameterType="String">
delete from wx_parameter_setting where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -14,16 +14,6 @@ import org.springframework.context.annotation.Configuration;
@ConfigurationProperties(prefix = "wx.config")
public class WxConfig {
/**
* appid
*/
private String appId;
/**
* appkey
*/
private String appKey;
/**
* jscode2session
* code openid session_key
@ -35,22 +25,6 @@ public class WxConfig {
*/
private String obtainPhoneUrl;
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
public String getAppKey() {
return appKey;
}
public void setAppKey(String appKey) {
this.appKey = appKey;
}
public String getLoginUrl() {
return loginUrl;
}

@ -1,11 +1,14 @@
package com.flossom.miniProgram.utils;
import com.flossom.common.core.domain.entity.WxParameterSetting;
import com.flossom.hzMapper.mapper.WxParameterSettingMapper;
import com.flossom.miniProgram.config.properties.WxConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -16,13 +19,30 @@ public class MiniProgramUtils {
private static WxConfig wxConfig;
private static WxParameterSettingMapper wxParameterSettingMapper;
/**
* mapper appIdappKey
* @param wxParameterSettingMapper
*/
@Autowired
public void setWxConfig(WxParameterSettingMapper wxParameterSettingMapper) {
MiniProgramUtils.wxParameterSettingMapper = wxParameterSettingMapper;
}
/**
* nacos
* @param wxConfig
*/
@Autowired
public void setWxConfig(WxConfig wxConfig) {
MiniProgramUtils.wxConfig = wxConfig;
}
public static String getSessionKeyAndOpenId(String jsCode) throws Exception {
return getSessionKeyAndOpenId(wxConfig.getAppId(), wxConfig.getAppKey(), jsCode, "authorization_code");
WxParameterSetting wxParameterSetting = wxParameterSettingMapper.selectWxParameterSettingById(1L);
return getSessionKeyAndOpenId(wxParameterSetting.getAppid(), wxParameterSetting.getAppkey(), jsCode, "authorization_code");
}
/**

@ -0,0 +1,99 @@
package com.flossom.system.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.flossom.common.core.domain.entity.WxParameterSetting;
import com.flossom.common.core.utils.poi.ExcelUtil;
import com.flossom.common.core.web.controller.BaseController;
import com.flossom.common.core.web.domain.AjaxResult;
import com.flossom.common.core.web.page.TableDataInfo;
import com.flossom.common.log.annotation.Log;
import com.flossom.common.log.enums.BusinessType;
import com.flossom.common.security.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.flossom.system.service.IWxParameterSettingService;
/**
* Controller
*
* @author flossom
* @date 2023-12-13
*/
@RestController
@RequestMapping("/wxSetting")
public class WxParameterSettingController extends BaseController {
@Autowired
private IWxParameterSettingService wxParameterSettingService;
/**
*
*/
@RequiresPermissions("system:wxSetting:list")
@GetMapping("/list")
public TableDataInfo list(WxParameterSetting wxParameterSetting) {
startPage();
List<WxParameterSetting> list = wxParameterSettingService.selectWxParameterSettingList(wxParameterSetting);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("system:wxSetting:export")
@Log(title = "微信参数配属", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WxParameterSetting wxParameterSetting) {
List<WxParameterSetting> list = wxParameterSettingService.selectWxParameterSettingList(wxParameterSetting);
ExcelUtil<WxParameterSetting> util = new ExcelUtil<WxParameterSetting>(WxParameterSetting.class);
util.exportExcel(response, list, "微信参数配属数据");
}
/**
*
*/
@RequiresPermissions("system:wxSetting:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(wxParameterSettingService.selectWxParameterSettingById(id));
}
/**
*
*/
@RequiresPermissions("system:wxSetting:add")
@Log(title = "微信参数配属", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WxParameterSetting wxParameterSetting) {
return toAjax(wxParameterSettingService.insertWxParameterSetting(wxParameterSetting));
}
/**
*
*/
@RequiresPermissions("system:wxSetting:edit")
@Log(title = "微信参数配属", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WxParameterSetting wxParameterSetting) {
return toAjax(wxParameterSettingService.updateWxParameterSetting(wxParameterSetting));
}
/**
*
*/
@RequiresPermissions("system:wxSetting:remove")
@Log(title = "微信参数配属", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(wxParameterSettingService.deleteWxParameterSettingByIds(ids));
}
}

@ -0,0 +1,61 @@
package com.flossom.system.service;
import com.flossom.common.core.domain.entity.WxParameterSetting;
import java.util.List;
/**
* Service
*
* @author flossom
* @date 2023-12-13
*/
public interface IWxParameterSettingService {
/**
*
*
* @param id
* @return
*/
public WxParameterSetting selectWxParameterSettingById(Long id);
/**
*
*
* @param wxParameterSetting
* @return
*/
public List<WxParameterSetting> selectWxParameterSettingList(WxParameterSetting wxParameterSetting);
/**
*
*
* @param wxParameterSetting
* @return
*/
public int insertWxParameterSetting(WxParameterSetting wxParameterSetting);
/**
*
*
* @param wxParameterSetting
* @return
*/
public int updateWxParameterSetting(WxParameterSetting wxParameterSetting);
/**
*
*
* @param ids
* @return
*/
public int deleteWxParameterSettingByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteWxParameterSettingById(Long id);
}

@ -0,0 +1,90 @@
package com.flossom.system.service.impl;
import java.util.List;
import com.flossom.common.core.domain.entity.WxParameterSetting;
import com.flossom.common.core.utils.DateUtils;
import com.flossom.hzMapper.mapper.WxParameterSettingMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.flossom.system.service.IWxParameterSettingService;
/**
* Service
*
* @author flossom
* @date 2023-12-13
*/
@Service
public class WxParameterSettingServiceImpl implements IWxParameterSettingService {
@Autowired
private WxParameterSettingMapper wxParameterSettingMapper;
/**
*
*
* @param id
* @return
*/
@Override
public WxParameterSetting selectWxParameterSettingById(Long id) {
return wxParameterSettingMapper.selectWxParameterSettingById(id);
}
/**
*
*
* @param wxParameterSetting
* @return
*/
@Override
public List<WxParameterSetting> selectWxParameterSettingList(WxParameterSetting wxParameterSetting) {
return wxParameterSettingMapper.selectWxParameterSettingList(wxParameterSetting);
}
/**
*
*
* @param wxParameterSetting
* @return
*/
@Override
public int insertWxParameterSetting(WxParameterSetting wxParameterSetting) {
wxParameterSetting.setCreateTime(DateUtils.getNowDate());
return wxParameterSettingMapper.insertWxParameterSetting(wxParameterSetting);
}
/**
*
*
* @param wxParameterSetting
* @return
*/
@Override
public int updateWxParameterSetting(WxParameterSetting wxParameterSetting) {
wxParameterSetting.setUpdateTime(DateUtils.getNowDate());
return wxParameterSettingMapper.updateWxParameterSetting(wxParameterSetting);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteWxParameterSettingByIds(Long[] ids) {
return wxParameterSettingMapper.deleteWxParameterSettingByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteWxParameterSettingById(Long id) {
return wxParameterSettingMapper.deleteWxParameterSettingById(id);
}
}

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询微信参数配属列表
export function listWxSetting(query) {
return request({
url: '/system/wxSetting/list',
method: 'get',
params: query
})
}
// 查询微信参数配属详细
export function getWxSetting(id) {
return request({
url: '/system/wxSetting/' + id,
method: 'get'
})
}
// 新增微信参数配属
export function addWxSetting(data) {
return request({
url: '/system/wxSetting',
method: 'post',
data: data
})
}
// 修改微信参数配属
export function updateWxSetting(data) {
return request({
url: '/system/wxSetting',
method: 'put',
data: data
})
}
// 删除微信参数配属
export function delWxSetting(id) {
return request({
url: '/system/wxSetting/' + id,
method: 'delete'
})
}

@ -0,0 +1,397 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<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 label="小程序密钥" prop="appkey">
<el-input
v-model="queryParams.appkey"
placeholder="请输入小程序密钥"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="商户号" prop="merchantId">
<el-input
v-model="queryParams.merchantId"
placeholder="请输入商户号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="商户号API密钥" prop="merchantApiKey">
<el-input
v-model="queryParams.merchantApiKey"
placeholder="请输入商户号API密钥"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="开放key(32位)" prop="openKey">
<el-input
v-model="queryParams.openKey"
placeholder="请输入开放key(32位)"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="开放密钥(64位)" prop="openSecret">
<el-input
v-model="queryParams.openSecret"
placeholder="请输入开放密钥(64位)"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="绑定ip多个ip““分割" prop="bindingIp">
<el-input
v-model="queryParams.bindingIp"
placeholder="请输入绑定ip多个ip““分割"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="数云key" prop="syKey">
<el-input
v-model="queryParams.syKey"
placeholder="请输入数云key"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="数云密钥" prop="sySecret">
<el-input
v-model="queryParams.sySecret"
placeholder="请输入数云密钥"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="数云请求地址" prop="syUrl">
<el-input
v-model="queryParams.syUrl"
placeholder="请输入数云请求地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="数云店铺id" prop="syShopId">
<el-input
v-model="queryParams.syShopId"
placeholder="请输入数云店铺id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<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="['system:wxSetting:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:wxSetting:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:wxSetting:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:wxSetting:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="wxSettingList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="小程序appid" align="center" prop="appid" />
<el-table-column label="小程序密钥" align="center" prop="appkey" />
<el-table-column label="商户号" align="center" prop="merchantId" />
<el-table-column label="商户号API密钥" align="center" prop="merchantApiKey" />
<el-table-column label="开放key(32位)" align="center" prop="openKey" />
<el-table-column label="开放密钥(64位)" align="center" prop="openSecret" />
<el-table-column label="绑定ip多个ip““分割" align="center" prop="bindingIp" />
<el-table-column label="数云key" align="center" prop="syKey" />
<el-table-column label="数云密钥" align="center" prop="sySecret" />
<el-table-column label="数云请求地址" align="center" prop="syUrl" />
<el-table-column label="数云店铺id" align="center" prop="syShopId" />
<el-table-column label="状态" align="center" prop="status" />
<el-table-column label="备注" align="center" prop="remark" />
<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="['system:wxSetting:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:wxSetting:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改微信参数配属对话框 -->
<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="小程序appid" prop="appid">
<el-input v-model="form.appid" placeholder="请输入小程序appid" />
</el-form-item>
<el-form-item label="小程序密钥" prop="appkey">
<el-input v-model="form.appkey" placeholder="请输入小程序密钥" />
</el-form-item>
<el-form-item label="商户号" prop="merchantId">
<el-input v-model="form.merchantId" placeholder="请输入商户号" />
</el-form-item>
<el-form-item label="商户号API密钥" prop="merchantApiKey">
<el-input v-model="form.merchantApiKey" placeholder="请输入商户号API密钥" />
</el-form-item>
<el-form-item label="开放key(32位)" prop="openKey">
<el-input v-model="form.openKey" placeholder="请输入开放key(32位)" />
</el-form-item>
<el-form-item label="开放密钥(64位)" prop="openSecret">
<el-input v-model="form.openSecret" placeholder="请输入开放密钥(64位)" />
</el-form-item>
<el-form-item label="绑定ip多个ip““分割" prop="bindingIp">
<el-input v-model="form.bindingIp" placeholder="请输入绑定ip多个ip““分割" />
</el-form-item>
<el-form-item label="数云key" prop="syKey">
<el-input v-model="form.syKey" placeholder="请输入数云key" />
</el-form-item>
<el-form-item label="数云密钥" prop="sySecret">
<el-input v-model="form.sySecret" placeholder="请输入数云密钥" />
</el-form-item>
<el-form-item label="数云请求地址" prop="syUrl">
<el-input v-model="form.syUrl" placeholder="请输入数云请求地址" />
</el-form-item>
<el-form-item label="数云店铺id" prop="syShopId">
<el-input v-model="form.syShopId" placeholder="请输入数云店铺id" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listWxSetting, getWxSetting, delWxSetting, addWxSetting, updateWxSetting } from "@/api/system/wxSetting";
export default {
name: "WxSetting",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
wxSettingList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
appid: null,
appkey: null,
merchantId: null,
merchantApiKey: null,
openKey: null,
openSecret: null,
bindingIp: null,
syKey: null,
sySecret: null,
syUrl: null,
syShopId: null,
status: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询微信参数配属列表 */
getList() {
this.loading = true;
listWxSetting(this.queryParams).then(response => {
this.wxSettingList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
appid: null,
appkey: null,
merchantId: null,
merchantApiKey: null,
openKey: null,
openSecret: null,
bindingIp: null,
syKey: null,
sySecret: null,
syUrl: null,
syShopId: null,
status: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加微信参数配属";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getWxSetting(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改微信参数配属";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateWxSetting(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addWxSetting(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除微信参数配属编号为"' + ids + '"的数据项?').then(function() {
return delWxSetting(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/wxSetting/export', {
...this.queryParams
}, `wxSetting_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save