pull/9/head
ruibaby 6 years ago
parent 70b85cf76f
commit 5725103c4b

@ -19,7 +19,6 @@ linkApi.create = (link) => {
}) })
} }
linkApi.get = linkId => { linkApi.get = linkId => {
return service({ return service({
url: `${baseUrl}/${linkId}`, url: `${baseUrl}/${linkId}`,

@ -1,7 +1,13 @@
<template> <template>
<div class="page-header-index-wide"> <div class="page-header-index-wide">
<a-row :gutter="12"> <a-row :gutter="12">
<a-col :xl="10" :lg="10" :md="10" :sm="24" :xs="24" :style="{ 'padding-bottom': '12px' }"> <a-col
:xl="10"
:lg="10"
:md="10"
:sm="24"
:xs="24"
:style="{ 'padding-bottom': '12px' }">
<a-card :title="title"> <a-card :title="title">
<a-form layout="horizontal"> <a-form layout="horizontal">
<a-form-item label="网站名称:"> <a-form-item label="网站名称:">
@ -29,7 +35,13 @@
</a-form> </a-form>
</a-card> </a-card>
</a-col> </a-col>
<a-col :xl="14" :lg="14" :md="14" :sm="24" :xs="24" :style="{ 'padding-bottom': '12px' }"> <a-col
:xl="14"
:lg="14"
:md="14"
:sm="24"
:xs="24"
:style="{ 'padding-bottom': '12px' }">
<a-card title="所有友情链接"> <a-card title="所有友情链接">
<a-table <a-table
:columns="columns" :columns="columns"
@ -135,13 +147,14 @@ export default {
createOrUpdateLink() { createOrUpdateLink() {
if (this.link.id) { if (this.link.id) {
linkApi.update(this.link.id, this.link).then(response => { linkApi.update(this.link.id, this.link).then(response => {
this.loadLinks() this.$message.success('更新成功!')
}) })
} else { } else {
linkApi.create(this.link).then(response => { linkApi.create(this.link).then(response => {
this.loadLinks() this.$message.success('保存成功!')
}) })
} }
this.loadLinks()
this.link = {} this.link = {}
} }
} }

Loading…
Cancel
Save