Commit cf403500 authored by Davve's avatar Davve

修改视频获取

parent 369f9aee
......@@ -44,11 +44,11 @@ class UserUpdateOrCreate(APIView):
data = {
'user_id': user_id,
'password': password,
'is_recommend': request.POST.get('is_recommend'),
'is_recommend': int(request.POST.get('is_recommend')),
'profile_pic': request.POST.get('avatar')[:-2],
'nick_name': request.POST.get('nick_name'),
'tag_ids': tag_ids,
'is_puppet': request.POST.get('is_puppet'),
'is_puppet': int(request.POST.get('is_puppet')),
'city_id': request.POST.get('city', '').split(":")[0],
'phone': request.POST.get('phone'),
'email': request.POST.get('email'),
......
......@@ -65,7 +65,6 @@ const user = {
setSession(data.session_key)
resolve()
}else{
console.log(data, '-----------')
Message.error(data['message'])
resolve('/login')
}
......
......@@ -10,7 +10,7 @@
<el-row>
<el-col :span="24">
<el-form-item style="margin-bottom: 40px;" prop="username" v-if="isEdit">
<el-form-item style="margin-bottom: 40px;" prop="username" v-if="isShow">
<MDinput v-model="postForm.username" :maxlength="100" name="username" required disabled="disabled">
账号
</MDinput>
......@@ -27,13 +27,7 @@
<el-row>
<el-col :span="24">
<el-form-item style="margin-bottom: 40px;" prop="password" v-if="isEdit">
<MDinput v-model="postForm.password" :maxlength="100" name="password" required disabled="disabled">
密码
</MDinput>
</el-form-item>
<el-form-item style="margin-bottom: 40px;" prop="password" v-else>
<el-form-item style="margin-bottom: 40px;" prop="password" v-show="is_show">
<MDinput v-model="postForm.password" :maxlength="100" name="password" required>
密码
</MDinput>
......@@ -108,6 +102,7 @@
},
data() {
const validateRequire = (rule, value, callback) => {
value = value.trim()
if (value === '') {
this.$message({
message: rule.field + '为必传项',
......@@ -120,6 +115,7 @@
}
const validatePasswordLength = (rule, value, callback) => {
value = value.trim()
if (value === '') {
this.$message({
message: rule.field + '为必传项',
......@@ -141,12 +137,13 @@
loading: false,
userListOptions: [],
rules: {
username: [{validator: validateRequire}],
nick_name: [{validator: validateRequire}],
email: [{validator: validateRequire}],
username: [{validator: validateRequire, trigger: 'blur'}],
nick_name: [{validator: validateRequire, trigger: 'blur'}],
email: [{validator: validateRequire, trigger: 'blur'}],
password: [{validator: validatePasswordLength, trigger: 'blur'}],
phone: [{validator: validateRequire}],
phone: [{validator: validateRequire, trigger: 'blur'}],
},
is_show: true
}
},
created() {
......@@ -163,7 +160,7 @@
fetchData(id) {
fetchAccountDetail(id).then(response => {
this.postForm = response.data.data.data
this.is_show = false
}).catch(err => {
console.log(err)
})
......
......@@ -126,7 +126,7 @@
placeholder="请输入内容"/>
<span v-show="contentShortLength" class="word-counter">{{ contentShortLength }}</span>
</el-form-item>
<el-form-item style="margin-bottom: 40px;" label-width="45px" label="线:">
<el-form-item style="margin-bottom: 40px;" label-width="45px" label="是否在线:">
<el-radio-group v-model="postForm.is_online">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
......
......@@ -3,7 +3,7 @@
<el-form ref="postForm" :model="postForm" :rules="rules" class="form-container">
<sticky :class-name="'sub-navbar '+postForm.status">
<el-button v-loading="loading" style="margin-left: 10px;" type="success" @click="submitForm">保存
<el-button v-loading="loading" style="margin-left: 10px;" type="success" @click="submitForm" :disabled="isdisabledFn">保存
</el-button>
</sticky>
......@@ -31,11 +31,11 @@
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item style="margin-bottom: 20px;" label-width="75px" label="密码:" v-if="isEdit">
<el-input v-model="postForm.password" type="text" style="width: 230px;" disabled/>
</el-form-item>
</el-col>
<!--<el-col :span="12">-->
<!--<el-form-item style="margin-bottom: 20px;" label-width="75px" label="密码:" v-if="isEdit">-->
<!--<el-input v-model="postForm.password" type="text" style="width: 230px;" disabled/>-->
<!--</el-form-item>-->
<!--</el-col>-->
<el-col :span="12">
<el-form-item style="margin-bottom: 20px;" label-width="75px" label="帖子:" v-if="isEdit">
<el-input v-model="postForm.topic_nums" type="text" style="width: 230px;"
......@@ -45,7 +45,7 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item style="margin-bottom: 20px;" label-width="75px" label="用户名:" prop="username">
<el-form-item style="margin-bottom: 20px;" label-width="75px" label="用户名:" prop="nick_name">
<el-input v-model="postForm.nick_name" type="text" style="width: 230px"/>
</el-form-item>
</el-col>
......@@ -70,7 +70,7 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label-width="75px" label="性别:">
<el-form-item label-width="75px" label="性别:" prop="gender">
<el-select v-model="postForm.gender" :placeholder="'性别:'" clearable
class="postInfo-container-item"
style="width: 230px">
......@@ -95,7 +95,7 @@
<el-form-item label-width="75px" label="标签:">
<el-select v-model="tags" :remote-method="getRemoteTagList" filterable remote clearable
multiple value-key="id"
placeholder="搜索地区" style="width: 720px">
placeholder="搜索标签" style="width: 720px">
<el-option v-for="(item,index) in tagListOptions" :key="item+index" :label="item"
:value="item"/>
</el-select>
......@@ -196,9 +196,8 @@
tags: [],
rules: {
image_uri: [{validator: validateRequire, trigger: 'blur'}],
title: [{validator: validateRequire}],
content: [{validator: validateRequire}],
nick_name: [{validator: validateRequire, trigger: 'blur'}],
avatar: [{validator: validateRequire, trigger: 'blur'}],
},
tempRoute: {},
GenderTypeOptions: [
......@@ -208,6 +207,7 @@
regionListOptions: [],
tagListOptions: [],
uploadType: 99,
isdisabledFn: false
}
},
computed: {
......@@ -243,7 +243,17 @@
this.$refs.postForm.validate(valid => {
if (valid) {
this.loading = true
if (this.city === ''){
this.$message.error('城市必填~')
this.loading = false
return false
}
if (this.postForm.gender === ''){
this.$message.error('性别必填~')
this.loading = false
return false
}
this.isdisabledFn = true
this.postForm.city = this.city;
this.postForm.tags = JSON.stringify(this.tags)
userCreate(this.postForm).then(response => {
......
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