Commit d7efad0c authored by Davve's avatar Davve

细节问题

parent 20d3df11
...@@ -60,9 +60,7 @@ class TagUpdateOrCreateView(APIView): ...@@ -60,9 +60,7 @@ class TagUpdateOrCreateView(APIView):
'up_tags': up_tags, 'up_tags': up_tags,
} }
try: try:
self.rpc['venus/sun/tag/edit'](id=id, data=data).unwrap() data = self.rpc['venus/sun/tag/edit'](id=id, data=data).unwrap()
except Exception as e: except Exception as e:
raise e raise e
return { return data
'message': '操作成功' \ No newline at end of file
}
\ No newline at end of file
...@@ -180,7 +180,6 @@ ...@@ -180,7 +180,6 @@
this.loading = false; this.loading = false;
return false; return false;
} }
console.log(typeof response.data.data.code)
this.$notify({ this.$notify({
title: '成功', title: '成功',
message: response.data.data.message, message: response.data.data.message,
......
...@@ -143,15 +143,15 @@ ...@@ -143,15 +143,15 @@
</div> </div>
<div style="margin-bottom:50px;"> <div style="margin-bottom:50px;">
<div class="filter-container"> <div class="filter-container">
<el-select v-model="celebrity_id" :remote-method="getRemoteCelebrityList" filterable remote clearable <!--<el-select v-model="celebrity_id" :remote-method="getRemoteCelebrityList" filterable remote clearable-->
value-key="id" <!--value-key="id"-->
placeholder="添加明星" style="width: 220px"> <!--placeholder="添加明星" style="width: 220px">-->
<el-option v-for="(item,index) in celebrityListOptions" :key="item+index" <!--<el-option v-for="(item,index) in celebrityListOptions" :key="item+index"-->
:label="item" :value="item"/> <!--:label="item" :value="item"/>-->
</el-select> <!--</el-select>-->
<el-button v-waves class="filter-item" type="primary" icon="el-icon-edit" @click="append">添加 <!--<el-button v-waves class="filter-item" type="primary" icon="el-icon-edit" @click="append">添加-->
</el-button> <!--</el-button>-->
<el-button v-waves class="filter-item" type="primary" icon="el-icon-delete" @click="del">移除 <el-button v-waves class="filter-item" type="primary" icon="el-icon-delete" @click="del">移除
</el-button> </el-button>
</div> </div>
...@@ -215,15 +215,15 @@ ...@@ -215,15 +215,15 @@
</div> </div>
<div style="margin-bottom:50px;"> <div style="margin-bottom:50px;">
<div class="filter-container"> <div class="filter-container">
<el-select v-model="topic_id" :remote-method="getRemoteTopicList" filterable remote clearable <!--<el-select v-model="topic_id" :remote-method="getRemoteTopicList" filterable remote clearable-->
value-key="id" <!--value-key="id"-->
placeholder="添加帖子" style="width: 220px"> <!--placeholder="添加帖子" style="width: 220px">-->
<el-option v-for="(item, index) in topicListOptions" :key="item+index" <!--<el-option v-for="(item, index) in topicListOptions" :key="item+index"-->
:label="item" :value="item"/> <!--:label="item" :value="item"/>-->
</el-select> <!--</el-select>-->
<el-button v-waves class="filter-item" type="primary" icon="el-icon-edit" @click="append">添加 <!--<el-button v-waves class="filter-item" type="primary" icon="el-icon-edit" @click="append">添加-->
</el-button> <!--</el-button>-->
<el-button v-waves class="filter-item" type="primary" icon="el-icon-delete" @click="del">移除 <el-button v-waves class="filter-item" type="primary" icon="el-icon-delete" @click="del">移除
</el-button> </el-button>
</div> </div>
......
...@@ -131,6 +131,7 @@ ...@@ -131,6 +131,7 @@
}, },
data() { data() {
const validateRequire = (rule, value, callback) => { const validateRequire = (rule, value, callback) => {
value = value.trim()
if (value === '') { if (value === '') {
this.$message({ this.$message({
message: rule.field + '为必传项', message: rule.field + '为必传项',
...@@ -209,6 +210,17 @@ ...@@ -209,6 +210,17 @@
this.postForm.up_tags = JSON.stringify(this.up_tags) this.postForm.up_tags = JSON.stringify(this.up_tags)
this.postForm.down_tags = JSON.stringify(this.down_tags); this.postForm.down_tags = JSON.stringify(this.down_tags);
CreateTag(this.postForm).then(response => { CreateTag(this.postForm).then(response => {
console.log()
if (response.data.data.code == 500) {
this.$notify({
title: '失败',
message: response.data.data.message,
type: 'error',
duration: 2000
})
this.loading = false
return false
}
this.$notify({ this.$notify({
title: '成功', title: '成功',
message: response.data.data.message, message: response.data.data.message,
......
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