kz-ui-base 1.0.13 → 1.0.15

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.
@@ -114,24 +114,21 @@
114
114
  </el-form>
115
115
  <!-- 底部 -->
116
116
  <div class="el-login-footer">
117
- <span>Copyright © 2021-{{moment().format("YYYY")}} kezhitt.cn All Rights Reserved.</span>
117
+ <span>Copyright © 2021-2023 kezhitt.cn All Rights Reserved.</span>
118
118
  </div>
119
119
  </div>
120
120
  </template>
121
121
 
122
122
  <script>
123
- import moment from "moment";
124
123
  import { getCodeImg } from "../api/login";
125
124
  import Cookies from "~../../js-cookie";
126
125
  import { encrypt, decrypt } from "../utils/jsencrypt";
127
126
  import { getWebConfig } from "../utils/utils";
128
- import { removeToken } from '@utils/auth'
129
-
127
+ import { getAllRouters } from "@api/menu";
130
128
  export default {
131
129
  name: "Login",
132
130
  data() {
133
131
  return {
134
- moment,
135
132
  codeUrl: "",
136
133
  cookiePassword: "",
137
134
  loginForm: {
@@ -175,8 +172,6 @@ export default {
175
172
  },
176
173
  created() {
177
174
  localStorage.clear();
178
- removeToken()
179
-
180
175
  let enterpriseName = Cookies.get("enterpriseName");
181
176
  var webConfig = getWebConfig();
182
177
  if (webConfig) {
@@ -256,26 +251,13 @@ export default {
256
251
  }
257
252
  this.$store
258
253
  .dispatch("Login", this.loginForm)
259
- .then((res) => {
260
- if(res.code==209){
254
+ .then(() => {
255
+ getAllRouters().then((res) => {
256
+ localStorage.setItem("getAllRouters", JSON.stringify(res.data));
261
257
  this.$router
262
- .push({
263
- path: '/changePassword',
264
- query: {
265
- password: 1,
266
- tenantName: this.$route.query.tenantName,
267
- },
268
- })
269
- return
270
- }
271
- this.$router
272
- .push({
273
- path: this.redirect || "/",
274
- query: {
275
- tenantName: this.$route.query.tenantName,
276
- },
277
- })
278
- .catch(() => {});
258
+ .push({ path: this.redirect || "/" })
259
+ .catch(() => {});
260
+ });
279
261
  })
280
262
  .catch(() => {
281
263
  this.loading = false;
@@ -114,25 +114,21 @@
114
114
  </el-form>
115
115
  <!-- 底部 -->
116
116
  <div class="el-login-footer">
117
- <span
118
- >Copyright © 2021-{{ moment().format("YYYY") }} kezhitt.cn All Rights
119
- Reserved.</span
120
- >
117
+ <span>Copyright © 2021-2022 kezhitt.cn All Rights Reserved.</span>
121
118
  </div>
122
119
  </div>
123
120
  </template>
124
121
 
125
122
  <script>
123
+ import { getAllRouters } from "@api/menu";
126
124
  import { getCodeImg } from "../api/login";
127
125
  import Cookies from "~../../js-cookie";
128
126
  import { encrypt, decrypt } from "../utils/jsencrypt";
129
- import { removeToken } from '@utils/auth'
130
- import moment from "moment";
127
+
131
128
  export default {
132
129
  name: "Login",
133
130
  data() {
134
131
  return {
135
- moment,
136
132
  codeUrl: "",
137
133
  cookiePassword: "",
138
134
  loginForm: {
@@ -176,8 +172,8 @@ export default {
176
172
  },
177
173
  created() {
178
174
  localStorage.clear();
179
- removeToken()
180
175
  this.axios.get("/config.json").then((res) => {
176
+ localStorage.setItem("configRes", JSON.stringify(res.data));
181
177
  // if (res.data.tenantName) {
182
178
  // this.loginForm.enterpriseName = res.data.tenantName;
183
179
  // } else {
@@ -190,6 +186,7 @@ export default {
190
186
  this.loginForm.title = res.data.tenantSystemName;
191
187
  }
192
188
  });
189
+
193
190
  this.getCode();
194
191
  this.getCookie();
195
192
  },
@@ -226,6 +223,7 @@ export default {
226
223
  if (valid) {
227
224
  this.loading = true;
228
225
  localStorage.setItem("systemId", 0);
226
+
229
227
  if (this.loginForm.rememberMe) {
230
228
  Cookies.set("enterpriseName", this.loginForm.enterpriseName, {
231
229
  expires: 30,
@@ -245,19 +243,13 @@ export default {
245
243
  }
246
244
  this.$store
247
245
  .dispatch("Login", this.loginForm)
248
- .then((res) => {
249
- if(res.code==209){
246
+ .then(() => {
247
+ getAllRouters().then((res) => {
248
+ localStorage.setItem("getAllRouters", JSON.stringify(res.data));
250
249
  this.$router
251
- .push({
252
- path: '/changePassword',
253
- query: {
254
- password: 1,
255
- tenantName: this.$route.query.tenantName,
256
- },
257
- })
258
- return
259
- }
260
- this.$router.push({ path: this.redirect || "/" }).catch(() => {});
250
+ .push({ path: this.redirect || "/" })
251
+ .catch(() => {});
252
+ });
261
253
  })
262
254
  .catch(() => {
263
255
  this.loading = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kz-ui-base",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {