diff --git a/src/App.vue b/src/App.vue index e691ea2..210dbce 100644 --- a/src/App.vue +++ b/src/App.vue @@ -17,22 +17,32 @@ export default { }, async created() { - const userId = this.$route.query.uid; - const roleId = this.$route.query.rid; - const params = new URLSearchParams(); - params.append('userId', userId); - // const params = { userId }; + var query = window.location.search.substring(1); + var vars = query.split('&'); + + let userId = ''; + let roleId = ''; + let projectId = ''; + + vars.forEach((item, index) => { + let items = item.split('='); + if (items[0] == 'uid') { + userId = items[1]; + } else if (items[0] == 'pid') { + projectId = items[1]; + } else if (items[0] == 'rid') { + roleId = items[1]; + } + }); + const params = { userId: userId }; await this.getUserId(params); await this.setRoleId(roleId); - await this.getAllMembers({ projectId: this.$route.query.pid }); - this.setProjectId(this.$route.query.pid); - this.setUserId(this.$route.query.uid); + this.setProjectId(projectId); }, methods: { - ...mapMutations('home', ['setProjectId', 'setMembers', 'setRoleId', 'setUserId']), + ...mapMutations('home', ['setProjectId', 'setMembers', 'setRoleId']), ...mapActions('user', ['getUserId']), - ...mapActions('home', ['getAllMembers']), }, }; diff --git a/src/config/api.js b/src/config/api.js index 1b49140..0519e74 100644 --- a/src/config/api.js +++ b/src/config/api.js @@ -26,5 +26,5 @@ export const auditList = params => axios.post(`${defaultwbs}/teacher/getComplete // 审核结业申请 export const auditApply = params => axios.post(`${defaultwbs}/teacher/auditComplete`, params); -发证; +// 发证 export const certificate = params => axios.post(`${defaultwbs}/player/certificate`, params); diff --git a/src/router/index.js b/src/router/index.js index ee65004..0a977f8 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,4 +1,4 @@ -import Home from 'views/FirstPage/FirstPage.vue'; +import Home from 'views/Apply/apply.vue'; import Vue from 'vue'; import VueRouter from 'vue-router'; diff --git a/src/store/modules/home/state.js b/src/store/modules/home/state.js index 55d58e4..85a3d5d 100644 --- a/src/store/modules/home/state.js +++ b/src/store/modules/home/state.js @@ -7,7 +7,6 @@ */ const state = { projectId: '', - userId: '', clockInfos: [], // 考勤信息 members: [], // 所有成员 startTime: null, diff --git a/src/views/Apply/apply.vue b/src/views/Apply/apply.vue index 4c884a0..9972fd6 100644 --- a/src/views/Apply/apply.vue +++ b/src/views/Apply/apply.vue @@ -5,28 +5,33 @@