From a778d5e53e74b2170e37607b2536a957dbc1d664 Mon Sep 17 00:00:00 2001
From: yj <2077506045@qq.com>
Date: 星期一, 25 十一月 2024 13:59:58 +0800
Subject: [PATCH] 合并本地修改

---
 src/views/demography/index.vue |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/views/demography/index.vue b/src/views/demography/index.vue
index 99fe45b..0b0b52a 100644
--- a/src/views/demography/index.vue
+++ b/src/views/demography/index.vue
@@ -107,21 +107,20 @@
       paramsInfo: {},
       parasInfos: [],
       parasInfoIds: {},
-      formDo: {},
+      // formDo: {},
       submitDisable: false,
       isStart: this.$route.query.isStart === 'true'
     }
   },
   created () {
-    const langType = localStorage.getItem('langType')
-    if (langType) {
+    const langType = this.$route.query.langType
+    if (langType && (langType === 'Chinese' || langType === 'English' || langType === 'Thai')) {
       this.setLangType(langType)
     } else {
-      localStorage.setItem('langType', this.langType)
+      this.setLangType('English')
     }
   },
   beforeDestroy () {
-    localStorage.removeItem('langType')
   },
   beforeUpdate () {
   },
@@ -152,13 +151,13 @@
           demographyApi.submitDemography(_this.memberToken, _this.langType, _this.parasInfos).then(function (result) {
             if (result && result.code === 1) {
               examPaperApi.select(_this.memberToken, _this.langType).then(re => {
-                _this.formDo = re.response
+                _this.setFormDo(re.response)
                 _this.setDoUrl(re.response.questionTemplateId)
                 if (_this.isStart) {
                   _this.$router.push({ path: '/exam/' + _this.doUrl })
                   return
                 }
-                _this.$router.push({ path: '/guide/index', query: { formDo: _this.formDo } });
+                _this.$router.push({ path: '/guide/index', query: { formDo: _this.formDo } })
               }).catch(e => {
                 _this.$message.error(_this.$t('noquestionMsg'))
               })
@@ -205,7 +204,8 @@
     },
     ...mapMutations('user', ['setMemberTocken']),
     ...mapMutations('exam', ['setDoUrl']),
-    ...mapMutations('user', ['setLangType'])
+    ...mapMutations('user', ['setLangType']),
+    ...mapMutations('user', ['setFormDo'])
   },
   computed: {
     ...mapState('user', { memberToken: state => state.memberToken }),

--
Gitblit v1.9.1