1976 行
101 KiB
HTML
可执行文件
1976 行
101 KiB
HTML
可执行文件
<!--[1.9.5]-->
|
||
<style>
|
||
.long {
|
||
display: flex;
|
||
}
|
||
|
||
.long .el-input {
|
||
flex: 1;
|
||
}
|
||
|
||
.content-list-btn {
|
||
margin-left: 10px;
|
||
}
|
||
|
||
.content-list-btn .el-button--mini, .el-button--mini.is-round {
|
||
padding: 5px 10px;
|
||
font-size: 12px;
|
||
}
|
||
|
||
#configApp .el-tabs--top {
|
||
margin-bottom: 10px;
|
||
}
|
||
|
||
#configApp .el-alert {
|
||
padding: 0 16px;
|
||
}
|
||
|
||
.el-link--inner {
|
||
line-height: 16px;
|
||
}
|
||
|
||
#configApp .el-input {
|
||
max-width: 700px;
|
||
}
|
||
|
||
#configApp .el-button--mini.is-circle {
|
||
padding: 5px;
|
||
}
|
||
|
||
#configApp .el-textarea__inner {
|
||
min-height: 100px !important;
|
||
}
|
||
|
||
.code-box {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
</style>
|
||
<div id="configApp" v-cloak>
|
||
<el-tabs tab-position="left" v-model="active_config_index" @tab-click="clickTabs(active_config_index)">
|
||
<el-tab-pane name="1" label="微信开放平台配置">
|
||
<el-tabs type="border-card">
|
||
<el-tab-pane label="微信开放平台配置">
|
||
<el-form label-width="180px">
|
||
<el-form-item label="开放平台APPID">
|
||
<el-input size="small" type="text" v-model="wxConfig.appid"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="开放平台AppSecret">
|
||
<el-input size="small" type="text" v-model="wxConfig.appsecret"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="消息校验Token">
|
||
<el-input size="small" type="text" v-model="wxConfig.token"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="消息加解密Key">
|
||
<el-input size="small" type="text" v-model="wxConfig.encodingaeskey"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="注意事项">
|
||
<el-alert title="1. 确认保存完毕后,请在十分钟左右后开始检测问题" type="warning" show-icon
|
||
:closable="false"></el-alert>
|
||
<el-alert title="2. 网站请不要强制开起https,避免授权后页面不跳转" type="warning" show-icon
|
||
:closable="false"></el-alert>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div class="center">
|
||
<template
|
||
v-if="wxConfig.appid != null && wxConfig.appsecret != null && wxConfig.token != null && wxConfig.encodingaeskey != null">
|
||
<el-button size="small" @click="checkWxConfig">检查问题</el-button>
|
||
</template>
|
||
<if condition="$authArr['setConfig'] eq true">
|
||
<el-button type="primary" size="small" @click="saveWxConfig">确认保存</el-button>
|
||
</if>
|
||
</div>
|
||
</el-tab-pane>
|
||
</el-tabs>
|
||
<el-tabs type="border-card">
|
||
<el-tab-pane label="微信开放平台接入配置项">
|
||
<el-form label-width="180px">
|
||
<el-form-item label="登录授权的发起页域名">
|
||
<div class="long">
|
||
<el-input readonly ref="url_name" size="small" type="text"
|
||
v-model="wxConfig.url_name"></el-input>
|
||
<div class="content-list-btn">
|
||
<el-button round size="mini" @click="copyUrl('url_name')">点击复制</el-button>
|
||
</div>
|
||
</div>
|
||
</el-form-item>
|
||
<el-form-item label="授权事件接受URL">
|
||
<div class="long">
|
||
<el-input readonly ref="auth_name" size="small" type="text"
|
||
v-model="wxConfig.auth_name"></el-input>
|
||
<div class="content-list-btn">
|
||
<el-button round size="mini" @click="copyUrl('auth_name')">点击复制</el-button>
|
||
</div>
|
||
</div>
|
||
</el-form-item>
|
||
<el-form-item label="公众号消息与事件接受URL">
|
||
<div class="long">
|
||
<el-input readonly ref="notify_url" size="small" type="text"
|
||
v-model="wxConfig.notify_url"></el-input>
|
||
<div class="content-list-btn">
|
||
<el-button round size="mini" @click="copyUrl('notify_url')">点击复制</el-button>
|
||
</div>
|
||
</div>
|
||
</el-form-item>
|
||
<el-form-item label="网页开发域名">
|
||
<div class="long">
|
||
<el-input readonly ref="url_name1" size="small" type="text"
|
||
v-model="wxConfig.url_name"></el-input>
|
||
<div class="content-list-btn">
|
||
<el-button round size="mini" @click="copyUrl('url_name1')">点击复制</el-button>
|
||
</div>
|
||
</div>
|
||
</el-form-item>
|
||
</el-form>
|
||
</el-tab-pane>
|
||
</el-tabs>
|
||
</el-tab-pane>
|
||
<el-tab-pane name="2" label="小程序配置">
|
||
<el-tabs type="border-card">
|
||
<el-tab-pane label="小程序配置">
|
||
<el-form label-width="180px">
|
||
<el-form-item label="服务器域名">
|
||
<el-input size="small" type="text" v-model="wxConfig.server"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="小程序业务域名">
|
||
<el-input size="small" type="text" v-model="wxConfig.business"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="小程序版本号">
|
||
<el-input size="small" type="text" v-model="wxConfig.version"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="小程序简介">
|
||
<el-input size="small" type="textarea" v-model="wxConfig.information"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="小程序标签">
|
||
<el-input size="small" type="textarea" v-model="wxConfig.tag"></el-input>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div class="center">
|
||
<if condition="$authArr['urgentAudit'] eq true">
|
||
<el-button size="small" @click="urgentAudit">商城小程序加急审核</el-button>
|
||
</if>
|
||
<if condition="$authArr['xcxtemplate'] eq true">
|
||
<el-button size="small" @click="chooseProgram">选择商城小程序模板</el-button>
|
||
</if>
|
||
<if condition="$authArr['setProgram'] eq true">
|
||
<el-button type="primary" size="small" @click="saveXcxConfig">确认保存</el-button>
|
||
</if>
|
||
</div>
|
||
</el-tab-pane>
|
||
</el-tabs>
|
||
</el-tab-pane>
|
||
<el-tab-pane name="3" label="服务商配置">
|
||
<el-tabs type="border-card">
|
||
<el-tab-pane label="微信服务商配置">
|
||
<el-form label-width="180px">
|
||
<el-form-item label="服务商公众号AppID">
|
||
<el-input size="small" type="text" v-model="serverConfig.wx_appid"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="服务商后台的api秘钥">
|
||
<el-input size="small" type="text" v-model="serverConfig.wx_key"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="微信服务商商户号">
|
||
<el-input size="small" type="text" v-model="serverConfig.mch_id"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="微信服务商商户Api证书序列号">
|
||
<el-input size="small" type="text" v-model="serverConfig.wx_serial_no"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="APICLIENT_CERT证书">
|
||
<div class="long">
|
||
<el-input readonly placeholder="APICLIENT_CERT证书" type="text" size="small"
|
||
v-model="serverConfig.wx_apiclient_cert"></el-input>
|
||
<div class="content-list-btn">
|
||
<el-upload
|
||
action="{:U('upload')}"
|
||
class="upload-demo"
|
||
:on-success="uploadFileSuccess"
|
||
:on-error="uploadFileError"
|
||
:limit="1"
|
||
:data="{type:1}"
|
||
:show-file-list="false"
|
||
accept="pem">
|
||
<el-button size="small">点击上传</el-button>
|
||
</el-upload>
|
||
</div>
|
||
</div>
|
||
</el-form-item>
|
||
<el-form-item label="APICLIENT_KEY证书">
|
||
<div class="long">
|
||
<el-input readonly placeholder="APICLIENT_KEY证书" type="text" size="small"
|
||
v-model="serverConfig.wx_apiclient_key"></el-input>
|
||
<div class="content-list-btn">
|
||
<el-upload
|
||
action="{:U('upload')}"
|
||
class="upload-demo"
|
||
:on-success="uploadFileSuccess"
|
||
:on-error="uploadFileError"
|
||
:limit="1"
|
||
:data="{type:2}"
|
||
:show-file-list="false"
|
||
accept="pem">
|
||
<el-button size="small">点击上传</el-button>
|
||
</el-upload>
|
||
</div>
|
||
</div>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div class="center">
|
||
<if condition="$authArr['wx_agentconf'] eq true">
|
||
<el-button type="primary" size="small" @click="saveServerWx()">修改配置</el-button>
|
||
</if>
|
||
</div>
|
||
</el-tab-pane>
|
||
|
||
<el-tab-pane label="支付宝服务商配置">
|
||
<el-form label-width="180px">
|
||
<el-form-item label="AppID">
|
||
<el-input size="small" type="text" v-model="serverConfig.alipay_appid"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="支付宝Pid">
|
||
<el-input size="small" type="text" v-model="serverConfig.alipay_pid"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="支付宝公钥">
|
||
<el-input min-height="100px" size="small" type="textarea"
|
||
v-model="serverConfig.alipay_public_key"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="应用私钥">
|
||
<el-input size="small" type="textarea" v-model="serverConfig.alipay_private_key"></el-input>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div class="center">
|
||
<if condition="$authArr['ali_agentconf'] eq true">
|
||
<el-button type="primary" size="small" @click="saveServerAliPay()">修改配置</el-button>
|
||
</if>
|
||
</div>
|
||
</el-tab-pane>
|
||
|
||
<el-tab-pane label="新大陆支付配置">
|
||
<el-form label-width="180px">
|
||
<el-form-item label="新大陆服务商机构号">
|
||
<el-input size="small" type="text" v-model="continent.continent_number"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="新大陆服务商费率">
|
||
<el-input size="small" type="text" v-model="continent.partner_rate"
|
||
placeholder="费率以(%)为单位,请填写如(0.27)"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="新大陆机构秘钥">
|
||
<el-input size="small" type="text" v-model="continent.continent_pay_secret_key"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="新大陆md5秘钥">
|
||
<el-input size="small" type="text"
|
||
v-model="continent.continent_callback_secret_key"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="新大陆pem证书">
|
||
<div class="long">
|
||
<el-input readonly placeholder="新大陆pem证书" type="text" size="small"
|
||
v-model="continent.continent_credential"></el-input>
|
||
<div class="content-list-btn">
|
||
<el-upload
|
||
action="{:U('upload')}"
|
||
class="upload-demo"
|
||
:on-success="uploadFileSuccess"
|
||
:on-error="uploadFileError"
|
||
:limit="1"
|
||
:data="{type:3}"
|
||
:show-file-list="false"
|
||
accept="pem">
|
||
<el-button size="small">点击上传</el-button>
|
||
</el-upload>
|
||
</div>
|
||
</div>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div class="center">
|
||
<if condition="$authArr['continent_conf'] eq true">
|
||
<el-button type="primary" size="small" @click="saveServerNew()">修改配置</el-button>
|
||
</if>
|
||
</div>
|
||
<el-card class="box-card" shadow="never" style="margin-top: 20px" body-style="{ padding: '0px' }">
|
||
<div slot="header" class="clearfix">
|
||
<span>新大陆支付多域名回调配置</span>
|
||
</div>
|
||
<div>
|
||
<el-alert style="line-height: 40px;margin-left: 180px;width: auto;"
|
||
title="请填写完整的域名,如:http://retail.mobzhifu.com/index.php/Pay/PayContinent/notify"
|
||
type="info"
|
||
:closable="false"></el-alert>
|
||
<el-alert style="line-height: 40px;margin-left: 180px;width: auto;"
|
||
title="最多只能添加10个回调域名,请不要添加错误的域名,避免发生未知的错误" type="info"
|
||
:closable="false"></el-alert>
|
||
<el-form label-width="180px">
|
||
<el-form-item v-if="!continentNotify.length">
|
||
<el-button size="mini"
|
||
type="primary"
|
||
plain
|
||
style="margin-left: 15px;"
|
||
circle
|
||
icon="el-icon-plus"
|
||
:disabled="continentNotify.length>=10?true:false"
|
||
@click="addNotify"></el-button>
|
||
</el-form-item>
|
||
<template v-for="(item,index) in continentNotify">
|
||
<el-form-item>
|
||
<div slot="label">
|
||
<el-input size="mini" type="text" maxLength="20"
|
||
:placeholder="'域名 '+(index+1)"
|
||
v-model="item.name"></el-input>
|
||
</div>
|
||
<div class="long">
|
||
<el-input size="small" type="text" v-model="item.url"
|
||
placeholder="如:http://retail.mobzhifu.com/index.php/Pay/PayContinent/notify"></el-input>
|
||
<div class="content-list-btn">
|
||
<el-button size="mini" circle icon="el-icon-minus"
|
||
@click="delNotify(index)"></el-button>
|
||
<el-button size="mini"
|
||
type="primary"
|
||
plain
|
||
style="margin-left: 15px;"
|
||
circle
|
||
icon="el-icon-plus"
|
||
v-if="index == continentNotify.length-1"
|
||
:disabled="continentNotify.length>=10?true:false"
|
||
@click="addNotify"></el-button>
|
||
</div>
|
||
</div>
|
||
</el-form-item>
|
||
</template>
|
||
</el-form>
|
||
<div class="center">
|
||
<if condition="$authArr['continent_conf'] eq true">
|
||
<el-button :disabled="continentNotify.length>10||!continentNotify.length?true:false"
|
||
type="primary" size="small" @click="saveContinentNotify()">保存
|
||
</el-button>
|
||
</if>
|
||
</div>
|
||
</div>
|
||
</el-card>
|
||
</el-tab-pane>
|
||
|
||
<el-tab-pane label="云闪付支付配置">
|
||
<el-form label-width="180px">
|
||
<el-form-item label="云闪付服务商ID" required>
|
||
<el-input size="small" type="text" v-model="serverConfig.serprovid"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="云闪付机构代码" required>
|
||
<el-input size="small" type="text" v-model="serverConfig.acqcode"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="云闪付私钥解密密码" required>
|
||
<el-input size="small" type="text" v-model="serverConfig.prodkey"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="云闪付cer生产证书" required>
|
||
<div class="long">
|
||
<el-input readonly placeholder="云闪付cer证书" type="text" size="small"
|
||
v-model="serverConfig.pubkey"></el-input>
|
||
<div class="content-list-btn">
|
||
<el-upload
|
||
action="{:U('upload')}"
|
||
class="upload-demo"
|
||
:on-success="uploadFileSuccess"
|
||
:on-error="uploadFileError"
|
||
:limit="1"
|
||
:data="{type:4}"
|
||
:show-file-list="false"
|
||
accept="cer">
|
||
<el-button size="small">点击上传</el-button>
|
||
</el-upload>
|
||
</div>
|
||
</div>
|
||
</el-form-item>
|
||
<el-form-item label="云闪付pfx生产证书" required>
|
||
<div class="long">
|
||
<el-input readonly placeholder="云闪付pfx证书" type="text" size="small"
|
||
v-model="serverConfig.prvkey"></el-input>
|
||
<div class="content-list-btn">
|
||
<el-upload
|
||
action="{:U('upload')}"
|
||
class="upload-demo"
|
||
:on-success="uploadFileSuccess"
|
||
:on-error="uploadFileError"
|
||
:limit="1"
|
||
:data="{type:5}"
|
||
:show-file-list="false"
|
||
accept="pfx">
|
||
<el-button size="small">点击上传</el-button>
|
||
</el-upload>
|
||
</div>
|
||
</div>
|
||
</el-form-item>
|
||
<el-form-item label="云闪付服务商费率">
|
||
<el-input size="small" type="text" v-model="serverConfig.union_pay_rate"
|
||
placeholder="费率以(%)为单位,请填写如(0.27)">
|
||
<template slot="append">%</template>
|
||
</el-input>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div class="center">
|
||
<el-button type="primary" size="small" @click="saveCloudConfig()">修改配置</el-button>
|
||
</div>
|
||
</el-tab-pane>
|
||
|
||
<!-- 乐返支付配置 -->
|
||
<el-tab-pane label="乐返支付配置" v-if="serverConfig.happyPayState">
|
||
<el-form label-width="180px">
|
||
<el-form-item label="乐返支付机构号" required>
|
||
<el-input size="small" type="text" v-model="serverConfig.happy_institution"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="乐返支付私钥" required>
|
||
<el-input size="small" type="text" v-model="serverConfig.happy_prvkey"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="乐返支付公钥" required>
|
||
<el-input size="small" type="text" v-model="serverConfig.happy_pubkey"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="合伙人乐返费率">
|
||
<el-input size="small" type="text" v-model="serverConfig.happy_rate"
|
||
placeholder="费率以(%)为单位,请填写如(0.27)">
|
||
<template slot="append">%</template>
|
||
</el-input>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div class="center">
|
||
<el-button type="primary" size="small" @click="saveHappyRateConfig()">修改配置</el-button>
|
||
</div>
|
||
</el-tab-pane>
|
||
|
||
<!-- 拉卡拉支付配置 -->
|
||
<el-tab-pane label="拉卡拉支付配置" v-if="serverConfig.laKaLaState">
|
||
<el-form label-width="180px">
|
||
<el-form-item label="拉卡拉应用标识appid" required>
|
||
<el-input size="small" type="text" v-model="serverConfig.lakala_appid"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="拉卡拉授权码" required>
|
||
<el-input size="small" type="text" v-model="serverConfig.lakala_token"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="拉卡拉终端号" required>
|
||
<el-input size="small" type="text" v-model="serverConfig.lakala_termid"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="拉卡拉secretKey" required>
|
||
<el-input size="small" type="text" v-model="serverConfig.lakala_secret_key"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="合伙人拉卡拉服务商费率">
|
||
<el-input size="small" type="text" v-model="serverConfig.lakala_rate"
|
||
placeholder="费率以(%)为单位,请填写如(0.27)">
|
||
<template slot="append">%</template>
|
||
</el-input>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div class="center">
|
||
<el-button type="primary" size="small" @click="saveLaKaLaPayConfig()">修改配置</el-button>
|
||
</div>
|
||
</el-tab-pane>
|
||
|
||
<!-- 钱客云支付配置 -->
|
||
<el-tab-pane label="钱客云支付配置" v-if="serverConfig.moneyGuestState">
|
||
<el-form label-width="180px">
|
||
<el-form-item label="合伙人钱客云服务商费率">
|
||
<el-input size="small" type="text" v-model="serverConfig.qian_ke_rate"
|
||
placeholder="费率以(%)为单位,请填写如(0.27)">
|
||
<template slot="append">%</template>
|
||
</el-input>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div class="center">
|
||
<el-button type="primary" size="small" @click="saveQianKeYunPayConfig()">修改配置</el-button>
|
||
</div>
|
||
</el-tab-pane>
|
||
|
||
</el-tabs>
|
||
</el-tab-pane>
|
||
<el-tab-pane name="4" label="短信配置">
|
||
<el-tabs type="border-card">
|
||
<el-tab-pane label="短信配置">
|
||
<el-form label-width="180px">
|
||
<el-form-item label="阿里大鱼accessKeyId">
|
||
<el-input size="small" type="text" v-model="mapConfig.accesskeyid"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="阿里大鱼密钥">
|
||
<el-input size="small" type="text" v-model="mapConfig.accesskeysecret"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="阿里大鱼签名">
|
||
<el-input size="small" type="text" v-model="mapConfig.accessname"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="模板code">
|
||
<el-input size="small" type="text" v-model="mapConfig.accesscode"></el-input>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div class="center">
|
||
<if condition="$authArr['checkSms'] eq true">
|
||
<el-button size="small" @click="checkSms">检测短信</el-button>
|
||
</if>
|
||
<if condition="$authArr['setSms'] eq true">
|
||
<el-button type="primary" size="small" @click="submitSms">保存配置</el-button>
|
||
</if>
|
||
</div>
|
||
</el-tab-pane>
|
||
</el-tabs>
|
||
</el-tab-pane>
|
||
<el-tab-pane name="5" label="地图API配置">
|
||
<el-tabs type="border-card">
|
||
<el-tab-pane label="地图API配置">
|
||
<el-form label-width="180px">
|
||
<el-form-item label="服务端使用地图方式">
|
||
<div>
|
||
<el-radio v-model="mapConfig.server_map_type" label="1">百度地图</el-radio>
|
||
<el-radio v-model="mapConfig.server_map_type" label="2">高德地图</el-radio>
|
||
<el-radio v-model="mapConfig.server_map_type" label="3">腾讯地图</el-radio>
|
||
</div>
|
||
<el-alert title="该选项仅针对服务端获取用户经纬度" type="info"
|
||
:closable="false"></el-alert>
|
||
</el-form-item>
|
||
<el-divider content-position="center">百度地图设置</el-divider>
|
||
<el-form-item label="百度地图浏览器KeyId">
|
||
<el-input size="small" type="text" v-model="mapConfig.baidukeyid"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="百度地图服务端KeyId">
|
||
<el-input size="small" type="text" v-model="mapConfig.serverkeyid"></el-input>
|
||
</el-form-item>
|
||
<el-divider content-position="center">高德地图设置</el-divider>
|
||
<el-form-item label="高德地图key">
|
||
<el-input size="small" type="text" v-model="mapConfig.gould_key"></el-input>
|
||
</el-form-item>
|
||
<el-divider content-position="center">腾讯地图设置</el-divider>
|
||
<el-form-item label="腾讯地图key">
|
||
<el-input size="small" type="text" v-model="mapConfig.tencent_key"></el-input>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div class="center">
|
||
<if condition="$authArr['setSmsone'] eq true">
|
||
<el-button type="primary" size="small" @click="submitMapSet">保存配置</el-button>
|
||
</if>
|
||
</div>
|
||
</el-tab-pane>
|
||
</el-tabs>
|
||
</el-tab-pane>
|
||
<el-tab-pane name="6" label="Redis服务配置">
|
||
<el-tabs type="border-card">
|
||
<el-tab-pane label="Redis服务配置">
|
||
<el-form label-width="180px">
|
||
<el-form-item label="是否开启Redis">
|
||
<el-switch v-model="redis.is_set_redis"
|
||
:active-text="redis.is_set_redis==true?'开启':'关闭'"
|
||
:active-value="true"
|
||
:inactive-value="false">
|
||
</el-switch>
|
||
<el-alert title="服务器必须开启Redis服务,请在服务器启动Redis,未配置将会导致系统异常" type="warning" show-icon
|
||
:closable="false"></el-alert>
|
||
</el-form-item>
|
||
<el-form-item label="Redis IP地址">
|
||
<el-input size="small" type="text" v-model="redis.redis_local"></el-input>
|
||
<el-alert title="一般默认是127.0.0.1,除非redis服务安装在其他服务器" type="info"
|
||
:closable="false"></el-alert>
|
||
</el-form-item>
|
||
<el-form-item label="Redis的连接密码">
|
||
<el-input size="small" show-password placeholder="不设密码则不用填写,默认不设密码" type="text"
|
||
v-model="redis.redis_pass"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="端口号">
|
||
<el-input size="small" type="text" placeholder="建议开启服务器的6379端口"
|
||
v-model="redis.redis_port"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="Redis所使用的第几个库">
|
||
<el-input size="small" type="text" placeholder="请输入所使用的第几个库(默认为0)"
|
||
v-model="redis.redis_number"></el-input>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div class="center">
|
||
<if condition="$authArr['editRedis'] eq true">
|
||
<el-link type="primary"
|
||
href="http://qn.mobzhifu.com/Redis%E9%85%8D%E7%BD%AE%E6%95%99%E7%A8%8B.v2.0.doc">
|
||
下载配置Redis文档教程
|
||
</el-link>
|
||
<el-button size="small" @click="checkRedis">检查问题</el-button>
|
||
<el-button type="primary" size="small" @click="submitRedis">保存配置</el-button>
|
||
</if>
|
||
</div>
|
||
</el-tab-pane>
|
||
</el-tabs>
|
||
</el-tab-pane>
|
||
<el-tab-pane name="7" label="Websocket配置">
|
||
<el-tabs type="border-card">
|
||
<el-tab-pane label="Websocket配置">
|
||
<el-form label-width="180px">
|
||
<el-form-item label="是否开启Websocket">
|
||
<el-switch v-model="websocket.status"
|
||
:active-text="websocket.status==1?'开启':'关闭'"
|
||
active-value="1"
|
||
inactive-value="0">
|
||
</el-switch>
|
||
<el-alert
|
||
title="如果系统没开启websocket服务,请不要开启此选项,可能会造成PC、安卓、自主收银机异常"
|
||
type="warning"
|
||
:closable="false"></el-alert>
|
||
</el-form-item>
|
||
<el-alert style="line-height: 40px;margin-left: 180px;width: auto;"
|
||
title="以下端口号一般请按照建议值填写,建议除非与本服务器的其他项目重复再另行设置其他值,都限制长度4位"
|
||
type="warning"
|
||
:closable="false"></el-alert>
|
||
<el-form-item label="服务器原本的IP地址">
|
||
<el-input size="small" type="text" v-model="websocket.original_ip"></el-input>
|
||
<el-alert title="该参数是为了设置负载均衡或其他访问域名响应的IP地址不是原本的IP地址的服务器所设置,如果属于这种情况请填写,不填则以域名连接Websocket"
|
||
type="info" :closable="false"></el-alert>
|
||
</el-form-item>
|
||
<el-form-item label="服务器局域网/内网地址">
|
||
<el-input size="small" type="text"
|
||
v-model="websocket.ip"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="外网端口号">
|
||
<el-input size="small" type="text" v-model="websocket.client"></el-input>
|
||
<el-alert title="建议开启服务器的7272端口,请先在服务器服务商端放行该端口" type="info" :closable="false"></el-alert>
|
||
</el-form-item>
|
||
<el-form-item label="内网端口号">
|
||
<el-input size="small" type="text" v-model="websocket.intranet_client"></el-input>
|
||
<el-alert title="该端口号不需要放行,也不需要在服务器端(例如阿里云)添加安全组,比如外网端口开启7272,那么建议内网端口使用7273" type="info"
|
||
:closable="false"></el-alert>
|
||
</el-form-item>
|
||
<el-form-item label="内部通讯起始端口">
|
||
<el-input size="small" type="text" v-model="websocket.start_port"></el-input>
|
||
<el-alert title="该端口号不需要放行,也不需要在服务器端(例如阿里云)添加安全组,建议使用2300" type="info"
|
||
:closable="false"></el-alert>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div class="center">
|
||
<el-alert style="line-height: 40px;margin-left: 180px;width: auto;"
|
||
title="修改资料保存后必须点击生成Worker文件,否则配置将不会生效" type="info"
|
||
:closable="false"></el-alert>
|
||
<div style="margin-top: 20px;">
|
||
<if condition="$authArr['addWebsocket'] eq true">
|
||
<el-link type="primary"
|
||
href="http://qn.mobzhifu.com/Websocket%E9%85%8D%E7%BD%AE%E8%AF%A6%E7%BB%86%E6%95%99%E7%A8%8B.v2.0.doc">
|
||
下载配置Websocket文档教程
|
||
</el-link>
|
||
<el-button size="small" @click="checkWebsocket">检查问题</el-button>
|
||
</if>
|
||
<if condition="$authArr['makefile'] eq true">
|
||
<el-button size="small" type="primary" plain @click="makeWebsocketFile">生成Worker文件
|
||
</el-button>
|
||
</if>
|
||
<if condition="$authArr['addWebsocket'] eq true">
|
||
<el-button type="primary" size="small" @click="submitWebsocket">保存配置</el-button>
|
||
</if>
|
||
</div>
|
||
</div>
|
||
</el-tab-pane>
|
||
</el-tabs>
|
||
</el-tab-pane>
|
||
<el-tab-pane name="8" label="图片存储设置">
|
||
<el-tabs type="border-card">
|
||
<el-tab-pane label="图片存储设置">
|
||
<el-form label-width="180px">
|
||
<el-form-item label="选择存储方式">
|
||
<div>
|
||
<el-radio v-model="storage_type" label="1">本地存储</el-radio>
|
||
<el-radio v-model="storage_type" label="2">七牛云存储</el-radio>
|
||
<el-radio v-model="storage_type" label="3">腾讯云存储</el-radio>
|
||
<el-radio v-model="storage_type" label="4">阿里云OSS存储</el-radio>
|
||
</div>
|
||
</el-form-item>
|
||
<el-divider content-position="center">七牛云存储设置</el-divider>
|
||
<el-form-item label="七牛云Access_Key">
|
||
<el-input size="small" type="text" v-model="uploadConfig.qiniu_access_key"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="七牛云Secret_Key">
|
||
<el-input size="small" type="text" v-model="uploadConfig.qiniu_secret_key"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="七牛云存储空间">
|
||
<el-input size="small" type="text" v-model="uploadConfig.qiniu_storage_space"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="七牛云外链域名">
|
||
<el-input size="small" type="text" v-model="uploadConfig.qiniu_outer_chain_url"></el-input>
|
||
<el-alert title="以 '/' 结尾" type="info" :closable="false"></el-alert>
|
||
</el-form-item>
|
||
|
||
<el-divider content-position="center">腾讯云存储设置</el-divider>
|
||
<el-form-item label="腾讯云secretId">
|
||
<el-input size="small" type="text" v-model="uploadConfig.tencent_secret_id"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="腾讯云secretKey">
|
||
<el-input size="small" type="text" v-model="uploadConfig.tencent_secret_key"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="腾讯云Bucket">
|
||
<el-input size="small" type="text" v-model="uploadConfig.tencent_storage_space"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="腾讯云所属地区">
|
||
<el-input size="small" type="text" v-model="uploadConfig.tencent_region"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="腾讯云访问域名">
|
||
<el-input size="small" type="text"
|
||
v-model="uploadConfig.tencent_outer_chain_url"></el-input>
|
||
<el-alert title="以 '/' 结尾,可以自定义域名也可以使用原始域名" type="info" :closable="false"></el-alert>
|
||
</el-form-item>
|
||
|
||
<el-divider content-position="center">阿里云OSS存储设置</el-divider>
|
||
<el-form-item label="阿里云AccessKey ID">
|
||
<el-input size="small" type="text" v-model="uploadConfig.oss_access_key_id"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="阿里云Access Key Secret">
|
||
<el-input size="small" type="text" v-model="uploadConfig.oss_access_key_secret"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="阿里云存储空间">
|
||
<el-input size="small" type="text" v-model="uploadConfig.oss_storage_space"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="阿里云地域节点">
|
||
<el-input size="small" type="text" v-model="uploadConfig.oss_region"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="阿里云访问域名">
|
||
<el-input size="small" type="text" v-model="uploadConfig.oss_outer_chain_url"></el-input>
|
||
<el-alert title="以 '/' 结尾,可以自定义域名也可以使用原始域名" type="info" :closable="false"></el-alert>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div class="center">
|
||
<if condition="$authArr['addStorageSet'] eq true">
|
||
<el-button type="primary" size="small" @click="submitUploadConfig">保存配置</el-button>
|
||
</if>
|
||
</div>
|
||
</el-tab-pane>
|
||
</el-tabs>
|
||
</el-tab-pane>
|
||
<el-tab-pane name="9" label="配送设置">
|
||
<el-tabs type="border-card">
|
||
<el-tab-pane label="同城配送设置">
|
||
<el-form label-width="180px">
|
||
<template>
|
||
<el-divider content-position="center">达达设置</el-divider>
|
||
<el-form-item label="达达开发者app_key">
|
||
<el-input size="small" type="text" v-model="developer.app_key"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="达达开发者app_secret">
|
||
<el-input size="small" type="text" v-model="developer.app_secret"></el-input>
|
||
</el-form-item>
|
||
</template>
|
||
<template>
|
||
<el-divider content-position="center">UU配置</el-divider>
|
||
<el-form-item label="UU开发者appid">
|
||
<el-input size="small" type="text" v-model="developer.uu_appid"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="UU开发者appkey">
|
||
<el-input size="small" type="text" v-model="developer.uu_appkey"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="UU开发者ip地址">
|
||
<el-input size="small" type="text" v-model="developer.uu_ip"></el-input>
|
||
</el-form-item>
|
||
</template>
|
||
</el-form>
|
||
<div class="center">
|
||
<if condition="$authArr['adddeveloper'] eq true">
|
||
<el-button type="primary" size="small" @click="submitDeliveryConfig">保存配置</el-button>
|
||
</if>
|
||
</div>
|
||
</el-tab-pane>
|
||
<el-tab-pane label="快递配送设置">
|
||
<el-form label-width="180px">
|
||
<template>
|
||
<el-divider content-position="center">菜鸟物流服务商设置</el-divider>
|
||
<el-form-item label="应用appKey">
|
||
<el-input size="small" type="text" v-model="express.cn_app_key"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="应用appSecret">
|
||
<el-input size="small" type="text" v-model="express.cn_app_secret"></el-input>
|
||
</el-form-item>
|
||
</template>
|
||
<template>
|
||
<el-divider content-position="center">快递100配置</el-divider>
|
||
<el-form-item label="快递100 Customer">
|
||
<el-input size="small" type="text" v-model="express.kd100_customer"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="快递100 Key">
|
||
<el-input size="small" type="text" v-model="express.kd100_key"></el-input>
|
||
</el-form-item>
|
||
</template>
|
||
<el-form-item label="配置说明">
|
||
<el-alert title="1. 菜鸟物流云配置: 商家在授权后可以直接在系统里打印电子面单,配置请参考" type="warning" show-icon
|
||
:closable="false"></el-alert>
|
||
<el-link type="primary" target="_blank"
|
||
href="https://open.taobao.com/doc.htm?docId=107052&docType=1">电子面单LINK接入白皮书
|
||
</el-link>
|
||
<el-alert title="2. 快递100配置: 该配置主要是为了查询物流进度,配置请进入" type="warning" show-icon
|
||
:closable="false"></el-alert>
|
||
<el-link type="primary" target="_blank"
|
||
href="https://www.kuaidi100.com/openapi/applyapi.shtml">快递100接口申请
|
||
</el-link>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div class="center">
|
||
<if condition="$authArr['adddeveloper'] eq true">
|
||
<el-button type="primary" size="small" @click="submitExpressConfig">保存配置</el-button>
|
||
</if>
|
||
</div>
|
||
</el-tab-pane>
|
||
</el-tabs>
|
||
</el-tab-pane>
|
||
<el-tab-pane name="10" label="便捷登录设置">
|
||
<el-tabs type="border-card">
|
||
<el-tab-pane label="便捷登录设置">
|
||
<el-form label-width="180px">
|
||
<el-form-item label="是否开启便捷登录">
|
||
<el-switch v-model="convenient_sign_state"
|
||
:active-text="convenient_sign_state==1?'开启':'关闭'"
|
||
:active-value="1"
|
||
:inactive-value="0">
|
||
</el-switch>
|
||
<el-alert title="如果开启此设置访问域名时将会直接调转到登录页面" type="info"
|
||
:closable="false"></el-alert>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div class="center">
|
||
<if condition="$authArr['convenientSign'] eq true">
|
||
<el-button type="primary" size="small" @click="saveConvenientSign">保存配置</el-button>
|
||
</if>
|
||
</div>
|
||
</el-tab-pane>
|
||
</el-tabs>
|
||
</el-tab-pane>
|
||
<el-tab-pane name="12" label="商品条码查询设置">
|
||
<el-tabs type="border-card">
|
||
<el-tab-pane label="商品条码查询设置">
|
||
<el-form label-width="180px">
|
||
<el-form-item label="是否开启">
|
||
<el-switch v-model="app_status"
|
||
:active-text="app_status?'开启':'关闭'">
|
||
</el-switch>
|
||
<el-input size="small" type="text" v-model="app_code" style="margin-left:10px;"
|
||
placeholder="阿里云条码查询AppCode"></el-input>
|
||
<el-alert title="如果开启此设置,商品条码查询如果未从本地商品云库查询到商品将会前往阿里云查询并存入本地商品云库" type="info"
|
||
:closable="false"></el-alert>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div class="center">
|
||
<if condition="$authArr['convenientSign'] eq true">
|
||
<el-button type="primary" size="small" @click="appCodeSet">保存配置</el-button>
|
||
</if>
|
||
</div>
|
||
</el-tab-pane>
|
||
</el-tabs>
|
||
</el-tab-pane>
|
||
<!--<el-tab-pane name="11" label="支付设置"></el-tab-pane>-->
|
||
</el-tabs>
|
||
<template-verify-code :show-get-code="showGetCode" @sure-submit="sureSubmit"></template-verify-code>
|
||
</div>
|
||
<script>
|
||
Vue.component("template-verify-code", {
|
||
template: `<el-dialog :append-to-body="true"
|
||
title="修改支付参数安全验证"
|
||
:visible.sync="showGetCode"
|
||
:before-close="cancelSub"
|
||
width="352px"
|
||
:close-on-click-modal="false">
|
||
<p style="color: #aaaaaa; margin-bottom: 10px;text-align: center">将会向合伙人登录手机号发送验证码,请注意查收</p>
|
||
<div class="code-box">
|
||
<el-input size="small"
|
||
v-model="code"
|
||
oninput="value=this.value.replace(/^[0]|\\D/,'')"
|
||
maxLength="6"
|
||
style="width:210px;margin-right: 10px"
|
||
placeholder="请输入验证码"></el-input>
|
||
<el-button type="primary" size="small" v-if="canGetCode" @click="sendCode">发送验证码</el-button>
|
||
<el-button type="primary" size="small" v-else-if="isSending" icon="el-icon-loading">发送中</el-button>
|
||
<button v-else type="button" class="el-button el-button--primary el-button--small is-disabled" disabled="disabled" style="width: 92px!important;">
|
||
<span>{{count}} s</span>
|
||
</button>
|
||
</div>
|
||
<div style="text-align: right;margin-top: 30px">
|
||
<el-button size="medium" @click="cancelSub">取消</el-button>
|
||
<el-button size="medium" :disabled="!/[0-9]{6}/.test(code)" type="primary" @click="sureSubmit">确定</el-button>
|
||
</div>
|
||
</el-dialog>`,
|
||
props: {
|
||
'showGetCode': {
|
||
type: Boolean,
|
||
default: false,
|
||
}
|
||
},
|
||
data() {
|
||
return {
|
||
count: 60,
|
||
canGetCode: true,
|
||
code: '',
|
||
timer: null,
|
||
isSending: false,
|
||
}
|
||
},
|
||
methods: {
|
||
cancelSub() {
|
||
clearInterval(this.timer);
|
||
this.$emit('sure-submit', {status: 0, message: '用户取消操作'});
|
||
},
|
||
sureSubmit() {
|
||
clearInterval(this.timer);
|
||
this.$emit('sure-submit', {status: 1, message: '用户提交', code: this.code});
|
||
},
|
||
//发送验证码
|
||
sendCode() {
|
||
this.canGetCode = false;
|
||
this.isSending = true;
|
||
$.ajax({
|
||
url: "{:U('sendCode')}",
|
||
data: {},
|
||
type: "post",
|
||
success: (res) => {
|
||
this.$message({
|
||
message: res.message ? res.message : "请求有误",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
if (res.status == 1) {
|
||
this.isSending = false;
|
||
this.count = 60;
|
||
this.timer = setInterval(() => {
|
||
this.count--;
|
||
if (this.count == 0) {
|
||
this.canGetCode = true;
|
||
clearInterval(this.timer);
|
||
}
|
||
}, 1000)
|
||
} else {
|
||
this.isSending = true;
|
||
this.canGetCode = true;
|
||
}
|
||
},
|
||
error: () => {
|
||
this.$message.error("请求发生错误");
|
||
this.isSending = true;
|
||
this.canGetCode = true;
|
||
}
|
||
})
|
||
},
|
||
},
|
||
watch: {
|
||
showGetCode(n) {
|
||
if (n) {
|
||
this.canGetCode = true;
|
||
this.code = '';
|
||
this.isSending = false;
|
||
}
|
||
}
|
||
}
|
||
|
||
});
|
||
var configApp = new Vue({
|
||
el: '#configApp',
|
||
data() {
|
||
return {
|
||
active_config_index: '1',//当前点击的标签
|
||
wxConfig: {},//微信开放平台及小程序配置
|
||
serverConfig: {},//服务商配置
|
||
serverConfig: {},//服务商配置
|
||
continent: {},//新大陆配置
|
||
redis: {},//redis配置
|
||
mapConfig: {},//短信设置
|
||
websocket: {},//Websocket配置
|
||
uploadConfig: {},//图片存储配置
|
||
storage_type: '',//图片存储方式
|
||
developer: {},//配送设置
|
||
convenient_sign_state: 0,//是否开启便捷登录
|
||
continentNotify: [],//新大陆多域名回调列表
|
||
showGetCode: false,
|
||
express: {},//快递配置
|
||
app_status: false,
|
||
app_code: "",
|
||
callback: null,
|
||
}
|
||
},
|
||
methods: {
|
||
clickTabs(index) {
|
||
if (index == 11) {
|
||
layer.open({
|
||
type: 2,
|
||
title: ['支付设置', 'font-weight: bold;font-size: 15px;background-color: #fff;color: #409EFF;height: 40px;line-height: 40px;'],
|
||
content: "{:U('Admin/PaySet/index')}",
|
||
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
|
||
offset: 'rb',
|
||
shade: 0,
|
||
move: false,
|
||
resize: false,
|
||
end: res => {
|
||
this.active_config_index = localStorage.active_config_index;
|
||
}
|
||
})
|
||
} else {
|
||
localStorage.active_config_index = index;
|
||
}
|
||
},
|
||
//保存微信开放平台设置
|
||
saveWxConfig() {
|
||
if (!this.wxConfig.appid || !this.wxConfig.token || !this.wxConfig.encodingaeskey || !this.wxConfig.appsecret) {
|
||
return this.$message.warning('请完善参数');
|
||
}
|
||
$.ajax({
|
||
url: "{:U('setConfig')}",
|
||
type: "post",
|
||
data: {
|
||
appid: this.wxConfig.appid,
|
||
token: this.wxConfig.token,
|
||
key: this.wxConfig.encodingaeskey,
|
||
appsecret: this.wxConfig.appsecret,
|
||
},
|
||
success: (res) => {
|
||
this.$message({
|
||
message: res.msg ? res.msg : "请求有误",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: () => {
|
||
this.$message.error('请求发生错误');
|
||
}
|
||
})
|
||
},
|
||
//检查开放平台配置
|
||
checkWxConfig() {
|
||
switch (this.wxConfig.errcode) {
|
||
case "-40001":
|
||
this.$confirm('签名验证错误,请检查你的token', '提示', {
|
||
confirmButtonText: '关闭',
|
||
type: 'warning'
|
||
}).then(() => {
|
||
}).catch(() => {
|
||
});
|
||
break;
|
||
case "-40002":
|
||
case "-40003":
|
||
this.$confirm('xml解析失败', '提示', {
|
||
confirmButtonText: '关闭',
|
||
type: 'warning'
|
||
}).then(() => {
|
||
}).catch(() => {
|
||
});
|
||
break;
|
||
case "-40004":
|
||
this.$confirm('encodingAesKey 非法', '提示', {
|
||
confirmButtonText: '关闭',
|
||
type: 'warning'
|
||
}).then(() => {
|
||
}).catch(() => {
|
||
});
|
||
break;
|
||
case "-40005":
|
||
this.$confirm('appid 校验错误', '提示', {
|
||
confirmButtonText: '关闭',
|
||
type: 'warning'
|
||
}).then(() => {
|
||
}).catch(() => {
|
||
});
|
||
break;
|
||
case "-40006":
|
||
this.$confirm('aes 加密失败', '提示', {
|
||
confirmButtonText: '关闭',
|
||
type: 'warning'
|
||
}).then(() => {
|
||
}).catch(() => {
|
||
});
|
||
break;
|
||
case "-40007":
|
||
this.$confirm('aes 解密失败', '提示', {
|
||
confirmButtonText: '关闭',
|
||
type: 'warning'
|
||
}).then(() => {
|
||
}).catch(() => {
|
||
});
|
||
break;
|
||
case "-40008":
|
||
this.$confirm('解密后得到的buffer非法', '提示', {
|
||
confirmButtonText: '关闭',
|
||
type: 'warning'
|
||
}).then(() => {
|
||
}).catch(() => {
|
||
});
|
||
break;
|
||
case "-40009":
|
||
this.$confirm('base64加密失败', '提示', {
|
||
confirmButtonText: '关闭',
|
||
type: 'warning'
|
||
}).then(() => {
|
||
}).catch(() => {
|
||
});
|
||
break;
|
||
case "-40010":
|
||
this.$confirm('base64解密失败', '提示', {
|
||
confirmButtonText: '关闭',
|
||
type: 'warning'
|
||
}).then(() => {
|
||
}).catch(() => {
|
||
});
|
||
break;
|
||
case "-40011":
|
||
this.$confirm('生成xml失败', '提示', {
|
||
confirmButtonText: '关闭',
|
||
type: 'warning'
|
||
}).then(() => {
|
||
}).catch(() => {
|
||
});
|
||
break;
|
||
default:
|
||
//配置一个透明的询问框
|
||
this.$confirm('参数无误,选择继续或取消', '提示', {
|
||
confirmButtonText: '去检测',
|
||
cancelButtonText: '取消',
|
||
type: 'success'
|
||
}).then(() => {
|
||
window.open("{:U('Super/Config/authindex')}");
|
||
this.$confirm('是否授权成功,如授权成功则刷新查看', '检测提示', {
|
||
confirmButtonText: '刷新',
|
||
cancelButtonText: '关闭',
|
||
type: 'info'
|
||
}).then(() => {
|
||
MenuApp.refreshWindow();
|
||
}).catch(() => {
|
||
});
|
||
}).catch(() => {
|
||
});
|
||
break;
|
||
}
|
||
},
|
||
//复制地址
|
||
copyUrl(ref) {
|
||
$(this.$refs[ref]).select();
|
||
try {
|
||
document.execCommand('copy');
|
||
this.$notify({
|
||
title: '成功',
|
||
message: '内容已成功复制到剪切板',
|
||
type: 'success',
|
||
duration: 2000
|
||
});
|
||
} catch (err) {
|
||
this.$notify({
|
||
title: '失败',
|
||
message: '复制失败',
|
||
type: 'error',
|
||
duration: 1500
|
||
});
|
||
console.log(err);
|
||
}
|
||
|
||
},
|
||
//保存小程序设置
|
||
saveXcxConfig() {
|
||
if (!this.wxConfig.server || !this.wxConfig.business || !this.wxConfig.version || !this.wxConfig.information || !this.wxConfig.tag) {
|
||
return this.$message.warning('请完善参数');
|
||
}
|
||
$.ajax({
|
||
url: "{:U('Config/setProgram')}",
|
||
type: "post",
|
||
data: {
|
||
server: this.wxConfig.server,
|
||
business: this.wxConfig.business,
|
||
version: this.wxConfig.version,
|
||
information: this.wxConfig.information,
|
||
tag: this.wxConfig.tag,
|
||
},
|
||
success: (res) => {
|
||
this.$message({
|
||
message: res.msg ? res.msg : "请求有误",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: () => {
|
||
this.$message.error('请求发生错误');
|
||
}
|
||
})
|
||
},
|
||
//选择小程序模板
|
||
urgentAudit() {
|
||
top.layer.open({
|
||
title: '商城小程序加急审核',
|
||
type: 2,
|
||
content: "{:U('urgentAudit')}",
|
||
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
|
||
offset: 'rb',
|
||
btnAlign: 'c',
|
||
shade: 0,
|
||
});
|
||
},
|
||
//选择小程序模板
|
||
chooseProgram() {
|
||
top.layer.open({
|
||
title: '选择商城小程序模板',
|
||
type: 2,
|
||
content: "{:U('xcxtemplate')}",
|
||
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
|
||
offset: 'rb',
|
||
btnAlign: 'c',
|
||
shade: 0,
|
||
});
|
||
},
|
||
//上传文件成功
|
||
uploadFileSuccess(response, file, fileList) {
|
||
//图片上传成功的钩子
|
||
if (response.status == 1) {
|
||
switch (response.type) {
|
||
case '1':
|
||
this.$message({
|
||
message: '上传成功',
|
||
type: 'success'
|
||
});
|
||
this.serverConfig.wx_apiclient_cert = response.path;
|
||
break;
|
||
case '2':
|
||
this.$message({
|
||
message: '上传成功',
|
||
type: 'success'
|
||
});
|
||
this.serverConfig.wx_apiclient_key = response.path;
|
||
break;
|
||
case '3':
|
||
this.$message({
|
||
message: '上传成功',
|
||
type: 'success'
|
||
});
|
||
this.continent.continent_credential = response.path;
|
||
break;
|
||
case '4':
|
||
this.$message({
|
||
message: '上传成功',
|
||
type: 'success'
|
||
});
|
||
this.serverConfig.pubkey = response.cloud_path;
|
||
break;
|
||
case '5':
|
||
this.$message({
|
||
message: '上传成功',
|
||
type: 'success'
|
||
});
|
||
this.serverConfig.prvkey = response.cloud_path;
|
||
break;
|
||
default:
|
||
this.$message.warning('系统异常,请稍后重试');
|
||
}
|
||
} else {
|
||
this.$message.warning('上传失败');
|
||
}
|
||
},
|
||
//上传文件失败
|
||
uploadFileError() {
|
||
this.$message.warning('上传失败');
|
||
},
|
||
toGetCode(callback) {
|
||
this.showGetCode = true;
|
||
if (typeof callback == "function") this.callback = callback;
|
||
},
|
||
sureSubmit(res) {
|
||
this.showGetCode = false;
|
||
if (res.status == 1) {
|
||
if (typeof this.callback == "function") this.callback(res.code), this.callback = null;
|
||
}
|
||
},
|
||
//保存云闪付支付设置
|
||
saveCloudConfig(code) {
|
||
if (!code || code == undefined || code == null) {
|
||
return this.toGetCode(this.saveCloudConfig);
|
||
}
|
||
$.ajax({
|
||
url: "{:U('cloud_pay_conf')}",
|
||
data: {
|
||
serprovid: this.serverConfig.serprovid,
|
||
acqcode: this.serverConfig.acqcode,
|
||
prvkey: this.serverConfig.prvkey,
|
||
pubkey: this.serverConfig.pubkey,
|
||
prodkey: this.serverConfig.prodkey,
|
||
union_pay_rate: this.serverConfig.union_pay_rate,
|
||
code: code
|
||
},
|
||
type: "post",
|
||
success: (res) => {
|
||
this.$message({
|
||
message: res.msg ? res.msg : "请求有误",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: () => {
|
||
this.$message.error('请求发生错误');
|
||
}
|
||
})
|
||
},
|
||
// 保存乐返费率设置
|
||
saveHappyRateConfig(code) {
|
||
if (!code || code == undefined || code == null) {
|
||
return this.toGetCode(this.saveHappyRateConfig);
|
||
}
|
||
$.ajax({
|
||
url: "{:U('happyPayConfig')}",
|
||
data: {
|
||
happyInstitution: this.serverConfig.happy_institution,
|
||
happyPrvKey: this.serverConfig.happy_prvkey,
|
||
happyPubKey: this.serverConfig.happy_pubkey,
|
||
happyRate: this.serverConfig.happy_rate,
|
||
code: code,
|
||
},
|
||
type: "post",
|
||
success: (res) => {
|
||
this.$message({
|
||
message: res.message ? res.message : res.message,
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: () => {
|
||
this.$message.error('请求发生错误');
|
||
}
|
||
})
|
||
},
|
||
// 拉卡拉支付设置
|
||
saveLaKaLaPayConfig(code) {
|
||
if (!code || code == undefined || code == null) {
|
||
return this.toGetCode(this.saveLaKaLaPayConfig);
|
||
}
|
||
$.ajax({
|
||
url: "{:U('laKaLaPayConfig')}",
|
||
data: {
|
||
laKaLaAppId: this.serverConfig.lakala_appid,
|
||
laKaLaToken: this.serverConfig.lakala_token,
|
||
laKaLaTermId: this.serverConfig.lakala_termid,
|
||
laKaLaRate: this.serverConfig.lakala_rate,
|
||
laKaLaSecretKey: this.serverConfig.lakala_secret_key,
|
||
code: code,
|
||
},
|
||
type: "post",
|
||
success: (res) => {
|
||
this.$message({
|
||
message: res.message ? res.message : res.message,
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: () => {
|
||
this.$message.error('请求发生错误');
|
||
}
|
||
})
|
||
},
|
||
// 钱客云支付配置
|
||
saveQianKeYunPayConfig(code) {
|
||
if (!code || code == undefined || code == null) {
|
||
return this.toGetCode(this.saveQianKeYunPayConfig);
|
||
}
|
||
$.ajax({
|
||
url: "{:U('qianKePayConfig')}",
|
||
data: {
|
||
qianKeRate: this.serverConfig.qian_ke_rate,
|
||
code: code,
|
||
},
|
||
type: "post",
|
||
success: (res) => {
|
||
this.$message({
|
||
message: res.message ? res.message : "请求有误",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: () => {
|
||
this.$message.error('请求发生错误');
|
||
}
|
||
})
|
||
},
|
||
//保存微信服务商设置
|
||
saveServerWx(code) {
|
||
if (!code || code == undefined || code == null) {
|
||
return this.toGetCode(this.saveServerWx);
|
||
}
|
||
$.ajax({
|
||
url: "{:U('wx_agentconf')}",
|
||
data: {
|
||
wx_appid: this.serverConfig.wx_appid,
|
||
wx_key: this.serverConfig.wx_key,
|
||
mch_id: this.serverConfig.mch_id,
|
||
wx_serial_no: this.serverConfig.wx_serial_no,
|
||
wx_apiclient_cert: this.serverConfig.wx_apiclient_cert,
|
||
wx_apiclient_key: this.serverConfig.wx_apiclient_key,
|
||
code: code,
|
||
},
|
||
type: "post",
|
||
success: (res) => {
|
||
this.$message({
|
||
message: res.msg ? res.msg : "请求有误",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: () => {
|
||
this.$message.error('请求发生错误');
|
||
}
|
||
})
|
||
},
|
||
//保存支付宝服务商设置
|
||
saveServerAliPay(code) {
|
||
if (!code || code == undefined || code == null) {
|
||
return this.toGetCode(this.saveServerAliPay);
|
||
}
|
||
$.ajax({
|
||
url: "{:U('ali_agentconf')}",
|
||
data: {
|
||
alipay_appid: this.serverConfig.alipay_appid,
|
||
alipay_pid: this.serverConfig.alipay_pid,
|
||
alipay_public_key: this.serverConfig.alipay_public_key,
|
||
alipay_private_key: this.serverConfig.alipay_private_key,
|
||
code: code
|
||
},
|
||
type: "post",
|
||
success: (res) => {
|
||
this.$message({
|
||
message: res.msg ? res.msg : "请求有误",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: (res) => {
|
||
this.$message.error('请求发生错误');
|
||
}
|
||
})
|
||
},
|
||
//保存新大陆设置
|
||
saveServerNew(code) {
|
||
if (!code || code == undefined || code == null) {
|
||
return this.toGetCode(this.saveServerNew);
|
||
}
|
||
$.ajax({
|
||
url: "{:U('continent_conf')}",
|
||
type: "post",
|
||
data: {
|
||
continent_number: this.continent.continent_number,
|
||
partner_rate: this.continent.partner_rate,
|
||
continent_pay_secret_key: this.continent.continent_pay_secret_key,
|
||
continent_callback_secret_key: this.continent.continent_callback_secret_key,
|
||
continent_credential: this.continent.continent_credential,
|
||
code: code
|
||
},
|
||
success: (res) => {
|
||
this.$message({
|
||
message: res.msg ? res.msg : "请求有误",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: (res) => {
|
||
this.$message.error('请求发生错误');
|
||
}
|
||
})
|
||
},
|
||
//添加新大陆多域名回调地址
|
||
addNotify() {
|
||
if (this.continentNotify.length < 10) {
|
||
var obj = {
|
||
name: '',
|
||
url: '',
|
||
};
|
||
this.continentNotify.push(obj);
|
||
}
|
||
},
|
||
//删除新大陆多域名回调
|
||
delNotify(index) {
|
||
this.continentNotify.splice(index, 1);
|
||
},
|
||
//保存新大陆多域名回调
|
||
saveContinentNotify(code) {
|
||
if (!code || code == undefined || code == null) {
|
||
return this.toGetCode(this.saveContinentNotify);
|
||
}
|
||
this.$confirm('确认保存当前设置的域名列表吗?', '提示', {
|
||
confirmButtonText: '保存',
|
||
cancelButtonText: '取消',
|
||
type: 'info'
|
||
}).then(() => {
|
||
$.ajax({
|
||
url: "{:U('saveContinentNotify')}",
|
||
type: "post",
|
||
data: {
|
||
list: this.continentNotify,
|
||
code: code
|
||
},
|
||
success: (res) => {
|
||
this.$message({
|
||
message: res.msg ? res.msg : "保存失败",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: (res) => {
|
||
this.$message.error('保存失败');
|
||
}
|
||
})
|
||
}).catch(() => {
|
||
});
|
||
},
|
||
//检测短信配置
|
||
checkSms() {
|
||
this.$prompt('请输入手机号', '提示', {
|
||
confirmButtonText: '确定',
|
||
cancelButtonText: '取消',
|
||
inputPattern: /^[1][1356789]\d{9}/,
|
||
inputErrorMessage: '手机号格式不正确'
|
||
}).then(({value}) => {
|
||
this.$loading({
|
||
lock: true,
|
||
text: '检测中,请耐心等待',
|
||
spinner: 'el-icon-loading',
|
||
background: 'rgba(255, 255, 255, 0.3)'
|
||
});
|
||
$.ajax({
|
||
url: "{:U('checkSms')}",
|
||
type: "post",
|
||
data: {
|
||
phone: value,
|
||
},
|
||
success: (res) => {
|
||
this.$loading().close();
|
||
this.$message({
|
||
message: res.message ? res.message : "发送失败",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: (res) => {
|
||
this.$loading().close();
|
||
this.$message.error('发送失败');
|
||
}
|
||
})
|
||
}).catch(() => {
|
||
|
||
});
|
||
},
|
||
//保存短信配置
|
||
submitSms() {
|
||
if (!this.mapConfig.accesskeyid || !this.mapConfig.accesskeysecret || !this.mapConfig.accessname || !this.mapConfig.accesscode) {
|
||
top.layer.msg('缺少参数', {time: 1000})
|
||
return;
|
||
}
|
||
$.ajax({
|
||
url: "{:U('setSms')}",
|
||
type: "post",
|
||
data: {
|
||
accesskeyid: this.mapConfig.accesskeyid,
|
||
accesskeysecret: this.mapConfig.accesskeysecret,
|
||
accessname: this.mapConfig.accessname,
|
||
accesscode: this.mapConfig.accesscode,
|
||
},
|
||
success: (res) => {
|
||
this.$message({
|
||
message: res.msg ? res.msg : "保存失败",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: () => {
|
||
this.$message.error('保存失败');
|
||
}
|
||
})
|
||
},
|
||
//保存地图设置
|
||
submitMapSet() {
|
||
if (!this.mapConfig.baidukeyid) {
|
||
return this.$message.warning('百度浏览器端key为必填');
|
||
}
|
||
if (this.mapConfig.server_map_type == 1 && !this.mapConfig.serverkeyid) {
|
||
return this.$message.warning('请填写百度浏服务器端key');
|
||
}
|
||
if (this.mapConfig.server_map_type == 2 && !this.mapConfig.gould_key) {
|
||
return this.$message.warning('请填写高德地图key');
|
||
}
|
||
if (this.mapConfig.server_map_type == 3 && !this.mapConfig.tencent_key) {
|
||
return this.$message.warning('请填写腾讯地图key');
|
||
}
|
||
$.ajax({
|
||
url: "{:U('setSmsone')}",
|
||
type: 'post',
|
||
data: {
|
||
baidukeyid: this.mapConfig.baidukeyid,
|
||
serverkeyid: this.mapConfig.serverkeyid,
|
||
server_map_type: this.mapConfig.server_map_type,
|
||
gould_key: this.mapConfig.gould_key,
|
||
tencent_key: this.mapConfig.tencent_key,
|
||
},
|
||
success: (res) => {
|
||
this.$message({
|
||
message: res.msg ? res.msg : "保存失败",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: () => {
|
||
this.$message.error('保存失败');
|
||
}
|
||
})
|
||
},
|
||
//检测Redis配置
|
||
checkRedis() {
|
||
this.$confirm('可能会检测很久,请耐心等待', '提示', {
|
||
confirmButtonText: '检测',
|
||
cancelButtonText: '取消',
|
||
type: 'success'
|
||
}).then(() => {
|
||
this.$loading({
|
||
lock: true,
|
||
text: '检测中,请耐心等待',
|
||
spinner: 'el-icon-loading',
|
||
background: 'rgba(255, 255, 255, 0.3)'
|
||
});
|
||
$.ajax({
|
||
url: "{:U('checkRedis')}",
|
||
data: {},
|
||
type: 'post',
|
||
success: (res) => {
|
||
this.$loading().close();
|
||
this.$message({
|
||
message: res.msg ? res.msg : "请求有误",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: (res) => {
|
||
this.$loading().close();
|
||
this.$message.error('配置失败');
|
||
}
|
||
})
|
||
}).catch(() => {
|
||
});
|
||
},
|
||
//保存Redis配置
|
||
submitRedis() {
|
||
$.ajax({
|
||
url: "{:U('editRedis')}",
|
||
type: "post",
|
||
data: {
|
||
is_set_redis: this.redis.is_set_redis ? 1 : 0,
|
||
redis_local: this.redis.redis_local,
|
||
redis_port: this.redis.redis_port,
|
||
redis_pass: this.redis.redis_pass,
|
||
redis_number: this.redis.redis_number,
|
||
},
|
||
success: (res) => {
|
||
this.$message({
|
||
message: res.msg ? res.msg : "保存失败",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: (res) => {
|
||
this.$message.error('保存失败');
|
||
}
|
||
})
|
||
},
|
||
//生成Websocket文件
|
||
makeWebsocketFile() {
|
||
this.$confirm('确定生成websocket的配置文件吗?', '提示', {
|
||
confirmButtonText: '生成',
|
||
cancelButtonText: '取消',
|
||
type: 'info'
|
||
}).then(() => {
|
||
$.ajax({
|
||
url: "{:U('makefile')}",
|
||
type: "post",
|
||
data: {
|
||
ip: this.websocket.ip,
|
||
intranet_client: this.websocket.intranet_client,
|
||
client: this.websocket.client,
|
||
start_port: this.websocket.start_port,
|
||
},
|
||
success: (res) => {
|
||
this.$message({
|
||
message: res.msg ? res.msg : "生成失败",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: (res) => {
|
||
this.$message.error('保存失败');
|
||
}
|
||
})
|
||
}).catch(() => {
|
||
});
|
||
},
|
||
//检查websocket是否配置成功
|
||
checkWebsocket() {
|
||
this.$confirm('可能会检测很久,请耐心等待', '提示', {
|
||
confirmButtonText: '检测',
|
||
cancelButtonText: '取消',
|
||
type: 'success'
|
||
}).then(() => {
|
||
this.$loading({
|
||
lock: true,
|
||
text: '检测中,请耐心等待',
|
||
spinner: 'el-icon-loading',
|
||
background: 'rgba(255, 255, 255, 0.3)'
|
||
});
|
||
var original_ip = this.websocket.original_ip;
|
||
if (original_ip == '' || original_ip == undefined || !original_ip) {
|
||
original_ip = document.location.host;
|
||
}
|
||
var ws = new WebSocket("wss://" + original_ip + "/socket");
|
||
// 当有消息时根据消息类型显示不同信息
|
||
var count = 0;
|
||
ws.onopen = () => {
|
||
var login_data = '{"type":"login","uid":-1,"type_id":0}';
|
||
ws.send(login_data.toString());
|
||
$.ajax({
|
||
url: "{:U('checkWebsocket')}",
|
||
type: 'post',
|
||
data: {
|
||
ip: this.websocket.ip,
|
||
intranet_client: this.websocket.intranet_client,
|
||
},
|
||
success: (res) => {
|
||
if (res.status == 1) {
|
||
count = 1;
|
||
} else {
|
||
this.$loading().close();
|
||
this.$message({
|
||
message: res.msg ? res.msg : "测试推送发送失败",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
ws.close();
|
||
}
|
||
},
|
||
error: (res) => {
|
||
this.$loading().close();
|
||
this.$message.error('发送请求失败');
|
||
ws.close();
|
||
}
|
||
});
|
||
};
|
||
ws.onmessage = (re) => {
|
||
console.log(re);
|
||
console.log(count);
|
||
count++;
|
||
if (count > 10) {
|
||
this.$loading().close();
|
||
this.$message.error('配置失败');
|
||
ws.close();
|
||
return;
|
||
}
|
||
if (re.data) {
|
||
var data = JSON.parse(re.data);
|
||
if (data.type == 'say') {
|
||
this.$loading().close();
|
||
this.$message.success('配置成功');
|
||
ws.close();
|
||
return;
|
||
}
|
||
}
|
||
};
|
||
ws.onerror = () => {
|
||
this.$loading().close();
|
||
this.$message.error('连接错误,请检查');
|
||
ws.close();
|
||
console.log('onerror');
|
||
//alert("连接错误,请检查");
|
||
};
|
||
ws.onclose = () => {
|
||
console.log('onclose');
|
||
};
|
||
}).catch(() => {
|
||
});
|
||
},
|
||
//保存Websocket配置
|
||
submitWebsocket() {
|
||
if (String(this.websocket.client).length > 4) {
|
||
return this.$message.warning('端口号长度不正确');
|
||
}
|
||
if (String(this.websocket.intranet_client).length > 4) {
|
||
return this.$message.warning('端口号长度不正确');
|
||
}
|
||
if (String(this.websocket.start_port).length > 4) {
|
||
return this.$message.warning('端口号长度不正确');
|
||
}
|
||
console.log(this.websocket.status);
|
||
$.ajax({
|
||
url: "{:U('addWebsocket')}",
|
||
type: "post",
|
||
data: {
|
||
status: this.websocket.status == 1 ? 1 : 0,
|
||
ip: this.websocket.ip,
|
||
client: this.websocket.client,
|
||
intranet_client: this.websocket.intranet_client,
|
||
start_port: this.websocket.start_port,
|
||
original_ip: this.websocket.original_ip,
|
||
},
|
||
success: (res) => {
|
||
this.$message({
|
||
message: res.msg ? res.msg : "保存失败",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: (res) => {
|
||
this.$message.error('保存失败');
|
||
}
|
||
});
|
||
},
|
||
//保存图片存储设置
|
||
submitUploadConfig() {
|
||
if (!this.storage_type) {
|
||
return this.$message.warning('请选择图片存储方式');
|
||
}
|
||
if (this.storage_type == 2 && (!this.uploadConfig.qiniu_access_key || !this.uploadConfig.qiniu_secret_key || !this.uploadConfig.qiniu_storage_space || !this.uploadConfig.qiniu_outer_chain_url)) {
|
||
return this.$message.warning('请完善七牛云参数');
|
||
}
|
||
if (this.storage_type == 3 && (!this.uploadConfig.tencent_secret_id || !this.uploadConfig.tencent_secret_key || !this.uploadConfig.tencent_storage_space || !this.uploadConfig.tencent_region || !this.uploadConfig.tencent_outer_chain_url)) {
|
||
return this.$message.warning('请完善腾讯云参数');
|
||
}
|
||
if (this.storage_type == 4 && (!this.uploadConfig.oss_access_key_id || !this.uploadConfig.oss_access_key_secret || !this.uploadConfig.oss_storage_space || !this.uploadConfig.oss_region || !this.uploadConfig.oss_outer_chain_url)) {
|
||
return this.$message.warning('请完善阿里云OSS参数');
|
||
}
|
||
$.ajax({
|
||
url: "{:U('addStorageSet')}",
|
||
type: 'post',
|
||
data: {
|
||
storage_type: this.storage_type,
|
||
qiniu_access_key: this.uploadConfig.qiniu_access_key,
|
||
qiniu_secret_key: this.uploadConfig.qiniu_secret_key,
|
||
qiniu_storage_space: this.uploadConfig.qiniu_storage_space,
|
||
qiniu_outer_chain_url: this.uploadConfig.qiniu_outer_chain_url,
|
||
tencent_secret_id: this.uploadConfig.tencent_secret_id,
|
||
tencent_secret_key: this.uploadConfig.tencent_secret_key,
|
||
tencent_storage_space: this.uploadConfig.tencent_storage_space,
|
||
tencent_region: this.uploadConfig.tencent_region,
|
||
tencent_outer_chain_url: this.uploadConfig.tencent_outer_chain_url,
|
||
oss_access_key_id: this.uploadConfig.oss_access_key_id,
|
||
oss_access_key_secret: this.uploadConfig.oss_access_key_secret,
|
||
oss_storage_space: this.uploadConfig.oss_storage_space,
|
||
oss_region: this.uploadConfig.oss_region,
|
||
oss_outer_chain_url: this.uploadConfig.oss_outer_chain_url,
|
||
},
|
||
success: (res) => {
|
||
this.$message({
|
||
message: res.msg ? res.msg : "保存失败",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: (res) => {
|
||
this.$message.error('保存失败');
|
||
}
|
||
})
|
||
},
|
||
//保存配送设置
|
||
submitDeliveryConfig() {
|
||
if (this.developer.app_key != '' || this.developer.app_secret != '') {
|
||
if (this.developer.app_key == '' || this.developer.app_secret == '') {
|
||
return this.$message.warning('请完善达达表单信息');
|
||
}
|
||
}
|
||
if (this.developer.uu_appid != '' || this.developer.uu_ip != '' || this.developer.uu_appkey != '') {
|
||
if (this.developer.uu_appid == '' || this.developer.uu_ip == '' || this.developer.uu_appkey == '') {
|
||
return this.$message.warning('请完善UU表单信息');
|
||
}
|
||
}
|
||
$.ajax({
|
||
url: "{:U('Developer/adddeveloper')}",
|
||
type: "post",
|
||
data: {
|
||
app_key: this.developer.app_key,
|
||
app_secret: this.developer.app_secret,
|
||
uu_appid: this.developer.uu_appid,
|
||
uu_appkey: this.developer.uu_appkey,
|
||
uu_ip: this.developer.uu_ip,
|
||
},
|
||
success: (res) => {
|
||
this.$message({
|
||
message: res.msg ? res.msg : "保存失败",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: (res) => {
|
||
this.$message.error('保存失败');
|
||
}
|
||
})
|
||
},
|
||
//保存快递配置
|
||
submitExpressConfig() {
|
||
$.ajax({
|
||
url: "{:U('saveExpressConfig')}",
|
||
type: "post",
|
||
data: this.express,
|
||
success: (res) => {
|
||
this.$message({
|
||
message: res.msg ? res.msg : "保存失败",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: (res) => {
|
||
this.$message.error('保存失败');
|
||
}
|
||
})
|
||
},
|
||
//保存便捷登录设置
|
||
saveConvenientSign() {
|
||
$.ajax({
|
||
url: "{:U('convenientSign')}",
|
||
type: "post",
|
||
data: {
|
||
convenient_sign_state: this.convenient_sign_state
|
||
},
|
||
success: (res) => {
|
||
this.$message({
|
||
message: res.msg ? res.msg : "保存失败",
|
||
type: res.status && res.status == 1 ? 'success' : 'error',
|
||
duration: 1500,
|
||
});
|
||
},
|
||
error: (res) => {
|
||
this.$message.error('保存失败');
|
||
}
|
||
})
|
||
},
|
||
//条码查询设置
|
||
appCodeSet() {
|
||
var app_code = this.app_code;
|
||
var app_status = this.app_status ? 1 : 2;
|
||
if (app_status == 1 && app_code == '') {
|
||
return this.$message.warning('请输入AppCode');
|
||
}
|
||
$.ajax({
|
||
url: "{:U('appCodeSet')}",
|
||
type: "post",
|
||
data: {
|
||
app_code: app_code,
|
||
app_status: app_status,
|
||
},
|
||
success: (res) => {
|
||
if (res.status == 1) {
|
||
this.$message.success(res.message)
|
||
} else {
|
||
this.$message.error(res.message);
|
||
}
|
||
}
|
||
})
|
||
}
|
||
},
|
||
created() {
|
||
var index = localStorage.active_config_index ? String(localStorage.active_config_index) : '1';
|
||
this.active_config_index = index;
|
||
$.ajax({
|
||
url: "{:U('getConfig')}",
|
||
type: 'post',
|
||
data: {},
|
||
success: (res) => {
|
||
if (res.status == 1) {
|
||
this.wxConfig = res.data.wxConfig;
|
||
this.serverConfig = res.data.serverConfig;
|
||
this.serverConfig = res.data.serverConfig;
|
||
this.continent = res.data.continent;
|
||
this.redis = res.data.redis;
|
||
this.mapConfig = res.data.mapConfig;
|
||
this.websocket = res.data.websocket;
|
||
this.uploadConfig = res.data.uploadConfig;
|
||
this.storage_type = res.data.storage_type;
|
||
this.developer = res.data.developer;
|
||
this.convenient_sign_state = parseInt(res.data.convenient_sign_state);
|
||
this.continentNotify = res.data.continentNotify;
|
||
this.express = res.data.express;
|
||
this.app_status = res.data.app_status == 1 ? true : false;
|
||
this.app_code = res.data.app_code;
|
||
} else {
|
||
this.$message.error(res.msg ? res.msg : "配置获取失败");
|
||
}
|
||
},
|
||
error: (res) => {
|
||
this.$message.error("配置获取失败");
|
||
}
|
||
})
|
||
}
|
||
})
|
||
</script>
|
||
|