|
@@ -1,10 +1,7 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<!--操作区-->
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- icon="el-icon-plus"
|
|
|
- @click="create()"
|
|
|
+ <el-button type="primary" icon="el-icon-plus" @click="create()"
|
|
|
>添加账号</el-button
|
|
|
>
|
|
|
<el-select
|
|
@@ -104,7 +101,7 @@
|
|
|
{{ scope.row.createTime }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" prop="" label="操作区" width="200">
|
|
|
+ <el-table-column align="center" prop="" label="操作区" width="280">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button type="primary" size="small" @click="create(scope.row)"
|
|
|
>编辑</el-button
|
|
@@ -115,6 +112,12 @@
|
|
|
@click="deleteUser(scope.row.id)"
|
|
|
>删除</el-button
|
|
|
>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ @click="getAppKeyAndAppSecret(scope.row)"
|
|
|
+ >下载密钥</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -218,6 +221,8 @@ import {
|
|
|
} from "@/api/user";
|
|
|
import Pagination from "@/components/Pagination";
|
|
|
import { checkRole } from "@/utils/checkRole";
|
|
|
+import { saveAs } from "file-saver"; // 字符串保存成 TXT 文件保存到电脑
|
|
|
+
|
|
|
export default {
|
|
|
components: { Pagination },
|
|
|
filters: {
|
|
@@ -310,6 +315,11 @@ export default {
|
|
|
this.listLoading = false;
|
|
|
});
|
|
|
},
|
|
|
+ getAppKeyAndAppSecret(row) {
|
|
|
+ let str = `appId: ${row.appId}\r\nappKey: ${row.appKey}\r\nappSecret: ${row.appSecret}\r\nprivateKey: ${row.privateKey}`;
|
|
|
+ let strData = new Blob([str], { type: "text/plain;charset=utf-8" });
|
|
|
+ saveAs(strData, "密钥.txt");
|
|
|
+ },
|
|
|
// 打开添加账号对话框
|
|
|
create(row) {
|
|
|
if (row) {
|