Commit 3d096c6a authored by zhangjianguo's avatar zhangjianguo

小程序配置修改

parent 7f1b94a7
......@@ -68,12 +68,13 @@
<el-upload
class="upload-demo"
action=""
:http-request="UploadImage"
:file-list="fileList"
accept='doc,.docx,.xlsx,.xls,.pdf,.pem,.p12'
:on-change="handleChange"
:action="importFileUrl"
:multiple="false"
:on-success="successUpload"
:file-list="fileList"
:on-remove="handleRemove"
>
<el-button size="small" type="primary">点击上传</el-button>
......@@ -108,8 +109,11 @@
WeChatPayCertificate: "", //微信支付证书
WeChatPayPrivateKey: "", //微信支付私钥
WeChatPayCertificateUrl:'',//微信支付证书
},
fileList:[],
importFileUrl: this.domainManager().UploadBlob,
rules: {
MiniAppId: [{
required: true,
......@@ -158,11 +162,14 @@
this.appConfig.WeChatApiSecret = res.data.data.WeChatApiSecret;
this.appConfig.WeChatPayCertificate = res.data.data.WeChatPayCertificate;
this.appConfig.WeChatPayPrivateKey = res.data.data.WeChatPayPrivateKey;
if(res.data.data.WeChatPayCertificateUrl!=null){
this.appConfig.WeChatPayCertificateUrl = res.data.data.WeChatPayCertificateUrl;
this.fileList.push({
name:res.data.data.WeChatPayCertificateUrl.split('com')[1],
name:res.data.data.WeChatPayCertificateUrl,
url:res.data.data.WeChatPayCertificateUrl,
})
}
} else {
this.Info(res.data.message);
}
......@@ -189,21 +196,14 @@
}
})
},
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,
})
}
successUpload(file){
let list = [];
list.push({
name:file.data.Path.split('WeChatApp')[1].replace(/[\\]/g, ''),
url:file.data.Path.split('WeChatApp')[1].replace(/[\\]/g, ''),
})
},
handleChange(file, fileList) {
this.fileList = this.fileList.slice(1);
this.fileList = list;
this.appConfig.WeChatPayCertificateUrl = file.data.Path.split('WeChatApp')[1].replace(/[\\]/g, '')
},
handleRemove(file, fileList) {
this.fileList = fileList;
......
......@@ -54,7 +54,8 @@ export default {
//域名管理对象
Vue.prototype.domainManager = function () {
let domainUrl = '';
//domainUrl = "http://192.168.2.214:8200";
//domainUrl = "http://192.168.2.214:8200"
// domainUrl = "http://192.168.2.65";
// domainUrl = "https://localhost:5001";
domainUrl = "http://mallapi.oytour.com";
......@@ -70,7 +71,9 @@ export default {
//常用提交数据URL
PostUrl: domainUrl + "/api/common/post",
ImageUrl: 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com',
UploadFileUrl:domainUrl + '/api/File/LocalFileUploadImport'
UploadFileUrl:domainUrl + '/api/File/LocalFileUploadImport',
UploadBlob:domainUrl + '/api/File/UploadBlob',
};
return obj;
},
......
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