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 | 0 | \ No newline at end of file |
src/api/axios.js
... | ... | @@ -63,6 +63,8 @@ service.interceptors.response.use( |
63 | 63 | return Promise.resolve(res); |
64 | 64 | }, |
65 | 65 | (error) => { |
66 | + const { data, status } = error.response; | |
67 | + | |
66 | 68 | Message({ |
67 | 69 | message: error, |
68 | 70 | type: "error", |
... | ... | @@ -71,14 +73,31 @@ service.interceptors.response.use( |
71 | 73 | if (error.response == undefined) { |
72 | 74 | return Promise.reject(error); |
73 | 75 | } |
74 | - const { data, status } = error.response; | |
76 | + | |
75 | 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 | 94 | Message.closeAll(); |
77 | 95 | Message({ |
78 | 96 | message: data.info || "未登录或登录超时,即将跳转到登录页面", |
79 | 97 | type: "error", |
80 | 98 | duration: 3 * 1000, |
81 | 99 | }); |
100 | + | |
82 | 101 | if (!window.location.href.includes("login")) { |
83 | 102 | router.push({ |
84 | 103 | path: "/login", |
... | ... | @@ -86,6 +105,7 @@ service.interceptors.response.use( |
86 | 105 | url: window.location.href, |
87 | 106 | }, |
88 | 107 | }); |
108 | + | |
89 | 109 | } |
90 | 110 | return; |
91 | 111 | } | ... | ... |
src/store/index.js
... | ... | @@ -86,7 +86,6 @@ const store = new Vuex.Store({ |
86 | 86 | hidden: true, |
87 | 87 | children: [], |
88 | 88 | }); |
89 | - console.log(Cookies.get("ZT_YIJIAO_TOKEN")); | |
90 | 89 | if (params.url) { |
91 | 90 | window.location.href = params.url; |
92 | 91 | } else { |
... | ... | @@ -109,6 +108,49 @@ const store = new Vuex.Store({ |
109 | 108 | }) |
110 | 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 | 154 | permissions({ state, commit }, role) { |
113 | 155 | commit("setToken", "isLogin"); |
114 | 156 | let userInfo = state.info; | ... | ... |
src/views/device/index.vue
... | ... | @@ -62,13 +62,12 @@ |
62 | 62 | :options="gradeList" |
63 | 63 | :props="props" |
64 | 64 | :show-all-levels="false" |
65 | - @change="_QueryData(false)" | |
66 | 65 | ></el-cascader> |
67 | 66 | <el-select |
68 | 67 | class="sel" |
69 | 68 | v-model="query.onlineStatus" |
70 | 69 | placeholder="选择状态" |
71 | - @change="_QueryData(false)" | |
70 | + @change="_QueryData(true)" | |
72 | 71 | > |
73 | 72 | <el-option |
74 | 73 | v-for="item in statusList" |
... | ... | @@ -91,6 +90,12 @@ |
91 | 90 | @click="_QueryData(true)" |
92 | 91 | ></el-button> |
93 | 92 | </el-input> |
93 | + <el-button | |
94 | + class="serach-box" | |
95 | + round | |
96 | + @click="_QueryData(true)" | |
97 | + >筛选</el-button | |
98 | + > | |
94 | 99 | </div> |
95 | 100 | </div> |
96 | 101 | <el-table :data="tableData" border style="width: 100%"> |
... | ... | @@ -192,13 +197,12 @@ |
192 | 197 | :options="gradeList" |
193 | 198 | :props="props" |
194 | 199 | :show-all-levels="false" |
195 | - @change="_QueryData(false)" | |
196 | 200 | ></el-cascader> |
197 | 201 | <el-select |
198 | 202 | class="sel" |
199 | 203 | v-model="query.type" |
200 | 204 | placeholder="选择状态" |
201 | - @change="_QueryData(false)" | |
205 | + @change="_QueryData(true)" | |
202 | 206 | > |
203 | 207 | <el-option |
204 | 208 | v-for="item in typeList" |
... | ... | @@ -221,6 +225,12 @@ |
221 | 225 | @click="_QueryData(true)" |
222 | 226 | ></el-button> |
223 | 227 | </el-input> |
228 | + <el-button | |
229 | + class="serach-box" | |
230 | + round | |
231 | + @click="_QueryData(true)" | |
232 | + >筛选</el-button | |
233 | + >ƒ | |
224 | 234 | </div> |
225 | 235 | </div> |
226 | 236 | <el-table :data="tableData" border style="width: 100%"> |
... | ... | @@ -571,7 +581,7 @@ export default { |
571 | 581 | obj.name == "在线" ? 1 : obj.name == "离线" ? 0 : 2; |
572 | 582 | this.query.sn = ""; |
573 | 583 | this.page = 1; |
574 | - this._QueryData(); | |
584 | + this._QueryData(false); | |
575 | 585 | }, |
576 | 586 | clickScatterChart(obj) { |
577 | 587 | this.query.type = |
... | ... | @@ -588,7 +598,7 @@ export default { |
588 | 598 | : 6; |
589 | 599 | this.query.sn = ""; |
590 | 600 | this.page = 1; |
591 | - this._QueryData(); | |
601 | + this._QueryData(false); | |
592 | 602 | }, |
593 | 603 | handleSelectionChange(val) { |
594 | 604 | console.log(val); |
... | ... | @@ -606,7 +616,7 @@ export default { |
606 | 616 | }, 800), |
607 | 617 | changePage(page) { |
608 | 618 | this.page = page; |
609 | - this._QueryData(); | |
619 | + this._QueryData(false); | |
610 | 620 | }, |
611 | 621 | async autoUpDate(id) { |
612 | 622 | if (!this.selectionTabIds.length && !id) { |
... | ... | @@ -783,7 +793,7 @@ export default { |
783 | 793 | } |
784 | 794 | }, |
785 | 795 | // 设备列表信息 |
786 | - async _QueryData() { | |
796 | + async _QueryData(isRef) { | |
787 | 797 | this.loading = true; |
788 | 798 | let query = {}; |
789 | 799 | let gradeNames = []; |
... | ... | @@ -807,7 +817,9 @@ export default { |
807 | 817 | this.query.type !== "" ? (query.type = this.query.type) : ""; |
808 | 818 | } |
809 | 819 | } |
810 | - | |
820 | + if(isRef){ | |
821 | + this.page= 1 | |
822 | + } | |
811 | 823 | this.loading = true; |
812 | 824 | const deviceList = |
813 | 825 | this.role != "ROLE_JITUAN" | ... | ... |
src/views/login/index.vue
... | ... | @@ -84,20 +84,21 @@ |
84 | 84 | </div> |
85 | 85 | </template> |
86 | 86 | <script> |
87 | +import { getURLParams } from "@/utils"; | |
87 | 88 | export default { |
88 | 89 | data() { |
89 | 90 | return { |
90 | 91 | disableClick: true, |
91 | 92 | passwordType: "password", |
92 | 93 | loginForm: { |
93 | - // username: "13610050254", | |
94 | - // password: "Pw050254#", | |
94 | + username: "13610050254", | |
95 | + password: "Pw050254#", | |
95 | 96 | // username: "18946034886", |
96 | 97 | // password: "Pw034886#", |
97 | 98 | // username: "18332123505", |
98 | 99 | // password: "Pw123505#", |
99 | - username: "15911715665", | |
100 | - password: "Csiy88888", | |
100 | + // username: "15911715665", | |
101 | + // password: "Csiy88888", | |
101 | 102 | }, |
102 | 103 | loginRules: { |
103 | 104 | username: [ |
... | ... | @@ -108,10 +109,17 @@ export default { |
108 | 109 | ], |
109 | 110 | }, |
110 | 111 | url: "", |
112 | + code: "", | |
113 | + dockkey: "", | |
111 | 114 | }; |
112 | 115 | }, |
113 | 116 | created() { |
114 | 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 | 124 | methods: { |
117 | 125 | showPwd() { |
... | ... | @@ -136,6 +144,9 @@ export default { |
136 | 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 | 151 | mounted() {}, |
141 | 152 | }; | ... | ... |
src/views/setUp/school.vue
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | <template slot="title"> |
5 | 5 | <span>学校设置</span> |
6 | 6 | </template> |
7 | - <template slot="btns"> | |
7 | + <template slot="btns" v-if="!code"> | |
8 | 8 | <el-tooltip effect="dark" content="导入学校名单" placement="bottom"> |
9 | 9 | <el-button |
10 | 10 | type="primary" |
... | ... | @@ -226,6 +226,7 @@ export default { |
226 | 226 | }, |
227 | 227 | data() { |
228 | 228 | return { |
229 | + code:"", | |
229 | 230 | loading: false, |
230 | 231 | url: "xxx", |
231 | 232 | diaUp: false, |
... | ... | @@ -275,6 +276,7 @@ export default { |
275 | 276 | }; |
276 | 277 | }, |
277 | 278 | created() { |
279 | + this.code = localStorage.getItem("csCode")||"" | |
278 | 280 | this._QueryDataSchool(); |
279 | 281 | this._QueryDataGrade(); |
280 | 282 | this._QuerySubject(); | ... | ... |
src/views/setUp/teacher.vue
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | <template slot="title"> |
5 | 5 | <span>教师管理</span> |
6 | 6 | </template> |
7 | - <template slot="btns"> | |
7 | + <template slot="btns" v-if="!code"> | |
8 | 8 | <el-tooltip effect="dark" content="导入教师名单" placement="bottom"> |
9 | 9 | <el-button |
10 | 10 | type="primary" |
... | ... | @@ -95,7 +95,7 @@ |
95 | 95 | </ul> |
96 | 96 | </div> |
97 | 97 | <div class="teacher-detail"> |
98 | - <div class="icon-box"> | |
98 | + <div class="icon-box" v-if="!code"> | |
99 | 99 | <i class="icon el-icon-edit-outline" @click="editTeacher(1)"></i> |
100 | 100 | <i |
101 | 101 | class="icon el-icon-circle-plus-outline" |
... | ... | @@ -128,7 +128,11 @@ |
128 | 128 | v-for="item in teacherDetail.managerList" |
129 | 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 | 136 | <i class="el-icon-delete" slot="reference"></i> |
133 | 137 | </el-popconfirm> |
134 | 138 | <div class="grade-item"> |
... | ... | @@ -158,7 +162,11 @@ |
158 | 162 | v-for="item in teacherDetail.teacherCourseList" |
159 | 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 | 170 | <i class="el-icon-delete" slot="reference"></i> |
163 | 171 | </el-popconfirm> |
164 | 172 | <div class="grade-item"> |
... | ... | @@ -190,7 +198,11 @@ |
190 | 198 | :key="item.grade" |
191 | 199 | > |
192 | 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 | 206 | <i class="el-icon-delete" slot="reference"></i> |
195 | 207 | </el-popconfirm> |
196 | 208 | <div class="grade-item"> |
... | ... | @@ -338,6 +350,7 @@ import { downloadFile, formatGradeClass, randomWord } from "@/utils"; |
338 | 350 | export default { |
339 | 351 | data() { |
340 | 352 | return { |
353 | + code: "", | |
341 | 354 | loading: false, |
342 | 355 | url: "", |
343 | 356 | diaUp: false, |
... | ... | @@ -402,6 +415,7 @@ export default { |
402 | 415 | }; |
403 | 416 | }, |
404 | 417 | async created() { |
418 | + this.code = localStorage.getItem("csCode") || ""; | |
405 | 419 | await this._QueryDataGrade(); |
406 | 420 | this._QueryData(1); |
407 | 421 | this._RoleList(); |
... | ... | @@ -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 | 632 | async _RoleList() { |
586 | 633 | //角色 |
587 | 634 | const { data, status, info } = await this.$request.roleList(); |
... | ... | @@ -730,7 +777,7 @@ export default { |
730 | 777 | overflow: hidden; |
731 | 778 | min-height: 400px; |
732 | 779 | .teacher-ul { |
733 | - max-height: 70vh; | |
780 | + max-height: 60vh; | |
734 | 781 | overflow-y: scroll; |
735 | 782 | } |
736 | 783 | .teacher-list { | ... | ... |