1
Showing
2 changed files
with
15 additions
and
3 deletions
1 | import { mapState } from "vuex"; | ||
2 | |||
1 | import api from '@/api/api' | 3 | import api from '@/api/api' |
2 | import { | 4 | import { |
3 | formdata, | 5 | formdata, |
... | @@ -50,6 +52,9 @@ export default { | ... | @@ -50,6 +52,9 @@ export default { |
50 | modalComp | 52 | modalComp |
51 | }, | 53 | }, |
52 | computed: { | 54 | computed: { |
55 | ...mapState({ | ||
56 | userInfo: state => state.userInfo | ||
57 | }), | ||
53 | locale() { | 58 | locale() { |
54 | return this.$i18n.locale || 'tc'; | 59 | return this.$i18n.locale || 'tc'; |
55 | }, | 60 | }, |
... | @@ -190,6 +195,11 @@ export default { | ... | @@ -190,6 +195,11 @@ export default { |
190 | 195 | ||
191 | param.policies = policies; | 196 | param.policies = policies; |
192 | httpPost({ url: api.updatePolicyInfo, data: param, sid: true }).then(res => { | 197 | httpPost({ url: api.updatePolicyInfo, data: param, sid: true }).then(res => { |
198 | if (this.isOwner && param.name) { | ||
199 | let userInfo = JSON.parse(JSON.stringify(this.userInfo)); | ||
200 | userInfo.name = param.name; | ||
201 | this.$store.commit("SET_USER_INFO", userInfo); | ||
202 | } | ||
193 | this.loading = false; | 203 | this.loading = false; |
194 | this.showModal(this.i18n.policyChangeInformation.success); | 204 | this.showModal(this.i18n.policyChangeInformation.success); |
195 | }).catch(err => { | 205 | }).catch(err => { | ... | ... |
... | @@ -223,9 +223,11 @@ export default { | ... | @@ -223,9 +223,11 @@ export default { |
223 | message = this.i18n.infomationImprove.successMsg; | 223 | message = this.i18n.infomationImprove.successMsg; |
224 | let path = this.$route.query.c || "/"; | 224 | let path = this.$route.query.c || "/"; |
225 | this.targetPath = path; | 225 | this.targetPath = path; |
226 | this.userInfo.hadFullInfo = 1; | 226 | |
227 | this.userInfo.name = this.information.lastName + this.information.firstName; | 227 | let userInfo = JSON.parse(JSON.stringify(this.userInfo)); |
228 | this.$store.commit("SET_USER_INFO", this.userInfo); | 228 | userInfo.hadFullInfo = 1; |
229 | userInfo.name = this.information.lastName + this.information.firstName; | ||
230 | this.$store.commit("SET_USER_INFO", userInfo); | ||
229 | // this.showModal(message, "succ"); | 231 | // this.showModal(message, "succ"); |
230 | this.modalCallback(); | 232 | this.modalCallback(); |
231 | break; | 233 | break; | ... | ... |
-
Please register or sign in to post a comment