|
@@ -43,6 +43,12 @@
|
|
|
<el-button type="primary" size="mini" @click="warrantHandle">新增企业</el-button>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <div style="padding-top: 9px;font-size: 12px;margin-left: 5px">服务商(点击授权):</div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5" v-for="item in providerList" :key="item.id">
|
|
|
+ <el-button size="mini" @click="getCode(item.id)">{{ item.proxyName }}</el-button>
|
|
|
+ </el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
@@ -68,7 +74,6 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="配置状态" prop="configStatus" align="center" width="120">
|
|
|
-
|
|
|
<template slot-scope="scope">
|
|
|
<el-tag type="success" v-if="scope.row.configStatus === 'SUCCESS'">配置成功</el-tag>
|
|
|
<el-tag type="warning" v-else-if="scope.row.configStatus === 'ING'">未配置</el-tag>
|
|
@@ -76,7 +81,6 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="回调地址" prop="externalUserCallbackUrl" width="200" :show-overflow-tooltip="true">
|
|
|
-
|
|
|
<template slot-scope="scope">
|
|
|
<a style="color: #1890ff;" @click="copy(scope.row.externalUserCallbackUrl)">{{
|
|
|
scope.row.externalUserCallbackUrl }}</a>
|
|
@@ -151,15 +155,20 @@
|
|
|
|
|
|
<modal-corp :visible="corpVisible" :modifyData="corpData" :modalTitle="corpTitle" @onClose="corpVisible = false"
|
|
|
@onChange="corpVisible = false; getList()" />
|
|
|
+
|
|
|
+ <el-dialog title="扫码授权" :visible.sync="codeVisible" width="240px" :before-close="handleCodeClose">
|
|
|
+ <canvas ref="qrcodeCanvas"></canvas>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getCorpToAuth, getCorpList, putRefreshCorp, putSyncAllCorpUser } from "@/api/accounts/corpWeChat";
|
|
|
+import { getProviderAuth, getCorpList, getProviderList, putSyncAllCorpUser } from "@/api/accounts/corpWeChat";
|
|
|
import setSecret from './setSecret.vue'
|
|
|
import mailList from './mailList.vue'
|
|
|
import setSession from './setSession.vue'
|
|
|
import ModalCorp from './modalCorp.vue'
|
|
|
+import QRCode from 'qrcode';
|
|
|
export default {
|
|
|
name: 'corp',
|
|
|
components: { setSecret, mailList, setSession, ModalCorp },
|
|
@@ -188,7 +197,9 @@ export default {
|
|
|
|
|
|
corpVisible: false,
|
|
|
corpData: null,
|
|
|
- corpTitle: '新增企业'
|
|
|
+ corpTitle: '新增企业',
|
|
|
+ providerList: [],
|
|
|
+ codeVisible: false,
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -200,6 +211,9 @@ export default {
|
|
|
window.removeEventListener('storage', this.listener, false)
|
|
|
},
|
|
|
created() {
|
|
|
+ getProviderList().then(res => {
|
|
|
+ this.providerList = res.data
|
|
|
+ })
|
|
|
this.getList()
|
|
|
},
|
|
|
filters: {
|
|
@@ -217,6 +231,21 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ getCode(id) {
|
|
|
+ getProviderAuth({ sysProxyId: id }).then(res => {
|
|
|
+ this.codeVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ const canvas = this.$refs.qrcodeCanvas;
|
|
|
+ QRCode.toCanvas(canvas, res.data.qrCodeURL, { width: 200 }, function (error) {
|
|
|
+ if (error) console.error('------->', error);
|
|
|
+ console.log('QR code generated successfully!');
|
|
|
+ });
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleCodeClose() {
|
|
|
+ this.codeVisible = false
|
|
|
+ },
|
|
|
copy(str) {
|
|
|
let element = document.createElement("textarea");
|
|
|
element.id = 'myTextarea'
|