Commit 78906110 authored by zhangjianguo's avatar zhangjianguo

基础配置的修改

parent ba5c2e24
......@@ -49,19 +49,36 @@
<el-input v-else type="text" size="small" maxlength="200" v-model="appConfig.WeChatApiSecret">
</el-input>
</el-form-item>
<el-form-item label="微信支付apiclient_cert.pem" size="small">
<el-input v-if="isShowClientOne" type="textarea" @focus="isShowClientOne=false" :rows="5" size="small" placeholder="已隐藏内容,点击查看或编辑">
</el-input>
<el-input v-else type="textarea" :rows="5" size="small" maxlength="1000"
v-model="appConfig.WeChatPayCertificate">
</el-input>
</el-form-item>
<el-form-item label="微信支付apiclient_key.pem" size="small">
<el-input v-if="isShowClientTwo" type="textarea" @focus="isShowClientTwo=false" :rows="5" size="small" placeholder="已隐藏内容,点击查看或编辑">
</el-input>
<el-input v-else type="textarea" :rows="5" size="small" maxlength="1000"
v-model="appConfig.WeChatPayPrivateKey">
</el-input>
<!--<el-form-item label="微信支付apiclient_cert.pem" size="small">-->
<!--<el-input v-if="isShowClientOne" type="textarea" @focus="isShowClientOne=false" :rows="5" size="small" placeholder="已隐藏内容,点击查看或编辑">-->
<!--</el-input>-->
<!--<el-input v-else type="textarea" :rows="5" size="small" maxlength="1000"-->
<!--v-model="appConfig.WeChatPayCertificate">-->
<!--</el-input>-->
<!--</el-form-item>-->
<!--<el-form-item label="微信支付apiclient_key.pem" size="small">-->
<!--<el-input v-if="isShowClientTwo" type="textarea" @focus="isShowClientTwo=false" :rows="5" size="small" placeholder="已隐藏内容,点击查看或编辑">-->
<!--</el-input>-->
<!--<el-input v-else type="textarea" :rows="5" size="small" maxlength="1000"-->
<!--v-model="appConfig.WeChatPayPrivateKey">-->
<!--</el-input>-->
<!--</el-form-item>-->
<el-form-item label="微信支付证书" prop="WeChatPayCertificateUrl" size="small">
<template>
<el-upload
class="upload-demo"
action=""
:http-request="UploadImage"
:file-list="fileList"
accept='doc,.docx,.xlsx,.xls,.pdf,.pem,.p12'
:on-change="handleChange"
:on-remove="handleRemove"
>
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</template>
</el-form-item>
</el-form>
</div>
......@@ -90,7 +107,9 @@
WeChatApiSecret: "", //微信支付Api密钥
WeChatPayCertificate: "", //微信支付证书
WeChatPayPrivateKey: "", //微信支付私钥
WeChatPayCertificateUrl:'',//微信支付证书
},
fileList:[],
rules: {
MiniAppId: [{
required: true,
......@@ -111,6 +130,11 @@
required: true,
message: "请输入key",
trigger: "blur"
}],
WeChatPayCertificateUrl: [{
required: true,
message: "请上传微信支付证书",
trigger: "blur"
}]
}
};
......@@ -121,6 +145,7 @@
methods: {
//版权信息
GetWeiXinAppConfig() {
this.fileList=[];
this.appConfig.MallBaseId = this.getLocalStorage().MallBaseId;
this.apipost("/api/Tenant/GetMiniPrograme", {
MallBaseId: this.appConfig.MallBaseId,
......@@ -133,6 +158,11 @@
this.appConfig.WeChatApiSecret = res.data.data.WeChatApiSecret;
this.appConfig.WeChatPayCertificate = res.data.data.WeChatPayCertificate;
this.appConfig.WeChatPayPrivateKey = res.data.data.WeChatPayPrivateKey;
this.appConfig.WeChatPayCertificateUrl = res.data.data.WeChatPayCertificateUrl;
this.fileList.push({
name:res.data.data.WeChatPayCertificateUrl.split('com')[1],
url:res.data.data.WeChatPayCertificateUrl,
})
} else {
this.Info(res.data.message);
}
......@@ -150,6 +180,7 @@
},
//修改版权
UpdateAppConfig() {
console.log(this.fileList)
this.apipost("/api/Tenant/SetMiniProgramAppConfig", this.appConfig, res => {
if (res.data.resultCode == 1) {
this.GetWeiXinAppConfig();
......@@ -159,10 +190,33 @@
}
})
},
UploadImage(file){
this.UploadFileToTencent(this.FileType().GoodsImg, file.file, res => {
if (res.resultCode == 1) {
this.appConfig.WeChatPayCertificateUrl = res.FileUrl;
this.fileList.push({
name:res.FileName,
url:res.FileUrl,
})
}
})
},
handleChange(file, fileList) {
this.fileList = this.fileList.slice(1);
},
handleRemove(file, fileList) {
this.fileList = fileList;
if(this.fileList.length==0){
this.appConfig.WeChatPayCertificateUrl='';
}
},
},
mounted() {
this.GetWeiXinAppConfig();
}
},
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment