From 0cafd0c7f32c961ccf76dff2b813bf93f7fc049b Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 22 Oct 2019 17:24:41 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=B3=BB=E7=BB=9F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/baseUrl.js | 4 +- src/views/designPlatform/demonList.vue | 1 - src/views/lesson/details.vue | 48 ++++++-- src/views/lesson/home.vue | 30 ++--- .../lessoncategory/edit/chapter/index.vue | 12 +- .../lessoncategory/edit/lesson/index.vue | 9 +- src/views/lesson/lessoncategory/index.vue | 23 ++++ src/views/lesson/operateMenu.vue | 107 ++++++++++++++++++ src/views/teach/detail/index.vue | 1 + 9 files changed, 199 insertions(+), 36 deletions(-) create mode 100644 src/views/lesson/operateMenu.vue diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 5935e41a6..871e8ec9c 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -3,9 +3,9 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 - BASE_API = 'http://192.168.3.6:9000'; // 旭强 + // BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 王兴杰 } else { BASE_API = process.env.VUE_APP_BASE_API; diff --git a/src/views/designPlatform/demonList.vue b/src/views/designPlatform/demonList.vue index 3acbc2e59..098e8b2c1 100644 --- a/src/views/designPlatform/demonList.vue +++ b/src/views/designPlatform/demonList.vue @@ -29,7 +29,6 @@ diff --git a/src/views/lesson/lessoncategory/edit/lesson/index.vue b/src/views/lesson/lessoncategory/edit/lesson/index.vue index 145c7fd30..2d3342d5f 100644 --- a/src/views/lesson/lessoncategory/edit/lesson/index.vue +++ b/src/views/lesson/lessoncategory/edit/lesson/index.vue @@ -57,9 +57,10 @@ diff --git a/src/views/lesson/lessoncategory/index.vue b/src/views/lesson/lessoncategory/index.vue index 5c6a63fda..496b0030f 100644 --- a/src/views/lesson/lessoncategory/index.vue +++ b/src/views/lesson/lessoncategory/index.vue @@ -46,6 +46,28 @@ export default { return this.$store.state.app.height - 125; } }, + watch: { + $route() { + const data = this.$route.query; + switch (this.$route.params.type) { + case 'lessonCreate': + this.lessonCreate(data); + break; + case 'lessonEdit': + this.lessonEdit(data); + break; + case 'chapterCreate': + this.chapterCreate(data); + break; + case 'chapterEdit': + this.chapterEdit(data); + break; + case 'treeSort': + this.treeSort(data); + break; + } + } + }, mounted() { const data = this.$route.query; switch (this.$route.params.type) { @@ -112,6 +134,7 @@ export default { }); }, refresh(filterSelect) { + this.$emit('refresh'); } } }; diff --git a/src/views/lesson/operateMenu.vue b/src/views/lesson/operateMenu.vue new file mode 100644 index 000000000..1962045df --- /dev/null +++ b/src/views/lesson/operateMenu.vue @@ -0,0 +1,107 @@ + + + diff --git a/src/views/teach/detail/index.vue b/src/views/teach/detail/index.vue index 1f3805e19..3af7d8448 100644 --- a/src/views/teach/detail/index.vue +++ b/src/views/teach/detail/index.vue @@ -15,6 +15,7 @@ :props="defaultProps" :filter-node-method="filterNode" highlight-current + default-expand-all :default-expanded-keys="expandList" :span="22" @node-click="clickEvent" From 61b9c9705c833fb854fef5cb8644a12eea144a1d Mon Sep 17 00:00:00 2001 From: sunzhenyu Date: Tue, 22 Oct 2019 17:33:17 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jlmap3d/main/loaders/AssetLoader.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/jlmap3d/main/loaders/AssetLoader.js b/src/jlmap3d/main/loaders/AssetLoader.js index 9410a6329..1996acd77 100644 --- a/src/jlmap3d/main/loaders/AssetLoader.js +++ b/src/jlmap3d/main/loaders/AssetLoader.js @@ -9,7 +9,7 @@ let defaultsignal = { deviceType:"signal", type:"low", picUrl:"", - assetUrl:"https://test.joylink.club/oss/models/signal/d3d.FBX" + assetUrl:"https://joylink.club/oss/models/signal/d3d.FBX" } let defaulttrain = { @@ -18,7 +18,7 @@ let defaulttrain = { deviceType:"train", type:"num4", picUrl:"", - assetUrl:"https://test.joylink.club/oss/models/train/train.FBX" + assetUrl:"https://joylink.club/oss/models/train/train.FBX" } @@ -28,7 +28,7 @@ let defaultstation = { deviceType:"stand", type:"num4", picUrl:"", - assetUrl:"https://test.joylink.club/oss/models/station/fuzhou/fuzhou.FBX" + assetUrl:"https://joylink.club/oss/models/station/fuzhou/fuzhou.FBX" } //https://test.joylink.club/oss/models/station/fuzhou/fuzhou.FBX //https://joylink.club/oss/models/station/fuzhou/fuzhou.FBX @@ -58,7 +58,7 @@ let defaultsuidao = { deviceType:"suidao", type:"suidao", picUrl:"", - assetUrl:"https://test.joylink.club/oss/models/suidao/suidao.FBX" + assetUrl:"https://joylink.club/oss/models/suidao/suidao.FBX" } //https://test.joylink.club/oss/models/suidao/suidao.FBX //https://joylink.club/oss/models/suidao/suidao.FBX @@ -70,7 +70,7 @@ let defaultautorail = { deviceType:"autorail", type:"autorail", picUrl:"", - assetUrl:"../../static/model/auto/rail.FBX" + assetUrl:"https://joylink.club/oss/models/auto/rail.FBX" } let defaultautosuidao = { @@ -79,7 +79,7 @@ let defaultautosuidao = { deviceType:"autosuidao", type:"autosuidao", picUrl:"", - assetUrl:"https://test.joylink.club/oss/models/auto/suidao.FBX" + assetUrl:"https://joylink.club/oss/models/auto/suidao.FBX" } let autoswitch1 = { @@ -88,7 +88,7 @@ let autoswitch1 = { deviceType:"autoswitch1", type:"fuzhou", picUrl:"", - assetUrl:"https://test.joylink.club/oss/models/auto/switch1.FBX" + assetUrl:"https://joylink.club/oss/models/auto/switch1.FBX" } let autoswitch2 = { @@ -97,7 +97,7 @@ let autoswitch2 = { deviceType:"autoswitch2", type:"fuzhou", picUrl:"", - assetUrl:"https://test.joylink.club/oss/models/auto/switch2.FBX" + assetUrl:"https://joylink.club/oss/models/auto/switch2.FBX" } export function AssetLoader(){ From 9134be8c19bb7e453803073bba64d631aa07b662 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 22 Oct 2019 18:18:21 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E9=97=AE=E9=A2=98=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 10 +++--- src/utils/baseUrl.js | 4 +-- src/views/exam/index.vue | 5 +++ src/views/lesson/home.vue | 2 +- src/views/teach/detail/index.vue | 2 ++ src/views/teach/index.vue | 1 + src/views/trainingPlatform/demonList.vue | 42 ++++++++---------------- 7 files changed, 30 insertions(+), 36 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index bdbd75af7..74914726c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -358,11 +358,11 @@ export const asyncRouter = [ component: Mapedit, hidden: true }, - // { - // path: 'lesson/edit/:type', - // component: LessonEdit, - // hidden: true - // }, + { + path: 'lesson/edit/:type', + component: LessonEdit, + hidden: true + }, { path: 'runPlan/detail/:mapId', component: PlanMonitorDetail, diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 871e8ec9c..f997f31f4 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -3,8 +3,8 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - BASE_API = 'https://test.joylink.club/jlcloud'; - // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 + // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 王兴杰 } else { diff --git a/src/views/exam/index.vue b/src/views/exam/index.vue index 8db0c5593..c3488eea7 100644 --- a/src/views/exam/index.vue +++ b/src/views/exam/index.vue @@ -46,6 +46,11 @@ export default { loading: false }; }, + watch: { + $route(newVal) { + this.loadInitPage(); + } + }, mounted() { this.loadInitPage(); }, diff --git a/src/views/lesson/home.vue b/src/views/lesson/home.vue index 26371797e..d7df8978f 100644 --- a/src/views/lesson/home.vue +++ b/src/views/lesson/home.vue @@ -314,7 +314,7 @@ export default { }); }, treeSort(index, row) { - this.$router.push({path: `${UrlConfig.design.lessonEdit}/treeSort`, query: row}); + this.$router.push({path: `${UrlConfig.design.lessonEdit}/treeSort`, query: {id: row.id}}); }, taskManage() { this.$router.push({path: `${UrlConfig.design.taskManage}`, query: {mapId: this.$route.params.mapId, skinCode: this.$route.params.skinCode}}); diff --git a/src/views/teach/detail/index.vue b/src/views/teach/detail/index.vue index 3af7d8448..53c140824 100644 --- a/src/views/teach/detail/index.vue +++ b/src/views/teach/detail/index.vue @@ -57,6 +57,7 @@ import LimitList from '@/views/components/limits/index'; import { getSessionStorage, setSessionStorage } from '@/utils/auth'; import { trainingNotify } from '@/api/simulation'; import { launchFullscreen } from '@/utils/screen'; +import localStore from 'storejs'; export default { name: 'LessonDetail', @@ -205,6 +206,7 @@ export default { } }, backLessonList() { + localStore.remove('teachDetail'+this.$route.query.mapId); this.$router.push({ path: `${UrlConfig.trainingPlatform.teachHome}/${this.$route.params.subSystem}`}); } } diff --git a/src/views/teach/index.vue b/src/views/teach/index.vue index 3999e8535..60dac05b5 100644 --- a/src/views/teach/index.vue +++ b/src/views/teach/index.vue @@ -68,6 +68,7 @@ export default { } }, goLesson(row) { + localStore.set('teachDetail'+row.mapId, `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.params.subSystem}?lessonId=${row.id}&mapId=${row.mapId}&prdCode=${row.prdCode}`); this.$router.push({ path: `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.params.subSystem}`, query: {lessonId: row.id, mapId: row.mapId, prdCode: row.prdCode}}); } } diff --git a/src/views/trainingPlatform/demonList.vue b/src/views/trainingPlatform/demonList.vue index 6d801dc56..be7b56ad8 100644 --- a/src/views/trainingPlatform/demonList.vue +++ b/src/views/trainingPlatform/demonList.vue @@ -3,9 +3,9 @@
{{ $t('global.mapList') }}
- + - + diff --git a/src/views/lesson/operateMenu.vue b/src/views/lesson/operateMenu.vue index 1962045df..310c0431b 100644 --- a/src/views/lesson/operateMenu.vue +++ b/src/views/lesson/operateMenu.vue @@ -31,6 +31,10 @@ export default { { label: '更新章节', handler: this.updateChapter + }, + { + label: '创建章节', + handler: this.createChapter } ], menuLesson: [ From 6fa2b2e6368f45da0842fd15cee0cb248c5e570a Mon Sep 17 00:00:00 2001 From: program-walker <418875866@qq.com> Date: Tue, 22 Oct 2019 19:47:36 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E7=99=BB=E9=99=86=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/login/index.vue | 55 ++++++++++++--------------------------- 1 file changed, 17 insertions(+), 38 deletions(-) diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 1a553d0ff..2ad369192 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -173,20 +173,8 @@ export default { model.project = this.$route.params.project; removeSessionStorage('againEnter'); this.$store.dispatch('Login', model).then(() => { - this.$store.dispatch('GetUserConfigInfo'); - this.$store.dispatch('SetAccount', model.username); - // 设置路由 - this.loading = false; - this.tipsMsg = ''; - let path = localStore.get('trainingPlatformRoute'+model.username); - if (!path || !path.startsWith('/trainingPlatform')) { - path = UrlConfig.trainingPlatform.trainingPlatformHome; - } - this.$nextTick(() => { - this.$i18n.locale = 'zh'; - Cookies.set('user_lang', 'zh'); - }); - this.$router.push({ path: path }); + this.$store.dispatch('SetAccount', model.username); + this.handleLoginSucessRoute(); }).catch(error => { this.tipsMsg = error.message; this.loading = false; @@ -237,15 +225,7 @@ export default { self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token }).then(() => { // 清除定时器,设置路由 self.clearTimer(self.checkLogin); - let path = '/login'; - if (this.project) { - path = path + '/' + this.project; - } - self.$router.push({ path: path }); - self.$nextTick(() => { - self.$i18n.locale = 'zh'; - Cookies.set('user_lang', 'zh'); - }); + this.handleLoginSucessRoute(); }); }).catch(error => { if (error.data && error.data.status == '1') { @@ -278,20 +258,8 @@ export default { } removeSessionStorage('againEnter'); this.$store.dispatch('Login', model).then(() => { - this.$store.dispatch('GetUserConfigInfo'); - this.$store.dispatch('SetAccount', model.username); - // 设置路由 - this.loading = false; - this.tipsMsg = ''; - let path = localStore.get('trainingPlatformRoute'+model.username); - if (!path || !path.startsWith('/trainingPlatform')) { - path = UrlConfig.trainingPlatform.trainingPlatformHome; - } - this.$nextTick(() => { - this.$i18n.locale = 'zh'; - Cookies.set('user_lang', 'zh'); - }); - this.$router.push({ path: path }); + this.$store.dispatch('SetAccount', model.username); + this.handleLoginSucessRoute(); }).catch(error => { this.tipsMsg = error.message; this.loading = false; @@ -302,7 +270,18 @@ export default { return false; } }); - } + }, + handleLoginSucessRoute() { + // 设置路由 + this.loading = false; + this.tipsMsg = ''; + const path = UrlConfig.trainingPlatform.trainingPlatformHome; + this.$nextTick(() => { + this.$i18n.locale = 'zh'; + Cookies.set('user_lang', 'zh'); + }); + this.$router.push({ path: path }); + } } }; From 21510d946412a54b5abf0ce3e068bf4e322ac383 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 22 Oct 2019 19:49:37 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=AB=A0=E8=8A=82?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/lesson/details.vue | 3 +++ src/views/lesson/lessoncategory/edit/chapter/index.vue | 10 ++-------- src/views/lesson/lessoncategory/edit/lesson/index.vue | 3 ++- src/views/lesson/operateMenu.vue | 5 ++++- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/views/lesson/details.vue b/src/views/lesson/details.vue index d9bb457f5..e14bf2f77 100644 --- a/src/views/lesson/details.vue +++ b/src/views/lesson/details.vue @@ -118,6 +118,9 @@ export default { case '03': this.updateChapte(params.node); break; + case '04': + this.createChapte(params.node); + break; } }, refresh() { diff --git a/src/views/lesson/lessoncategory/edit/chapter/index.vue b/src/views/lesson/lessoncategory/edit/chapter/index.vue index f84d55016..c5e049450 100644 --- a/src/views/lesson/lessoncategory/edit/chapter/index.vue +++ b/src/views/lesson/lessoncategory/edit/chapter/index.vue @@ -127,11 +127,7 @@ export default { initData(isNew, data) { this.isEdit = !isNew; this.clearForm(); - if (isNew) { - this.loadTrainingList(data); - } else { - this.loadTrainingList(data); - } + this.loadTrainingList(data); }, getChapter(data) { getLessonChapterDetail(data).then(response => { @@ -187,9 +183,7 @@ export default { this.detail.prdCode = resp.data.prdCode; this.chapterModel.lessonId = resp.data.id; this.chapterModel.lessonName = resp.data.name; - if (this.isEdit) { - this.getChapter(data); - } else { + if (data.id !== data.lessonId) { this.getChapter(data); } }).catch(() => { diff --git a/src/views/lesson/lessoncategory/edit/lesson/index.vue b/src/views/lesson/lessoncategory/edit/lesson/index.vue index 2d3342d5f..fef8145bc 100644 --- a/src/views/lesson/lessoncategory/edit/lesson/index.vue +++ b/src/views/lesson/lessoncategory/edit/lesson/index.vue @@ -147,7 +147,8 @@ export default { createLesson(model).then(response => { this.$emit('refresh'); this.$message.success(this.$t('tip.createSuccess')); - }).catch(error => { + this.back(); + }).catch(() => { this.$messageBox(this.$t('tip.creatingFailed')); }); } diff --git a/src/views/lesson/operateMenu.vue b/src/views/lesson/operateMenu.vue index 310c0431b..12011ef49 100644 --- a/src/views/lesson/operateMenu.vue +++ b/src/views/lesson/operateMenu.vue @@ -34,7 +34,7 @@ export default { }, { label: '创建章节', - handler: this.createChapter + handler: this.createChapterInChapter } ], menuLesson: [ @@ -103,6 +103,9 @@ export default { editLesson() { this.$emit('changeRouter', {event: '01', node: this.node}); }, + createChapterInChapter() { + this.$emit('changeRouter', {event: '04', node: this.node}); + }, refresh(filterSelect) { this.$emit('refresh', filterSelect); } From 48fafacdc266f33eefe7f2669aceb755732525d1 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 22 Oct 2019 20:01:03 +0800 Subject: [PATCH 11/13] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=B8=8A=E6=AC=A1?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=99=BB=E5=BD=95=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lessoncategory/edit/lesson/index.vue | 6 +++--- src/views/trainingPlatform/demonList.vue | 20 +++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/views/lesson/lessoncategory/edit/lesson/index.vue b/src/views/lesson/lessoncategory/edit/lesson/index.vue index fef8145bc..4474d942a 100644 --- a/src/views/lesson/lessoncategory/edit/lesson/index.vue +++ b/src/views/lesson/lessoncategory/edit/lesson/index.vue @@ -167,7 +167,7 @@ export default { updateLesson(model).then(response => { this.$emit('refresh'); this.$message.success(this.$t('tip.updateSuccessfully')); - }).catch(error => { + }).catch(() => { this.$messageBox(this.$t('tip.updateFailed')); }); } @@ -190,8 +190,8 @@ export default { } }, back() { - this.$router.push({ path: `${UrlConfig.design.lessonHome}/${this.$route.query.mapId}/${this.$route.query.skinCode}`, query: {cityCode: this.$route.query.cityCode} }); - } + this.$router.push({ path: `${UrlConfig.design.lessonHome}/${this.$route.query.mapId}/${this.$route.query.skinCode}`, query: {cityCode: this.$route.query.cityCode} }); + } } }; diff --git a/src/views/trainingPlatform/demonList.vue b/src/views/trainingPlatform/demonList.vue index 915af124d..85e42dba3 100644 --- a/src/views/trainingPlatform/demonList.vue +++ b/src/views/trainingPlatform/demonList.vue @@ -75,8 +75,8 @@ export default { }; }, computed: { - account() { - return this.$store.state.user.account; + userId() { + return this.$store.state.user.id; }, project() { return getSessionStorage('project'); @@ -90,6 +90,10 @@ export default { beforeDestroy () { }, mounted() { + const path = localStore.get('trainingPlatformRoute'+ this.userId); + if (path && path.startsWith('/trainingPlatform')) { + this.$router.push(path); + } }, methods: { filterNode(value, data) { @@ -103,7 +107,7 @@ export default { } }, clickEvent(obj, data, ele) { - localStore.set('trainingPlatformCheckId'+this.filterSelect+this.account, obj.id); + localStore.set('trainingPlatformCheckId'+this.filterSelect+this.userId, obj.id); while (data) { if (data.data.type === 'Map') { this.mapId = data.data.id; @@ -150,7 +154,7 @@ export default { } }, setLocalRoute(path) { - localStore.set('trainingPlatformRoute'+this.account, path); + localStore.set('trainingPlatformRoute'+this.userId, path); }, async refresh(filterSelect) { this.loading = true; @@ -172,7 +176,7 @@ export default { this.getExpandList(filterSelect); // this.changeCityWithPage(this.treeList); this.$nextTick(() => { - const checkId = localStore.get('trainingPlatformCheckId'+filterSelect+this.account) || null; + const checkId = localStore.get('trainingPlatformCheckId'+filterSelect+this.userId) || null; this.$refs.tree && this.$refs.tree.setCurrentKey(checkId); this.loading = false; }); @@ -185,15 +189,15 @@ export default { const key = obj.id; this.expandList = this.expandList.filter(item => item!==key); this.expandList.push(key); - localStore.set('trainIngPlatformExpandList'+this.filterSelect+this.account, this.expandList); + localStore.set('trainIngPlatformExpandList'+this.filterSelect+this.userId, this.expandList); }, nodeCollapse(obj, node, ele) { const key = obj.id; this.expandList = this.expandList.filter(item => item!==key); - localStore.set('trainIngPlatformExpandList'+this.filterSelect+this.account, this.expandList); + localStore.set('trainIngPlatformExpandList'+this.filterSelect+this.userId, this.expandList); }, getExpandList(filterSelect) { - let expand = localStore.get('trainIngPlatformExpandList'+filterSelect+this.account); + let expand = localStore.get('trainIngPlatformExpandList'+filterSelect+this.userId); expand = expand?(expand+'').split(','):''; if (expand instanceof Array) { this.expandList = expand; From 332fa22b8164474947081bf5c23b38fb5253937b Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 22 Oct 2019 20:04:55 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/login.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/login.js b/src/utils/login.js index 7697c4cfa..f1e412017 100644 --- a/src/utils/login.js +++ b/src/utils/login.js @@ -2,8 +2,8 @@ // 登陆配置参数 export const LoginParams = { LianKeTang: { clientId: '1', secret: 'joylink' }, // "琏课堂" - DaPing: { clientId: '2', secret: 'bigscreen' }, // "大屏系统" - LianJiHua: { clientId: '3', secret: 'linkplan' }, // "琏计划" + // DaPing: { clientId: '2', secret: 'bigscreen' }, // "大屏系统" + // LianJiHua: { clientId: '3', secret: 'linkplan' }, // "琏计划" Assistant: { clientId: '4', secret: 'linkassistant' }, // "琏课堂助手" - Design: { clientId: '6', secret: 'design' } // "城市轨道交通设计平台" + Design: { clientId: '2', secret: 'design' } // "城市轨道交通设计平台" }; From 7550d82f2ba0508f118d41aac3f06770c7f05779 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 22 Oct 2019 20:09:29 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E7=99=BB=E5=BD=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/login/loginDesign.vue | 51 ++++++++++++++++++++++--------- src/views/login/loginEn.vue | 39 ++++++++++++----------- src/views/login/loginEnDesign.vue | 45 +++++++++++++++++++-------- 3 files changed, 89 insertions(+), 46 deletions(-) diff --git a/src/views/login/loginDesign.vue b/src/views/login/loginDesign.vue index 9fb58082e..519472729 100644 --- a/src/views/login/loginDesign.vue +++ b/src/views/login/loginDesign.vue @@ -206,12 +206,15 @@ export default { // 设置扫码登录 self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKENDESIGN', value: response.data.token }).then(() => { // 清除定时器,设置路由 - self.clearTimer(self.checkLogin); - self.$router.push({ path: '/design/login' }); + self.clearTimer(self.checkLogin); + + this.$router.push({ path: `${UrlConfig.design.prefix}` }); self.$nextTick(() => { self.$i18n.locale = 'zh'; Cookies.set('user_lang', 'zh'); - }); + }); + + }); }).catch(error => { if (error.data && error.data.status == '1') { @@ -244,16 +247,25 @@ export default { model.type = 'design'; this.loading = true; - this.$store.dispatch('Login', model).then(() => { - this.$store.dispatch('GetUserConfigInfo'); - // 设置路由 - this.loading = false; - this.tipsMsg = ''; - this.$nextTick(() => { - this.$i18n.locale = 'zh'; - Cookies.set('user_lang', 'zh'); - }); - this.$router.push({ path: `${UrlConfig.design.prefix}` }); + // this.$store.dispatch('Login', model).then(() => { + // this.$store.dispatch('GetUserConfigInfo'); + // // 设置路由 + // this.loading = false; + // this.tipsMsg = ''; + // this.$nextTick(() => { + // this.$i18n.locale = 'zh'; + // Cookies.set('user_lang', 'zh'); + // }); + // this.$router.push({ path: `${UrlConfig.design.prefix}` }); + // }).catch(error => { + // this.tipsMsg = error.message; + // this.loading = false; + // setTimeout(() => { this.tipsMsg = ''; }, 5000); + // }); + + this.$store.dispatch('Login', model).then(() => { + this.$store.dispatch('SetAccount', model.username); + this.handleLoginSucessRoute(); }).catch(error => { this.tipsMsg = error.message; this.loading = false; @@ -265,7 +277,18 @@ export default { return false; } }); - } + }, + handleLoginSucessRoute() { + // 设置路由 + this.loading = false; + this.tipsMsg = ''; + const path = UrlConfig.design.prefix; + this.$nextTick(() => { + this.$i18n.locale = 'zh'; + Cookies.set('user_lang', 'zh'); + }); + this.$router.push({ path: path }); + } } }; diff --git a/src/views/login/loginEn.vue b/src/views/login/loginEn.vue index 1236534bc..fbe084b77 100644 --- a/src/views/login/loginEn.vue +++ b/src/views/login/loginEn.vue @@ -167,15 +167,14 @@ export default { model.project = this.$route.params.project; removeSessionStorage('againEnter'); this.$store.dispatch('Login', model).then(() => { - this.$store.dispatch('GetUserConfigInfo'); this.$store.dispatch('SetAccount', model.username); // 设置路由 this.loading = false; this.tipsMsg = ''; - let path = localStore.get('trainingPlatformRoute'+model.username); - if (!path || !path.startsWith('/trainingPlatform')) { + // let path = localStore.get('trainingPlatformRoute'+model.username); + // if (!path || !path.startsWith('/trainingPlatform')) { path = UrlConfig.trainingPlatform.trainingPlatformHome; - } + // } this.$nextTick(() => { this.$i18n.locale = 'en'; Cookies.set('user_lang', 'en'); @@ -273,21 +272,10 @@ export default { Cookies.set('UserToken', model.password, { expires: 1/48}); } removeSessionStorage('againEnter'); - this.$store.dispatch('Login', model).then(() => { - this.$store.dispatch('GetUserConfigInfo'); - this.$store.dispatch('SetAccount', model.username); - // 设置路由 - this.loading = false; - this.tipsMsg = ''; - let path = localStore.get('trainingPlatformRoute'+model.username); - if (!path || !path.startsWith('/trainingPlatform')) { - path = UrlConfig.trainingPlatform.trainingPlatformHome; - } - this.$nextTick(() => { - this.$i18n.locale = 'en'; - Cookies.set('user_lang', 'en'); - }); - this.$router.push({ path: path }); + + this.$store.dispatch('Login', model).then(() => { + this.$store.dispatch('SetAccount', model.username); + this.handleLoginSucessRoute(); }).catch(error => { this.tipsMsg = error.message; this.loading = false; @@ -298,7 +286,18 @@ export default { return false; } }); - } + }, + handleLoginSucessRoute() { + // 设置路由 + this.loading = false; + this.tipsMsg = ''; + const path = UrlConfig.trainingPlatform.trainingPlatformHome; + this.$nextTick(() => { + this.$i18n.locale = 'en'; + Cookies.set('user_lang', 'en'); + }); + this.$router.push({ path: path }); + } } }; diff --git a/src/views/login/loginEnDesign.vue b/src/views/login/loginEnDesign.vue index df11a95fd..1d8ae5da0 100644 --- a/src/views/login/loginEnDesign.vue +++ b/src/views/login/loginEnDesign.vue @@ -214,7 +214,8 @@ export default { self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKENDESIGN', value: response.data.token }).then(() => { // 清除定时器,设置路由 self.clearTimer(self.checkLogin); - self.$router.push({ path: '/design/login' }); + // self.$router.push({ path: '/design/login' }); + this.$router.push({ path: `${UrlConfig.design.prefix}` }); self.$nextTick(() => { self.$i18n.locale = 'en'; Cookies.set('user_lang', 'en'); @@ -249,16 +250,25 @@ export default { } this.loading = true; - this.$store.dispatch('Login', model).then(() => { - this.$store.dispatch('GetUserConfigInfo'); - // 设置路由 - this.loading = false; - this.tipsMsg = ''; - this.$router.push({ path: `${UrlConfig.design.prefix}` }); - this.$nextTick(() => { - this.$i18n.locale = 'en'; - Cookies.set('user_lang', 'en'); - }); + // this.$store.dispatch('Login', model).then(() => { + // this.$store.dispatch('GetUserConfigInfo'); + // // 设置路由 + // this.loading = false; + // this.tipsMsg = ''; + // this.$router.push({ path: `${UrlConfig.design.prefix}` }); + // this.$nextTick(() => { + // this.$i18n.locale = 'en'; + // Cookies.set('user_lang', 'en'); + // }); + // }).catch(error => { + // this.tipsMsg = error.message; + // this.loading = false; + // setTimeout(() => { this.tipsMsg = ''; }, 5000); + // }); + + this.$store.dispatch('Login', model).then(() => { + this.$store.dispatch('SetAccount', model.username); + this.handleLoginSucessRoute(); }).catch(error => { this.tipsMsg = error.message; this.loading = false; @@ -270,7 +280,18 @@ export default { return false; } }); - } + }, + handleLoginSucessRoute() { + // 设置路由 + this.loading = false; + this.tipsMsg = ''; + const path = UrlConfig.design.prefix; + this.$nextTick(() => { + this.$i18n.locale = 'en'; + Cookies.set('user_lang', 'en'); + }); + this.$router.push({ path: path }); + } } };