diff --git a/E/system-commandline-sentinel-files/dotnet-suggest-registration-git-credential-manager-core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null b/E/system-commandline-sentinel-files/dotnet-suggest-registration-git-credential-manager-core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null deleted file mode 100644 index 821db7c..0000000 --- a/E/system-commandline-sentinel-files/dotnet-suggest-registration-git-credential-manager-core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null +++ /dev/null @@ -1,6 +0,0 @@ -Exception during registration: -System.ComponentModel.Win32Exception (0x80004005): 系统找不到指定的文件。 - 在 System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) - 在 System.Diagnostics.Process.Start() - 在 System.CommandLine.Invocation.Process.StartProcess(String command, String args, String workingDir, Action`1 stdOut, Action`1 stdErr, ValueTuple`2[] environmentVariables) - 在 System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__10_1>d.MoveNext() \ No newline at end of file diff --git a/src/api/axios.js b/src/api/axios.js index cfa258f..81268de 100644 --- a/src/api/axios.js +++ b/src/api/axios.js @@ -63,6 +63,8 @@ service.interceptors.response.use( return Promise.resolve(res); }, (error) => { + const { data, status } = error.response; + Message({ message: error, type: "error", @@ -71,14 +73,31 @@ service.interceptors.response.use( if (error.response == undefined) { return Promise.reject(error); } - const { data, status } = error.response; + if (status === 403 || status === 401) { + if (data.status === 999) { + if (!location.href.includes("localhost")) { + if (data.data) { + window.location.href = data.data; + } else { + router.push({ path: "/login" }); + if (res.message.includes("不存在")) { + Message({ + message: res.message, + type: "error", + duration: 3 * 1000, + }); + } + } + } + } Message.closeAll(); Message({ message: data.info || "未登录或登录超时,即将跳转到登录页面", type: "error", duration: 3 * 1000, }); + if (!window.location.href.includes("login")) { router.push({ path: "/login", @@ -86,6 +105,7 @@ service.interceptors.response.use( url: window.location.href, }, }); + } return; } diff --git a/src/store/index.js b/src/store/index.js index caf1f87..3bfbade 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -86,7 +86,6 @@ const store = new Vuex.Store({ hidden: true, children: [], }); - console.log(Cookies.get("ZT_YIJIAO_TOKEN")); if (params.url) { window.location.href = params.url; } else { @@ -109,6 +108,49 @@ const store = new Vuex.Store({ }) .catch(() => {}); }, + CSLogin({ state, commit }, code) { + request + .ssoLogin({ code:code}) + .then((res) => { + let response = res; + if (response.status == 0) { + const userInfo = { ...response.data }; + if (userInfo.permissions && userInfo.permissions.length) { + userInfo.showRoleName = response.data.permissions[0]?.roleName; + commit("setToken", "isLogin"); + commit("setCode", code); + commit("setInfo", { ...userInfo }); + commit("setRouters", [ + ...userInfo.permissions[0]?.authorityRouter, + ]); + state.addRouters.forEach((res) => { + router.addRoute(res); + }); + router.addRoute({ + path: "*", + redirect: "/404", + hidden: true, + children: [], + }); + router.push({ path: "/" }); + + } else { + Message({ + message: "该账号暂无权限,请联系管理员~", + type: "error", + duration: 3 * 1000, + }); + } + } else { + Message({ + message: response.info, + type: "error", + duration: 3 * 1000, + }); + } + }) + .catch(() => {}); + }, permissions({ state, commit }, role) { commit("setToken", "isLogin"); let userInfo = state.info; diff --git a/src/views/device/index.vue b/src/views/device/index.vue index 6590087..3c5d1d0 100644 --- a/src/views/device/index.vue +++ b/src/views/device/index.vue @@ -62,13 +62,12 @@ :options="gradeList" :props="props" :show-all-levels="false" - @change="_QueryData(false)" > + 筛选 @@ -192,13 +197,12 @@ :options="gradeList" :props="props" :show-all-levels="false" - @change="_QueryData(false)" > + 筛选ƒ @@ -571,7 +581,7 @@ export default { obj.name == "在线" ? 1 : obj.name == "离线" ? 0 : 2; this.query.sn = ""; this.page = 1; - this._QueryData(); + this._QueryData(false); }, clickScatterChart(obj) { this.query.type = @@ -588,7 +598,7 @@ export default { : 6; this.query.sn = ""; this.page = 1; - this._QueryData(); + this._QueryData(false); }, handleSelectionChange(val) { console.log(val); @@ -606,7 +616,7 @@ export default { }, 800), changePage(page) { this.page = page; - this._QueryData(); + this._QueryData(false); }, async autoUpDate(id) { if (!this.selectionTabIds.length && !id) { @@ -783,7 +793,7 @@ export default { } }, // 设备列表信息 - async _QueryData() { + async _QueryData(isRef) { this.loading = true; let query = {}; let gradeNames = []; @@ -807,7 +817,9 @@ export default { this.query.type !== "" ? (query.type = this.query.type) : ""; } } - + if(isRef){ + this.page= 1 + } this.loading = true; const deviceList = this.role != "ROLE_JITUAN" diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 3a8158e..5fec8c9 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -84,20 +84,21 @@