|
@@ -23,7 +23,7 @@
|
|
|
/>
|
|
/>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
prop="userNodeDomain"
|
|
prop="userNodeDomain"
|
|
|
- label="节点域名"
|
|
|
|
|
|
|
+ label="绑定域名"
|
|
|
/>
|
|
/>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
prop="referer"
|
|
prop="referer"
|
|
@@ -41,7 +41,7 @@
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
<el-button
|
|
|
size="mini"
|
|
size="mini"
|
|
|
- @click="handleEdit(scope.$index, scope.row)"
|
|
|
|
|
|
|
+ @click="onEditNode(scope.$index, scope.row)"
|
|
|
>编辑</el-button>
|
|
>编辑</el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
size="mini"
|
|
size="mini"
|
|
@@ -101,7 +101,7 @@
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
<el-dialog
|
|
<el-dialog
|
|
|
append-to-body
|
|
append-to-body
|
|
|
- :visible.sync="showNodeDialog"
|
|
|
|
|
|
|
+ :visible.sync="showAddNodeDialog"
|
|
|
center
|
|
center
|
|
|
>
|
|
>
|
|
|
<div>
|
|
<div>
|
|
@@ -152,11 +152,59 @@
|
|
|
</el-form>
|
|
</el-form>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ append-to-body
|
|
|
|
|
+ :visible.sync="showEditNodeDialog"
|
|
|
|
|
+ center
|
|
|
|
|
+ >
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <el-form ref="editNodeForm" :model="editNodeForm">
|
|
|
|
|
+ <el-form-item label="域名" label-width="120px" prop="domain">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="editNodeForm.domain"
|
|
|
|
|
+ placeholder="绑定域名"
|
|
|
|
|
+ style="margin-left: 5px;width: 220px"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="Referer" label-width="120px" prop="domain">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="editNodeForm.referer"
|
|
|
|
|
+ placeholder="referer"
|
|
|
|
|
+ style="margin-left: 5px;width: 220px"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="SecretKey" label-width="120px" prop="domain">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="editNodeForm.secretKey"
|
|
|
|
|
+ placeholder="secretKey"
|
|
|
|
|
+ style="margin-left: 5px;width: 220px"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ plain
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
|
+ style="margin-left: 40px"
|
|
|
|
|
+ @click="updateUserNodeWrapper"
|
|
|
|
|
+ >
|
|
|
|
|
+ 更新
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
</el-container>
|
|
</el-container>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { addUserNode, getStoreNodeKeyValue, getUserKeyList, getUserNodeList, resetUserKey } from '@/api/oss'
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ addUserNode,
|
|
|
|
|
+ getStoreNodeKeyValue,
|
|
|
|
|
+ getUserKeyList,
|
|
|
|
|
+ getUserNodeList,
|
|
|
|
|
+ resetUserKey,
|
|
|
|
|
+ updateUserNode
|
|
|
|
|
+} from '@/api/oss'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'AdminUserNode',
|
|
name: 'AdminUserNode',
|
|
@@ -179,11 +227,18 @@ export default {
|
|
|
videoId: null,
|
|
videoId: null,
|
|
|
scope: 1
|
|
scope: 1
|
|
|
},
|
|
},
|
|
|
- showNodeDialog: false,
|
|
|
|
|
|
|
+ showAddNodeDialog: false,
|
|
|
selectOptionList: [],
|
|
selectOptionList: [],
|
|
|
myNodeForm: {
|
|
myNodeForm: {
|
|
|
storeNodeId: null,
|
|
storeNodeId: null,
|
|
|
domain: null
|
|
domain: null
|
|
|
|
|
+ },
|
|
|
|
|
+ showEditNodeDialog: false,
|
|
|
|
|
+ editNodeForm: {
|
|
|
|
|
+ userNodeId: null,
|
|
|
|
|
+ domain: null,
|
|
|
|
|
+ referer: null,
|
|
|
|
|
+ secretKey: null
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -200,6 +255,9 @@ export default {
|
|
|
} else {
|
|
} else {
|
|
|
this.$message.error(resp.msg)
|
|
this.$message.error(resp.msg)
|
|
|
}
|
|
}
|
|
|
|
|
+ }).catch(error => {
|
|
|
|
|
+ console.log(error)
|
|
|
|
|
+ this.$message.error(error.message)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
onRefresh() {
|
|
onRefresh() {
|
|
@@ -215,7 +273,7 @@ export default {
|
|
|
this.$message.info('handleEdit')
|
|
this.$message.info('handleEdit')
|
|
|
},
|
|
},
|
|
|
handleDelete(index, row) {
|
|
handleDelete(index, row) {
|
|
|
- this.$confirm('确定要删除 ' + row.title + '?', '提示', {
|
|
|
|
|
|
|
+ this.$confirm('确定要删除 ' + row.userNodeDomain + '?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
type: 'warning'
|
|
@@ -259,7 +317,7 @@ export default {
|
|
|
getStoreNodeKeyValue().then(resp => {
|
|
getStoreNodeKeyValue().then(resp => {
|
|
|
if (resp.code === 0) {
|
|
if (resp.code === 0) {
|
|
|
this.selectOptionList = resp.data
|
|
this.selectOptionList = resp.data
|
|
|
- this.showNodeDialog = true
|
|
|
|
|
|
|
+ this.showAddNodeDialog = true
|
|
|
this.myNodeForm.storeNodeId = this.selectOptionList[0].value
|
|
this.myNodeForm.storeNodeId = this.selectOptionList[0].value
|
|
|
} else {
|
|
} else {
|
|
|
this.$message.error(resp.msg)
|
|
this.$message.error(resp.msg)
|
|
@@ -269,7 +327,7 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
addUserNodeWrapper() {
|
|
addUserNodeWrapper() {
|
|
|
- this.showNodeDialog = false
|
|
|
|
|
|
|
+ this.showAddNodeDialog = false
|
|
|
addUserNode(this.myNodeForm).then(resp => {
|
|
addUserNode(this.myNodeForm).then(resp => {
|
|
|
console.log(resp)
|
|
console.log(resp)
|
|
|
this.$message.info(resp.msg)
|
|
this.$message.info(resp.msg)
|
|
@@ -278,6 +336,27 @@ export default {
|
|
|
}).finally(() => {
|
|
}).finally(() => {
|
|
|
this.$refs['myNodeForm'].resetFields()
|
|
this.$refs['myNodeForm'].resetFields()
|
|
|
})
|
|
})
|
|
|
|
|
+ },
|
|
|
|
|
+ onEditNode(index, row) {
|
|
|
|
|
+ this.editNodeForm.userNodeId = row.userNodeId
|
|
|
|
|
+ this.editNodeForm.domain = row.userNodeDomain
|
|
|
|
|
+ this.editNodeForm.referer = row.referer
|
|
|
|
|
+ this.editNodeForm.secretKey = row.secretKey
|
|
|
|
|
+ this.showEditNodeDialog = true
|
|
|
|
|
+ },
|
|
|
|
|
+ updateUserNodeWrapper() {
|
|
|
|
|
+ this.showEditNodeDialog = false
|
|
|
|
|
+ updateUserNode(this.editNodeForm).then(resp => {
|
|
|
|
|
+ if (resp.code === 0) {
|
|
|
|
|
+ this.getData()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(resp.msg)
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(error => {
|
|
|
|
|
+ this.$message.error(error.message)
|
|
|
|
|
+ }).finally(() => {
|
|
|
|
|
+ this.$refs['editNodeForm'].resetFields()
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|