kz-ui-base 1.0.28 → 1.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -125,6 +125,7 @@ import Cookies from "~../../js-cookie";
125
125
  import { encrypt, decrypt } from "../utils/jsencrypt";
126
126
  import { getWebConfig } from "../utils/utils";
127
127
  import { getAllRouters } from "@api/menu";
128
+ import { removeToken } from "@utils/auth";
128
129
  export default {
129
130
  name: "Login",
130
131
  data() {
@@ -171,30 +172,34 @@ export default {
171
172
  },
172
173
  },
173
174
  created() {
174
- localStorage.clear();
175
- let enterpriseName = Cookies.get("enterpriseName");
176
- var webConfig = getWebConfig();
177
- if (webConfig) {
178
- localStorage.setItem("configRes", JSON.stringify(webConfig));
179
- if (!enterpriseName) {
180
- if (webConfig.tenantName) {
181
- this.loginForm.enterpriseName = webConfig.tenantName;
182
- } else {
183
- // this.loginForm.enterpriseName = "mom";
175
+ this.$store.dispatch("LogOut").then(() => {
176
+ this.$store.dispatch("tagsView/delAllViews");
177
+ localStorage.clear();
178
+ removeToken();
179
+ let enterpriseName = Cookies.get("enterpriseName");
180
+ var webConfig = getWebConfig();
181
+ if (webConfig) {
182
+ localStorage.setItem("configRes", JSON.stringify(webConfig));
183
+ if (!enterpriseName) {
184
+ if (webConfig.tenantName) {
185
+ this.loginForm.enterpriseName = webConfig.tenantName;
186
+ } else {
187
+ // this.loginForm.enterpriseName = "mom";
188
+ }
189
+ }
190
+ if (this.$route.query.tenantName) {
191
+ this.loginForm.enterpriseName = this.$route.query.tenantName;
192
+ }
193
+ if (webConfig.bgImages) {
194
+ this.imgs = webConfig.bgImages;
195
+ }
196
+ if (webConfig.tenantSystemName) {
197
+ this.loginForm.title = webConfig.tenantSystemName;
198
+ }
184
199
  }
185
- }
186
- if (this.$route.query.tenantName) {
187
- this.loginForm.enterpriseName = this.$route.query.tenantName;
188
- }
189
- if (webConfig.bgImages) {
190
- this.imgs = webConfig.bgImages;
191
- }
192
- if (webConfig.tenantSystemName) {
193
- this.loginForm.title = webConfig.tenantSystemName;
194
- }
195
- }
196
- this.getCode();
197
- this.getCookie();
200
+ this.getCode();
201
+ this.getCookie();
202
+ });
198
203
  },
199
204
  methods: {
200
205
  getCode() {
@@ -124,6 +124,7 @@ import { getAllRouters } from "@api/menu";
124
124
  import { getCodeImg } from "../api/login";
125
125
  import Cookies from "~../../js-cookie";
126
126
  import { encrypt, decrypt } from "../utils/jsencrypt";
127
+ import { removeToken } from "@utils/auth";
127
128
  export default {
128
129
  name: "Login",
129
130
  data() {
@@ -170,24 +171,27 @@ export default {
170
171
  },
171
172
  },
172
173
  created() {
173
- localStorage.clear();
174
- this.axios.get("/config.json").then((res) => {
175
- localStorage.setItem("configRes", JSON.stringify(res.data));
176
- // if (res.data.tenantName) {
177
- // this.loginForm.enterpriseName = res.data.tenantName;
178
- // } else {
179
- // this.loginForm.enterpriseName = "administrator";
180
- // }
181
- if (res.data.bgImages) {
182
- this.imgs = res.data.bgImages;
183
- }
184
- if (res.data.tenantSystemName) {
185
- this.loginForm.title = res.data.tenantSystemName;
186
- }
174
+ this.$store.dispatch("LogOut").then(() => {
175
+ this.$store.dispatch("tagsView/delAllViews");
176
+ localStorage.clear();
177
+ removeToken();
178
+ this.axios.get("/config.json").then((res) => {
179
+ // if (res.data.tenantName) {
180
+ // this.loginForm.enterpriseName = res.data.tenantName;
181
+ // } else {
182
+ // this.loginForm.enterpriseName = "administrator";
183
+ // }
184
+ if (res.data.bgImages) {
185
+ this.imgs = res.data.bgImages;
186
+ }
187
+ if (res.data.tenantSystemName) {
188
+ this.loginForm.title = res.data.tenantSystemName;
189
+ }
190
+ });
191
+ this.getCode();
192
+ this.getCookie();
193
+
187
194
  });
188
-
189
- this.getCode();
190
- this.getCookie();
191
195
  },
192
196
  methods: {
193
197
  getCode() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kz-ui-base",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {