From 7bbd8da3bc18507355c81665dcac551cc232ab7a Mon Sep 17 00:00:00 2001 From: chenjinsong <523037378@qq.com> Date: Wed, 12 May 2021 11:43:43 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-607=20fix:=20login=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E3=80=81=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/assets/stylus/main.scss | 2 +- nezha-fronted/src/components/common/login.vue | 69 ++++++++++--------- nezha-fronted/src/permission.js | 23 +++++-- 3 files changed, 54 insertions(+), 40 deletions(-) diff --git a/nezha-fronted/src/assets/stylus/main.scss b/nezha-fronted/src/assets/stylus/main.scss index da50f7ead..8c718e581 100644 --- a/nezha-fronted/src/assets/stylus/main.scss +++ b/nezha-fronted/src/assets/stylus/main.scss @@ -362,7 +362,7 @@ li{ .nz-btn-disabled { background-image: none; opacity: .6; - cursor: default; + cursor: default !important; } .nz-btn-group { border-radius: 2px; diff --git a/nezha-fronted/src/components/common/login.vue b/nezha-fronted/src/components/common/login.vue index ced938448..735721f93 100644 --- a/nezha-fronted/src/components/common/login.vue +++ b/nezha-fronted/src/components/common/login.vue @@ -14,7 +14,7 @@
- +
@@ -27,7 +27,7 @@
{{license.warnInfo}}
-
INSTALLATION ID:{{license.token}}
+
INSTALLATION ID: {{license.token}}
import { mapActions } from 'vuex' -import moment from 'moment-timezone' export default { name: 'login', data () { @@ -75,7 +74,7 @@ export default { methods: { ...mapActions(['loginSuccess']), login () { - if (this.loading) { + if (this.loading || !this.license.valid) { return } // if (this.license.valid && this.validateLogin() && (this.$route.path == '/' || this.$route.path == '/login')) { @@ -112,9 +111,12 @@ export default { return true } }, - licenseStat: function () { + licenseStat () { + /*this.license.valid = false + this.license.warnInfo = 'hehehe' + this.license.token = 'dRqrWja/PzI8FrWVJeGqLw=='*/ this.$get('/sys/license/state').then(response => { - if (response.code === 200) { + if (response.code && response.code === 200) { this.license.warnInfo = '' this.license.valid = true } else { @@ -124,7 +126,7 @@ export default { this.license.token = response.token }) }, - handleChange: function (file, fileList) { + handleChange (file, fileList) { if (fileList.length > 0) { this.uploadFileList = [fileList[fileList.length - 1]] } @@ -144,7 +146,7 @@ export default { } }, watch: { - /* 'loginData.username': function(n, o) { + /* 'loginData.username'(n, o) { let lang = localStorage.getItem('nz-language-' + n); if (lang) { this.lang = lang; @@ -168,9 +170,13 @@ export default {