|
|
@@ -4,38 +4,65 @@
|
|
|
|
|
|
<el-container>
|
|
|
<el-card class="center-card">
|
|
|
- <template>
|
|
|
<router-link class="goback-btn "to="/item/index">{{$t('goback')}}</router-link>
|
|
|
- <el-tabs value="first" type="card">
|
|
|
-
|
|
|
- <el-tab-pane :label="$t('modify_password')" name="first">
|
|
|
-
|
|
|
- <el-form status-icon label-width="0px" class="passwordForm" v-model="passwordForm">
|
|
|
- <el-form-item label="" >
|
|
|
- <el-input type="text" auto-complete="off" v-model="passwordForm.username" placeholder="" :disabled="true"></el-input>
|
|
|
+ <el-form status-icon label-width="75px" class="infoForm" v-model="infoForm">
|
|
|
+ <el-form-item :label="$t('username')+':'" >
|
|
|
+ <el-input type="text" auto-complete="off" v-model="infoForm.username" :disabled="true" placeholder="" ></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="" >
|
|
|
- <el-input type="password" auto-complete="off" :placeholder="$t('old_password')" v-model="passwordForm.password"></el-input>
|
|
|
+ <!--
|
|
|
+ <el-form-item :label="$t('email')+':'" >
|
|
|
+ <span>{{emailForm.email}}({{emailForm.status}})</span> <a href="javasript:;" @click="dialogEmailFormVisible = true">{{$t("modify")}}</a>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="" >
|
|
|
- <el-input type="password" auto-complete="off" v-model="passwordForm.new_password" :placeholder="$t('new_password')"></el-input>
|
|
|
+ -->
|
|
|
+ <el-form-item :label="$t('name')+':'" >
|
|
|
+ <el-input type="text" auto-complete="off" v-model="infoForm.name" :placeholder="$t('name_tips')" ></el-input>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="" >
|
|
|
- <el-button type="primary" style="width:100%;" @click="passwordFormSubmit" >{{$t('submit')}}</el-button>
|
|
|
+ <el-form-item :label="$t('password')+':'">
|
|
|
+ <a href="javasript:;" @click="dialogPasswordFormVisible = true">{{$t("modify")}}</a>
|
|
|
</el-form-item>
|
|
|
|
|
|
- </el-form>
|
|
|
-
|
|
|
- </el-tab-pane>
|
|
|
+ <el-button type="primary" style="width:100%;" @click="formSubmit" >{{$t('submit')}}</el-button>
|
|
|
|
|
|
|
|
|
- </el-tabs>
|
|
|
- </template>
|
|
|
+ </el-form>
|
|
|
</el-card>
|
|
|
</el-container>
|
|
|
|
|
|
+ <!-- 修改email弹窗 -->
|
|
|
+ <el-dialog :visible.sync="dialogEmailFormVisible" top="10vh" width="300px">
|
|
|
+ <el-form class="emailForm">
|
|
|
+ <el-form-item label="" >
|
|
|
+ <el-input type="text" auto-complete="off" :placeholder="$t('input_email')" v-model="emailForm.email"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="" >
|
|
|
+ <el-input type="password" auto-complete="off" v-model="emailForm.password" :placeholder="$t('input_login_password')"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogEmailFormVisible = false">{{$t('cancel')}}</el-button>
|
|
|
+ <el-button type="primary" @click="emailFormSubmit" >{{$t('confirm')}}</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 修改密码弹窗 -->
|
|
|
+ <el-dialog :visible.sync="dialogPasswordFormVisible" top="10vh" width="300px">
|
|
|
+ <el-form class="emailForm">
|
|
|
+ <el-form-item label="" >
|
|
|
+ <el-input type="password" auto-complete="off" :placeholder="$t('old_password')" v-model="passwordForm.password"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="" >
|
|
|
+ <el-input type="password" auto-complete="off" v-model="passwordForm.new_password" :placeholder="$t('new_password')"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogPasswordFormVisible = false">{{$t('cancel')}}</el-button>
|
|
|
+ <el-button type="primary" @click="passwordFormSubmit" >{{$t('confirm')}}</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<Footer> </Footer>
|
|
|
|
|
|
</div>
|
|
|
@@ -51,20 +78,23 @@ export default {
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
- passwordForm:{
|
|
|
+ infoForm:{
|
|
|
username:'',
|
|
|
- password:'',
|
|
|
- new_password:''
|
|
|
+ name:'',
|
|
|
+ },
|
|
|
+ userInfo:{
|
|
|
+
|
|
|
},
|
|
|
emailForm:{
|
|
|
- status:'',
|
|
|
email:'',
|
|
|
+ status:'',
|
|
|
+ },
|
|
|
+ passwordForm:{
|
|
|
password:'',
|
|
|
- submit_text:''
|
|
|
+ new_password:'',
|
|
|
},
|
|
|
- userInfo:{
|
|
|
-
|
|
|
- }
|
|
|
+ dialogEmailFormVisible:false,
|
|
|
+ dialogPasswordFormVisible:false,
|
|
|
}
|
|
|
|
|
|
},
|
|
|
@@ -81,17 +111,18 @@ export default {
|
|
|
that.userInfo = userInfo;
|
|
|
that.passwordForm.username = userInfo.username;
|
|
|
that.emailForm.email = userInfo.email ;
|
|
|
- var status = that.$t("status")+':';
|
|
|
+ that.infoForm.username = userInfo.username ;
|
|
|
+ that.infoForm.name = userInfo.name ;
|
|
|
if (userInfo.email.length > 0 ) {
|
|
|
that.emailForm.submit_text =that.$t("modify") ;
|
|
|
if (userInfo.email_verify > 0 ) {
|
|
|
- status += that.$t("status_1");
|
|
|
+ status = that.$t("status_1");
|
|
|
|
|
|
}else{
|
|
|
- status += that.$t("status_2");
|
|
|
+ status = that.$t("status_2");
|
|
|
}
|
|
|
}else{
|
|
|
- status += that.$t("status_3");
|
|
|
+ status = that.$t("status_3");
|
|
|
that.emailForm.submit_text =that.$t("binding") ;
|
|
|
}
|
|
|
that.emailForm.status = status ;
|
|
|
@@ -115,14 +146,11 @@ export default {
|
|
|
that.axios.post(url, params)
|
|
|
.then(function (response) {
|
|
|
if (response.data.error_code === 0 ) {
|
|
|
- that.$message.success(that.$t("modify_success"));
|
|
|
+ that.dialogPasswordFormVisible = false;
|
|
|
}else{
|
|
|
that.$alert(response.data.error_message);
|
|
|
}
|
|
|
|
|
|
- })
|
|
|
- .catch(function (error) {
|
|
|
- console.log(error);
|
|
|
});
|
|
|
},
|
|
|
emailFormSubmit(){
|
|
|
@@ -136,17 +164,31 @@ export default {
|
|
|
that.axios.post(url, params)
|
|
|
.then(function (response) {
|
|
|
if (response.data.error_code === 0 ) {
|
|
|
- that.$alert(that.$t("update_email_success"));
|
|
|
+ that.dialogEmailFormVisible = false;
|
|
|
+ this.get_user_info();
|
|
|
+ }else{
|
|
|
+ that.$alert(response.data.error_message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ formSubmit(){
|
|
|
+ var that = this ;
|
|
|
+ var url = DocConfig.server+'/api/user/updateInfo';
|
|
|
+
|
|
|
+ var params = new URLSearchParams();
|
|
|
+ params.append('name', this.infoForm.name);
|
|
|
+
|
|
|
+ that.axios.post(url, params)
|
|
|
+ .then(function (response) {
|
|
|
+ if (response.data.error_code === 0 ) {
|
|
|
+ that.$message.success(that.$t("modify_success"));
|
|
|
this.get_user_info();
|
|
|
}else{
|
|
|
that.$alert(response.data.error_message);
|
|
|
}
|
|
|
|
|
|
- })
|
|
|
- .catch(function (error) {
|
|
|
- console.log(error);
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
|
|
|
mounted(){
|
|
|
@@ -177,14 +219,15 @@ export default {
|
|
|
height: 500px;
|
|
|
}
|
|
|
|
|
|
-.passwordForm,.emailForm{
|
|
|
- width:300px;
|
|
|
- margin: 0 auto ;
|
|
|
- margin-top: 50px;
|
|
|
-}
|
|
|
-
|
|
|
.goback-btn{
|
|
|
z-index: 999;
|
|
|
margin-left: 500px;
|
|
|
}
|
|
|
+
|
|
|
+.infoForm{
|
|
|
+ width: 350px;
|
|
|
+ margin: 0 auto ;
|
|
|
+ margin-top: 30px;
|
|
|
+ text-align: left;
|
|
|
+}
|
|
|
</style>
|