Commit e6633eb4 authored by jiyonggang's avatar jiyonggang

加一个删除按钮

parent a98fb04c
......@@ -612,5 +612,14 @@ export function deleteMaterialById(params) {
params
})
}
export function deleteYouTubeAccountById(params) {
return request({
// url: 'http://localhost:8567/youtube/deleteToken',
url: process.env.PUTIN_API + '/youtube/deleteToken',
method: 'get',
params
})
}
// ----------------------------------------
......@@ -16,12 +16,17 @@
<el-table :data="tokenList" style="width: 100%" border>
<!-- <el-table-column prop="id" label="ID" width="50"></el-table-column>-->
<el-table-column prop="id" label="ID" width="50"></el-table-column>
<!-- <el-table-column prop="appName" label="应用名" ></el-table-column>-->
<!-- <el-table-column prop="pkg" label="包名"></el-table-column>-->
<el-table-column prop="alias" label="别名"></el-table-column>
<el-table-column prop="access_token" label="访问密钥"></el-table-column>
<el-table-column prop="refresh_token" label="刷新密钥"></el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button type="primary" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间" :formatter="formatDate"></el-table-column>
<el-table-column prop="update_time" label="更改时间":formatter="formatDate"></el-table-column>
</el-table>
......@@ -47,7 +52,7 @@ import axios from 'axios';
import ZxAppsSelect from '@/components/ZxAppsSelect'
import vueJsonEditor from "vue-json-editor";
import {getGoogleTokenList} from "../../api/report";
import {getGoogleTokenList,deleteYouTubeAccountById} from "../../api/report";
export default {
components: {vueJsonEditor},
......@@ -108,6 +113,37 @@ export default {
formatDate(row, column, cellValue) {
return moment(cellValue).format('YYYY-MM-DD HH:mm:ss');
},
handleDelete(row) {
this.$confirm('此操作将永久删除该YouTube账户, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
return deleteYouTubeAccountById({ id: row.id });
})
.then(response => {
if (response.status === 1) {
this.$message({
type: 'success',
message: '删除成功!'
});
this.getTokenList();
} else {
this.$message.error('删除失败: ' + response.msg);
}
})
.catch(error => {
if (error === 'cancel') {
this.$message({
type: 'info',
message: '已取消删除'
});
} else {
this.$message.error('删除失败: ' + error);
}
});
}
},
};
</script>
......
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