Commit b21d90ef1ac840d0b39338b89fa8d2fe3ed1e8cc
1 parent
e5ff81a1
长水登录
Showing
7 changed files
with
156 additions
and
28 deletions
E/system-commandline-sentinel-files/dotnet-suggest-registration-git-credential-manager-core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null deleted
1 | -Exception during registration: | ||
2 | -System.ComponentModel.Win32Exception (0x80004005): 系统找不到指定的文件。 | ||
3 | - 在 System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) | ||
4 | - 在 System.Diagnostics.Process.Start() | ||
5 | - 在 System.CommandLine.Invocation.Process.StartProcess(String command, String args, String workingDir, Action`1 stdOut, Action`1 stdErr, ValueTuple`2[] environmentVariables) | ||
6 | - 在 System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_1>d.MoveNext() | ||
7 | \ No newline at end of file | 0 | \ No newline at end of file |
src/api/axios.js
@@ -63,6 +63,8 @@ service.interceptors.response.use( | @@ -63,6 +63,8 @@ service.interceptors.response.use( | ||
63 | return Promise.resolve(res); | 63 | return Promise.resolve(res); |
64 | }, | 64 | }, |
65 | (error) => { | 65 | (error) => { |
66 | + const { data, status } = error.response; | ||
67 | + | ||
66 | Message({ | 68 | Message({ |
67 | message: error, | 69 | message: error, |
68 | type: "error", | 70 | type: "error", |
@@ -71,14 +73,31 @@ service.interceptors.response.use( | @@ -71,14 +73,31 @@ service.interceptors.response.use( | ||
71 | if (error.response == undefined) { | 73 | if (error.response == undefined) { |
72 | return Promise.reject(error); | 74 | return Promise.reject(error); |
73 | } | 75 | } |
74 | - const { data, status } = error.response; | 76 | + |
75 | if (status === 403 || status === 401) { | 77 | if (status === 403 || status === 401) { |
78 | + if (data.status === 999) { | ||
79 | + if (!location.href.includes("localhost")) { | ||
80 | + if (data.data) { | ||
81 | + window.location.href = data.data; | ||
82 | + } else { | ||
83 | + router.push({ path: "/login" }); | ||
84 | + if (res.message.includes("不存在")) { | ||
85 | + Message({ | ||
86 | + message: res.message, | ||
87 | + type: "error", | ||
88 | + duration: 3 * 1000, | ||
89 | + }); | ||
90 | + } | ||
91 | + } | ||
92 | + } | ||
93 | + } | ||
76 | Message.closeAll(); | 94 | Message.closeAll(); |
77 | Message({ | 95 | Message({ |
78 | message: data.info || "未登录或登录超时,即将跳转到登录页面", | 96 | message: data.info || "未登录或登录超时,即将跳转到登录页面", |
79 | type: "error", | 97 | type: "error", |
80 | duration: 3 * 1000, | 98 | duration: 3 * 1000, |
81 | }); | 99 | }); |
100 | + | ||
82 | if (!window.location.href.includes("login")) { | 101 | if (!window.location.href.includes("login")) { |
83 | router.push({ | 102 | router.push({ |
84 | path: "/login", | 103 | path: "/login", |
@@ -86,6 +105,7 @@ service.interceptors.response.use( | @@ -86,6 +105,7 @@ service.interceptors.response.use( | ||
86 | url: window.location.href, | 105 | url: window.location.href, |
87 | }, | 106 | }, |
88 | }); | 107 | }); |
108 | + | ||
89 | } | 109 | } |
90 | return; | 110 | return; |
91 | } | 111 | } |
src/store/index.js
@@ -86,7 +86,6 @@ const store = new Vuex.Store({ | @@ -86,7 +86,6 @@ const store = new Vuex.Store({ | ||
86 | hidden: true, | 86 | hidden: true, |
87 | children: [], | 87 | children: [], |
88 | }); | 88 | }); |
89 | - console.log(Cookies.get("ZT_YIJIAO_TOKEN")); | ||
90 | if (params.url) { | 89 | if (params.url) { |
91 | window.location.href = params.url; | 90 | window.location.href = params.url; |
92 | } else { | 91 | } else { |
@@ -109,6 +108,49 @@ const store = new Vuex.Store({ | @@ -109,6 +108,49 @@ const store = new Vuex.Store({ | ||
109 | }) | 108 | }) |
110 | .catch(() => {}); | 109 | .catch(() => {}); |
111 | }, | 110 | }, |
111 | + CSLogin({ state, commit }, code) { | ||
112 | + request | ||
113 | + .ssoLogin({ code:code}) | ||
114 | + .then((res) => { | ||
115 | + let response = res; | ||
116 | + if (response.status == 0) { | ||
117 | + const userInfo = { ...response.data }; | ||
118 | + if (userInfo.permissions && userInfo.permissions.length) { | ||
119 | + userInfo.showRoleName = response.data.permissions[0]?.roleName; | ||
120 | + commit("setToken", "isLogin"); | ||
121 | + commit("setCode", code); | ||
122 | + commit("setInfo", { ...userInfo }); | ||
123 | + commit("setRouters", [ | ||
124 | + ...userInfo.permissions[0]?.authorityRouter, | ||
125 | + ]); | ||
126 | + state.addRouters.forEach((res) => { | ||
127 | + router.addRoute(res); | ||
128 | + }); | ||
129 | + router.addRoute({ | ||
130 | + path: "*", | ||
131 | + redirect: "/404", | ||
132 | + hidden: true, | ||
133 | + children: [], | ||
134 | + }); | ||
135 | + router.push({ path: "/" }); | ||
136 | + | ||
137 | + } else { | ||
138 | + Message({ | ||
139 | + message: "该账号暂无权限,请联系管理员~", | ||
140 | + type: "error", | ||
141 | + duration: 3 * 1000, | ||
142 | + }); | ||
143 | + } | ||
144 | + } else { | ||
145 | + Message({ | ||
146 | + message: response.info, | ||
147 | + type: "error", | ||
148 | + duration: 3 * 1000, | ||
149 | + }); | ||
150 | + } | ||
151 | + }) | ||
152 | + .catch(() => {}); | ||
153 | + }, | ||
112 | permissions({ state, commit }, role) { | 154 | permissions({ state, commit }, role) { |
113 | commit("setToken", "isLogin"); | 155 | commit("setToken", "isLogin"); |
114 | let userInfo = state.info; | 156 | let userInfo = state.info; |
src/views/device/index.vue
@@ -62,13 +62,12 @@ | @@ -62,13 +62,12 @@ | ||
62 | :options="gradeList" | 62 | :options="gradeList" |
63 | :props="props" | 63 | :props="props" |
64 | :show-all-levels="false" | 64 | :show-all-levels="false" |
65 | - @change="_QueryData(false)" | ||
66 | ></el-cascader> | 65 | ></el-cascader> |
67 | <el-select | 66 | <el-select |
68 | class="sel" | 67 | class="sel" |
69 | v-model="query.onlineStatus" | 68 | v-model="query.onlineStatus" |
70 | placeholder="选择状态" | 69 | placeholder="选择状态" |
71 | - @change="_QueryData(false)" | 70 | + @change="_QueryData(true)" |
72 | > | 71 | > |
73 | <el-option | 72 | <el-option |
74 | v-for="item in statusList" | 73 | v-for="item in statusList" |
@@ -91,6 +90,12 @@ | @@ -91,6 +90,12 @@ | ||
91 | @click="_QueryData(true)" | 90 | @click="_QueryData(true)" |
92 | ></el-button> | 91 | ></el-button> |
93 | </el-input> | 92 | </el-input> |
93 | + <el-button | ||
94 | + class="serach-box" | ||
95 | + round | ||
96 | + @click="_QueryData(true)" | ||
97 | + >筛选</el-button | ||
98 | + > | ||
94 | </div> | 99 | </div> |
95 | </div> | 100 | </div> |
96 | <el-table :data="tableData" border style="width: 100%"> | 101 | <el-table :data="tableData" border style="width: 100%"> |
@@ -192,13 +197,12 @@ | @@ -192,13 +197,12 @@ | ||
192 | :options="gradeList" | 197 | :options="gradeList" |
193 | :props="props" | 198 | :props="props" |
194 | :show-all-levels="false" | 199 | :show-all-levels="false" |
195 | - @change="_QueryData(false)" | ||
196 | ></el-cascader> | 200 | ></el-cascader> |
197 | <el-select | 201 | <el-select |
198 | class="sel" | 202 | class="sel" |
199 | v-model="query.type" | 203 | v-model="query.type" |
200 | placeholder="选择状态" | 204 | placeholder="选择状态" |
201 | - @change="_QueryData(false)" | 205 | + @change="_QueryData(true)" |
202 | > | 206 | > |
203 | <el-option | 207 | <el-option |
204 | v-for="item in typeList" | 208 | v-for="item in typeList" |
@@ -221,6 +225,12 @@ | @@ -221,6 +225,12 @@ | ||
221 | @click="_QueryData(true)" | 225 | @click="_QueryData(true)" |
222 | ></el-button> | 226 | ></el-button> |
223 | </el-input> | 227 | </el-input> |
228 | + <el-button | ||
229 | + class="serach-box" | ||
230 | + round | ||
231 | + @click="_QueryData(true)" | ||
232 | + >筛选</el-button | ||
233 | + >ƒ | ||
224 | </div> | 234 | </div> |
225 | </div> | 235 | </div> |
226 | <el-table :data="tableData" border style="width: 100%"> | 236 | <el-table :data="tableData" border style="width: 100%"> |
@@ -571,7 +581,7 @@ export default { | @@ -571,7 +581,7 @@ export default { | ||
571 | obj.name == "在线" ? 1 : obj.name == "离线" ? 0 : 2; | 581 | obj.name == "在线" ? 1 : obj.name == "离线" ? 0 : 2; |
572 | this.query.sn = ""; | 582 | this.query.sn = ""; |
573 | this.page = 1; | 583 | this.page = 1; |
574 | - this._QueryData(); | 584 | + this._QueryData(false); |
575 | }, | 585 | }, |
576 | clickScatterChart(obj) { | 586 | clickScatterChart(obj) { |
577 | this.query.type = | 587 | this.query.type = |
@@ -588,7 +598,7 @@ export default { | @@ -588,7 +598,7 @@ export default { | ||
588 | : 6; | 598 | : 6; |
589 | this.query.sn = ""; | 599 | this.query.sn = ""; |
590 | this.page = 1; | 600 | this.page = 1; |
591 | - this._QueryData(); | 601 | + this._QueryData(false); |
592 | }, | 602 | }, |
593 | handleSelectionChange(val) { | 603 | handleSelectionChange(val) { |
594 | console.log(val); | 604 | console.log(val); |
@@ -606,7 +616,7 @@ export default { | @@ -606,7 +616,7 @@ export default { | ||
606 | }, 800), | 616 | }, 800), |
607 | changePage(page) { | 617 | changePage(page) { |
608 | this.page = page; | 618 | this.page = page; |
609 | - this._QueryData(); | 619 | + this._QueryData(false); |
610 | }, | 620 | }, |
611 | async autoUpDate(id) { | 621 | async autoUpDate(id) { |
612 | if (!this.selectionTabIds.length && !id) { | 622 | if (!this.selectionTabIds.length && !id) { |
@@ -783,7 +793,7 @@ export default { | @@ -783,7 +793,7 @@ export default { | ||
783 | } | 793 | } |
784 | }, | 794 | }, |
785 | // 设备列表信息 | 795 | // 设备列表信息 |
786 | - async _QueryData() { | 796 | + async _QueryData(isRef) { |
787 | this.loading = true; | 797 | this.loading = true; |
788 | let query = {}; | 798 | let query = {}; |
789 | let gradeNames = []; | 799 | let gradeNames = []; |
@@ -807,7 +817,9 @@ export default { | @@ -807,7 +817,9 @@ export default { | ||
807 | this.query.type !== "" ? (query.type = this.query.type) : ""; | 817 | this.query.type !== "" ? (query.type = this.query.type) : ""; |
808 | } | 818 | } |
809 | } | 819 | } |
810 | - | 820 | + if(isRef){ |
821 | + this.page= 1 | ||
822 | + } | ||
811 | this.loading = true; | 823 | this.loading = true; |
812 | const deviceList = | 824 | const deviceList = |
813 | this.role != "ROLE_JITUAN" | 825 | this.role != "ROLE_JITUAN" |
src/views/login/index.vue
@@ -84,20 +84,21 @@ | @@ -84,20 +84,21 @@ | ||
84 | </div> | 84 | </div> |
85 | </template> | 85 | </template> |
86 | <script> | 86 | <script> |
87 | +import { getURLParams } from "@/utils"; | ||
87 | export default { | 88 | export default { |
88 | data() { | 89 | data() { |
89 | return { | 90 | return { |
90 | disableClick: true, | 91 | disableClick: true, |
91 | passwordType: "password", | 92 | passwordType: "password", |
92 | loginForm: { | 93 | loginForm: { |
93 | - // username: "13610050254", | ||
94 | - // password: "Pw050254#", | 94 | + username: "13610050254", |
95 | + password: "Pw050254#", | ||
95 | // username: "18946034886", | 96 | // username: "18946034886", |
96 | // password: "Pw034886#", | 97 | // password: "Pw034886#", |
97 | // username: "18332123505", | 98 | // username: "18332123505", |
98 | // password: "Pw123505#", | 99 | // password: "Pw123505#", |
99 | - username: "15911715665", | ||
100 | - password: "Csiy88888", | 100 | + // username: "15911715665", |
101 | + // password: "Csiy88888", | ||
101 | }, | 102 | }, |
102 | loginRules: { | 103 | loginRules: { |
103 | username: [ | 104 | username: [ |
@@ -108,10 +109,17 @@ export default { | @@ -108,10 +109,17 @@ export default { | ||
108 | ], | 109 | ], |
109 | }, | 110 | }, |
110 | url: "", | 111 | url: "", |
112 | + code: "", | ||
113 | + dockkey: "", | ||
111 | }; | 114 | }; |
112 | }, | 115 | }, |
113 | created() { | 116 | created() { |
114 | this.url = this.$route.query?.url || ""; | 117 | this.url = this.$route.query?.url || ""; |
118 | + this.code = getURLParams("code") || localStorage.getItem("csCode") || ""; | ||
119 | + this.dockkey = getURLParams("dockkey") || ""; | ||
120 | + if (this.code || this.dockkey) { | ||
121 | + this._LoginCheck(); | ||
122 | + } | ||
115 | }, | 123 | }, |
116 | methods: { | 124 | methods: { |
117 | showPwd() { | 125 | showPwd() { |
@@ -136,6 +144,9 @@ export default { | @@ -136,6 +144,9 @@ export default { | ||
136 | this.$store.dispatch("Login", { ...this.loginForm, url: this.url }); | 144 | this.$store.dispatch("Login", { ...this.loginForm, url: this.url }); |
137 | } | 145 | } |
138 | }, | 146 | }, |
147 | + _LoginCheck() { | ||
148 | + this.$store.dispatch("CSLogin", this.code || this.dockkey); | ||
149 | + }, | ||
139 | }, | 150 | }, |
140 | mounted() {}, | 151 | mounted() {}, |
141 | }; | 152 | }; |
src/views/setUp/school.vue
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | <template slot="title"> | 4 | <template slot="title"> |
5 | <span>学校设置</span> | 5 | <span>学校设置</span> |
6 | </template> | 6 | </template> |
7 | - <template slot="btns"> | 7 | + <template slot="btns" v-if="!code"> |
8 | <el-tooltip effect="dark" content="导入学校名单" placement="bottom"> | 8 | <el-tooltip effect="dark" content="导入学校名单" placement="bottom"> |
9 | <el-button | 9 | <el-button |
10 | type="primary" | 10 | type="primary" |
@@ -226,6 +226,7 @@ export default { | @@ -226,6 +226,7 @@ export default { | ||
226 | }, | 226 | }, |
227 | data() { | 227 | data() { |
228 | return { | 228 | return { |
229 | + code:"", | ||
229 | loading: false, | 230 | loading: false, |
230 | url: "xxx", | 231 | url: "xxx", |
231 | diaUp: false, | 232 | diaUp: false, |
@@ -275,6 +276,7 @@ export default { | @@ -275,6 +276,7 @@ export default { | ||
275 | }; | 276 | }; |
276 | }, | 277 | }, |
277 | created() { | 278 | created() { |
279 | + this.code = localStorage.getItem("csCode")||"" | ||
278 | this._QueryDataSchool(); | 280 | this._QueryDataSchool(); |
279 | this._QueryDataGrade(); | 281 | this._QueryDataGrade(); |
280 | this._QuerySubject(); | 282 | this._QuerySubject(); |
src/views/setUp/teacher.vue
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | <template slot="title"> | 4 | <template slot="title"> |
5 | <span>教师管理</span> | 5 | <span>教师管理</span> |
6 | </template> | 6 | </template> |
7 | - <template slot="btns"> | 7 | + <template slot="btns" v-if="!code"> |
8 | <el-tooltip effect="dark" content="导入教师名单" placement="bottom"> | 8 | <el-tooltip effect="dark" content="导入教师名单" placement="bottom"> |
9 | <el-button | 9 | <el-button |
10 | type="primary" | 10 | type="primary" |
@@ -95,7 +95,7 @@ | @@ -95,7 +95,7 @@ | ||
95 | </ul> | 95 | </ul> |
96 | </div> | 96 | </div> |
97 | <div class="teacher-detail"> | 97 | <div class="teacher-detail"> |
98 | - <div class="icon-box"> | 98 | + <div class="icon-box" v-if="!code"> |
99 | <i class="icon el-icon-edit-outline" @click="editTeacher(1)"></i> | 99 | <i class="icon el-icon-edit-outline" @click="editTeacher(1)"></i> |
100 | <i | 100 | <i |
101 | class="icon el-icon-circle-plus-outline" | 101 | class="icon el-icon-circle-plus-outline" |
@@ -128,7 +128,11 @@ | @@ -128,7 +128,11 @@ | ||
128 | v-for="item in teacherDetail.managerList" | 128 | v-for="item in teacherDetail.managerList" |
129 | :key="item.classId" | 129 | :key="item.classId" |
130 | > | 130 | > |
131 | - <el-popconfirm title="确定删除吗?" confirm=""> | 131 | + <el-popconfirm |
132 | + title="确定删除吗?" | ||
133 | + @confirm="delTeacherManager(item, 1)" | ||
134 | + v-if="!code" | ||
135 | + > | ||
132 | <i class="el-icon-delete" slot="reference"></i> | 136 | <i class="el-icon-delete" slot="reference"></i> |
133 | </el-popconfirm> | 137 | </el-popconfirm> |
134 | <div class="grade-item"> | 138 | <div class="grade-item"> |
@@ -158,7 +162,11 @@ | @@ -158,7 +162,11 @@ | ||
158 | v-for="item in teacherDetail.teacherCourseList" | 162 | v-for="item in teacherDetail.teacherCourseList" |
159 | :key="item.classId" | 163 | :key="item.classId" |
160 | > | 164 | > |
161 | - <el-popconfirm title="确定删除吗?" confirm=""> | 165 | + <el-popconfirm |
166 | + title="确定删除吗?" | ||
167 | + @confirm="delTeacherManager(item, 2)" | ||
168 | + v-if="!code" | ||
169 | + > | ||
162 | <i class="el-icon-delete" slot="reference"></i> | 170 | <i class="el-icon-delete" slot="reference"></i> |
163 | </el-popconfirm> | 171 | </el-popconfirm> |
164 | <div class="grade-item"> | 172 | <div class="grade-item"> |
@@ -190,7 +198,11 @@ | @@ -190,7 +198,11 @@ | ||
190 | :key="item.grade" | 198 | :key="item.grade" |
191 | > | 199 | > |
192 | <li class="grade-li"> | 200 | <li class="grade-li"> |
193 | - <el-popconfirm title="确定删除吗?" confirm=""> | 201 | + <el-popconfirm |
202 | + title="确定删除吗?" | ||
203 | + @confirm="delTeacherManager(item, 3)" | ||
204 | + v-if="!code" | ||
205 | + > | ||
194 | <i class="el-icon-delete" slot="reference"></i> | 206 | <i class="el-icon-delete" slot="reference"></i> |
195 | </el-popconfirm> | 207 | </el-popconfirm> |
196 | <div class="grade-item"> | 208 | <div class="grade-item"> |
@@ -338,6 +350,7 @@ import { downloadFile, formatGradeClass, randomWord } from "@/utils"; | @@ -338,6 +350,7 @@ import { downloadFile, formatGradeClass, randomWord } from "@/utils"; | ||
338 | export default { | 350 | export default { |
339 | data() { | 351 | data() { |
340 | return { | 352 | return { |
353 | + code: "", | ||
341 | loading: false, | 354 | loading: false, |
342 | url: "", | 355 | url: "", |
343 | diaUp: false, | 356 | diaUp: false, |
@@ -402,6 +415,7 @@ export default { | @@ -402,6 +415,7 @@ export default { | ||
402 | }; | 415 | }; |
403 | }, | 416 | }, |
404 | async created() { | 417 | async created() { |
418 | + this.code = localStorage.getItem("csCode") || ""; | ||
405 | await this._QueryDataGrade(); | 419 | await this._QueryDataGrade(); |
406 | this._QueryData(1); | 420 | this._QueryData(1); |
407 | this._RoleList(); | 421 | this._RoleList(); |
@@ -582,6 +596,39 @@ export default { | @@ -582,6 +596,39 @@ export default { | ||
582 | }); | 596 | }); |
583 | }); | 597 | }); |
584 | }, | 598 | }, |
599 | + async delTeacherManager(obj, type) { | ||
600 | + let query; | ||
601 | + switch (type) { | ||
602 | + case 1: | ||
603 | + query = { | ||
604 | + classId: obj.classId, | ||
605 | + }; | ||
606 | + break; | ||
607 | + case 2: | ||
608 | + query = { | ||
609 | + classId: obj.classId, | ||
610 | + subjectName: obj.subjectName, | ||
611 | + }; | ||
612 | + break; | ||
613 | + case 3: | ||
614 | + query = { | ||
615 | + classId: obj.classId, | ||
616 | + grade: obj.grade, | ||
617 | + subjectName: obj.subjectName, | ||
618 | + }; | ||
619 | + break; | ||
620 | + } | ||
621 | + //角色 | ||
622 | + const { data, status, info } = await this.$request.delTeacherManager({ | ||
623 | + teacherId: obj.teacherId, | ||
624 | + ...query | ||
625 | + }); | ||
626 | + if (status === 0) { | ||
627 | + this._QueryData(10); | ||
628 | + } else { | ||
629 | + this.$message.error(info); | ||
630 | + } | ||
631 | + }, | ||
585 | async _RoleList() { | 632 | async _RoleList() { |
586 | //角色 | 633 | //角色 |
587 | const { data, status, info } = await this.$request.roleList(); | 634 | const { data, status, info } = await this.$request.roleList(); |
@@ -730,7 +777,7 @@ export default { | @@ -730,7 +777,7 @@ export default { | ||
730 | overflow: hidden; | 777 | overflow: hidden; |
731 | min-height: 400px; | 778 | min-height: 400px; |
732 | .teacher-ul { | 779 | .teacher-ul { |
733 | - max-height: 70vh; | 780 | + max-height: 60vh; |
734 | overflow-y: scroll; | 781 | overflow-y: scroll; |
735 | } | 782 | } |
736 | .teacher-list { | 783 | .teacher-list { |