diff --git a/epmet-oper-web/src/js/columns/miniPro/partnerApp.js b/epmet-oper-web/src/js/columns/miniPro/partnerApp.js
index f3d1056..846e427 100644
--- a/epmet-oper-web/src/js/columns/miniPro/partnerApp.js
+++ b/epmet-oper-web/src/js/columns/miniPro/partnerApp.js
@@ -38,12 +38,12 @@ export default [{
block: true,
width: 40
},
-{
- key: 'secret',
- title: '秘钥',
- display: ['formA', 'formU', 'table', 'model'],
- fixed: false,
- block: true,
- width: 200
-},
+// {
+// key: 'secret',
+// title: '秘钥',
+// display: ['formA', 'formU', 'table', 'model'],
+// fixed: false,
+// block: true,
+// width: 200
+// },
]
diff --git a/epmet-oper-web/src/views/modules/partner/app/index.vue b/epmet-oper-web/src/views/modules/partner/app/index.vue
index 4eac9e1..737c16b 100644
--- a/epmet-oper-web/src/views/modules/partner/app/index.vue
+++ b/epmet-oper-web/src/views/modules/partner/app/index.vue
@@ -51,14 +51,41 @@
:operationWidth="80"
:operations="operations"
@editShow="editShow"
- @copySecret="copySecret"
- @resetSecret="resetSecret"
+ @showSecrets="showSecrets"
@del="del">
+
+
+
+
+
+
+
+ 重置
+
+
+
+
+ 重置
+
+
+
@@ -78,6 +105,7 @@ import { requestPost } from "@/js/dai/request";
import { envIsDev, mockUrlPrefix } from "@/js/dai/config";
import { Loading } from "element-ui";
import nextTick from "dai-js/tools/nextTick";
+import params from "@/views/modules/sys/params.vue";
// 当前是否是开发环境
const isMockEnv = envIsDev && false;
@@ -89,11 +117,19 @@ export default {
data () {
return {
+ // 当前操作的appId
+ currAppId: null,
+ // 是否显示密钥对话框
+ isShowSecretsDlgShow: false,
+ secrets: {
+ symSecret: null,
+ asymSecretPublic: null
+ },
tableUrl: requestUrlPrefix + "/commonservice/externalapp/list",
// 查询条件
tableParams: {
customerId: "",
- customerType: "internal",
+ customerType: "external",
},
operations: [
@@ -110,30 +146,42 @@ export default {
},
},
{
- lable: "复制秘钥", // 按钮显示名称
- size: "mini",
- style: "margin: 0 6px;",
- type: "text",
- slot: "",
- plain: false,
- methodName: "copySecret", // 回调方法名称
- isShow: (row) => {
- return true;
- },
- },
- {
- lable: "重置秘钥", // 按钮显示名称
+ lable: "查看秘钥", // 按钮显示名称
size: "mini",
style: "margin: 0 6px;",
type: "text",
slot: "",
plain: false,
- methodName: "resetSecret", // 回调方法名称
+ methodName: "showSecrets", // 回调方法名称
isShow: (row) => {
return true;
},
},
// {
+ // lable: "复制秘钥", // 按钮显示名称
+ // size: "mini",
+ // style: "margin: 0 6px;",
+ // type: "text",
+ // slot: "",
+ // plain: false,
+ // methodName: "copySecret", // 回调方法名称
+ // isShow: (row) => {
+ // return true;
+ // },
+ // },
+ // {
+ // lable: "重置秘钥", // 按钮显示名称
+ // size: "mini",
+ // style: "margin: 0 6px;",
+ // type: "text",
+ // slot: "",
+ // plain: false,
+ // methodName: "resetSecret", // 回调方法名称
+ // isShow: (row) => {
+ // return true;
+ // },
+ // },
+ // {
// lable: "删除", // 按钮显示名称
// size: "mini",
// style: "margin: 0 6px;",
@@ -280,6 +328,80 @@ export default {
editDiaOK () {
this.refresh();
},
+
+ /**
+ * 显示密钥
+ */
+ showSecrets(row) {
+ // 查询密钥
+ this.currAppId = row.appId
+ let url = `/commonservice/externalapp/getSecrets`;
+ let params = {
+ appId: row.appId
+ }
+ window.app.ajax.get(
+ url,
+ params,
+ (data, msg) => {
+ this.secrets.symSecret = data.symSecret
+ this.secrets.asymSecretPublic = data.asymSecretPublic
+ },
+ (data, msg) => {
+
+ })
+
+ this.isShowSecretsDlgShow = true
+ },
+
+ /**
+ * 重置对称加密密钥
+ */
+ resetSymSecret() {
+ this.$confirm('确认重置?', '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }).then(() => {
+ let url = "/commonservice/externalapp/resetSymSecret";
+ let params = {
+ appId: this.currAppId
+ }
+
+ window.app.ajax.post(url, params,
+ (data, msg) => {
+ this.$message.success('重置成功')
+ this.secrets.symSecret = data;
+ },
+ (msg, data) => {
+ this.$message.info('重置失败')
+ })
+ })
+ },
+
+ /**
+ * 重置非对称加密密钥
+ */
+ resetAsymSecret() {
+ this.$confirm('确认重置?', '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }).then(() => {
+ let url = "/commonservice/externalapp/resetAsymSecrets";
+ let params = {
+ appId: this.currAppId
+ }
+
+ window.app.ajax.post(url, params,
+ (data, msg) => {
+ this.$message.success('重置成功')
+ this.secrets.asymSecretPublic = data.publicKey;
+ },
+ (msg, data) => {
+ this.$message.info('重置失败')
+ })
+ })
+ }
},
};