2019-12-04 13:45:37 +08:00
|
|
|
|
<template>
|
2021-10-13 09:17:51 +08:00
|
|
|
|
<div class="login">
|
2020-02-18 21:31:39 +08:00
|
|
|
|
<div class="model"></div>
|
2021-08-12 09:38:23 +08:00
|
|
|
|
<div class="login-main">
|
|
|
|
|
|
<div class="logo"><img src="../../assets/img/logo-big.png"></div>
|
|
|
|
|
|
<div class='login-box'>
|
|
|
|
|
|
<div class="login-label"></div>
|
|
|
|
|
|
<div class="login-input" v-if="!verifyShow">
|
|
|
|
|
|
<i class="nz-icon nz-icon-user"></i>
|
2021-08-13 14:43:39 +08:00
|
|
|
|
<input id="usernameInput" v-model="loginData.username" name="userName" autocomplete="on" :placeholder="$t('login.username')" @keydown.enter="login"></input>
|
2020-02-19 15:16:38 +08:00
|
|
|
|
</div>
|
2021-08-12 09:38:23 +08:00
|
|
|
|
<div class="login-label"></div>
|
|
|
|
|
|
<div class="login-input" v-if="!verifyShow">
|
|
|
|
|
|
<i class="nz-icon nz-icon-password"></i>
|
2021-08-13 14:43:39 +08:00
|
|
|
|
<input v-model="loginData.pin" type="password" name="password" autocomplete="on" :placeholder="$t('login.pin')" @keydown.enter="login"></input>
|
2019-12-05 16:48:23 +08:00
|
|
|
|
</div>
|
2021-08-12 09:38:23 +08:00
|
|
|
|
<div class="login-label" v-if="verifyShow">{{$t('login.verifyTitle')}}</div>
|
|
|
|
|
|
<div class="login-input" v-if="verifyShow">
|
|
|
|
|
|
<i class="nz-icon nz-icon-yanzhengma"></i>
|
2021-08-13 14:43:39 +08:00
|
|
|
|
<input v-model="loginData.authCode" name="newPassword" autocomplete="off" :placeholder="$t('login.verifyPlaceholder')" @keydown.enter="verify"></input>
|
2021-08-12 09:38:23 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="login-label-foot" v-if="verifyShow">
|
|
|
|
|
|
{{$t('login.verifyContent')}}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="login-foot">
|
|
|
|
|
|
<button v-if="!verifyShow" id="login" v-loading="loading" :class="{'nz-btn-disabled': !license.valid}" class="login-btn" @click="login">{{$t("login.login")}}</button>
|
|
|
|
|
|
<button v-if="verifyShow" id="verify" v-loading="loading" :class="{'nz-btn-disabled': !license.valid}" class="login-btn" @click="verify">{{$t("login.verify")}}</button>
|
2021-10-13 09:17:51 +08:00
|
|
|
|
<!-- <div class="login-foot-lang" @click.stop="langListShow = !langListShow">-->
|
|
|
|
|
|
<!-- <i v-if="lang == 'en'" class="nz-icon nz-icon-lang-en"></i>-->
|
|
|
|
|
|
<!-- <i v-else-if="lang == 'cn'" class="nz-icon nz-icon-lang-zh"></i>-->
|
|
|
|
|
|
<!-- <i class="nz-icon nz-icon-arrow-down"></i>-->
|
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
|
<!-- <div class="login-foot-lang-list" v-show="langListShow">-->
|
|
|
|
|
|
<!-- <i v-if="lang != 'en'" @click="changeLang('en')" class="nz-icon nz-icon-lang-en"></i>-->
|
|
|
|
|
|
<!-- <i v-if="lang != 'cn'" @click="changeLang('cn')" class="nz-icon nz-icon-lang-zh"></i>-->
|
|
|
|
|
|
<!-- </div>-->
|
2021-08-12 09:38:23 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="login-license">
|
|
|
|
|
|
<div class="license-warn" v-if="license.warnInfo">{{license.warnInfo}}</div>
|
|
|
|
|
|
<div v-if="!license.valid" class="license-info">INSTALLATION ID: {{license.token}}</div>
|
|
|
|
|
|
<div class="license-upload" v-if="!license.valid">
|
|
|
|
|
|
<el-upload
|
|
|
|
|
|
ref="upload"
|
|
|
|
|
|
accept=".xml"
|
|
|
|
|
|
action=""
|
|
|
|
|
|
:file-list="uploadFileList"
|
|
|
|
|
|
:auto-upload="false"
|
|
|
|
|
|
:on-change="handleChange"
|
2021-04-16 21:10:31 +08:00
|
|
|
|
>
|
2021-08-12 09:38:23 +08:00
|
|
|
|
<button type="button" class="login-btn" ><span style="margin-right: 5px"><i class="nz-icon nz-icon-upload"></i></span>{{$t('login.upload')}}</button>
|
|
|
|
|
|
</el-upload>
|
|
|
|
|
|
</div>
|
2021-04-16 21:10:31 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2020-12-16 13:02:53 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="login-foot-buildOn">
|
2020-12-16 14:09:44 +08:00
|
|
|
|
<span><a target="_blank" rel="noopener noreferrer" href='https://prometheus.io'>Build on Prometheus</a></span>
|
2019-12-04 13:45:37 +08:00
|
|
|
|
</div>
|
2021-08-12 09:38:23 +08:00
|
|
|
|
<el-dialog :visible.sync="authBindShow" :title="$t('login.verifyDialogTitle')" :modal-append-to-body='false'
|
|
|
|
|
|
:show-close="true" width="620px" class="nz-dialog" >
|
|
|
|
|
|
|
|
|
|
|
|
<div v-loading="dialogLoading">
|
|
|
|
|
|
<div class="login-dialog-title">
|
|
|
|
|
|
1 Download your preferred authenticator app to your phone (any will work). If you don't
|
|
|
|
|
|
have a preferred app, we recommend using <span @click="jumpDlw" class="verify-link">Google Authenticator.</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="login-dialog-title">
|
|
|
|
|
|
2 Use your app to take a photo of the QR code.
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="qrCode-box">
|
|
|
|
|
|
<div id="qrCode" ref="qrCodeDiv" class="qrCode-content"></div>
|
|
|
|
|
|
<div class="qrCode-text">
|
|
|
|
|
|
<div>Type this code down if you can't take a photo.</div>
|
|
|
|
|
|
<div class="qrCode-authKey">{{authKey}}</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="login-dialog-title">
|
|
|
|
|
|
3. Enter the 6-digit code provided by your app and then verify.
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="enter-code">Enter Code</div>
|
2021-08-19 17:00:57 +08:00
|
|
|
|
<el-input v-model="bindAuthCode" size="small" style="width: 50%" @keydown.enter="bindCode"></el-input>
|
2021-08-12 09:38:23 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div slot="footer" class="footer">
|
|
|
|
|
|
<button id="asset-edit-cancel" @click="closeDialog" class="footer__btn footer__btn--light">
|
|
|
|
|
|
<span>{{$t('overall.cancel')}}</span>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<button id="asset-edit-save" :class="{'footer__btn--disabled': prevent_opt.save}" :disabled="prevent_opt.save" class="footer__btn" @click="bindCode">
|
|
|
|
|
|
<span style="text-transform:capitalize">{{$t('login.verify')}}</span>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
<el-dialog :visible.sync="fileShow" :title="$t('login.verifyDialogTitle')" :modal-append-to-body='false'
|
|
|
|
|
|
:show-close="true" width="620px" class="nz-dialog" >
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<div class="login-dialog-title">
|
|
|
|
|
|
Should you ever lose your phone or access to your one time password secret, each of these recovery codes can be used one time each to regain access to your account.
|
|
|
|
|
|
Please save them in a safe place, or you will lose access to your account.
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="login-dialog-title2">
|
|
|
|
|
|
<div class="login-dialog-recover">
|
2021-08-19 17:00:57 +08:00
|
|
|
|
<div v-for="(item, index) in recoveryCode" :key="index" style="color: #999999;">
|
2021-08-12 17:13:11 +08:00
|
|
|
|
<span class="circle"></span>
|
2021-08-12 09:38:23 +08:00
|
|
|
|
{{item}}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span class="copy-value-content"> <i class="nz-icon nz-icon-override" @click="copyValue"></i></span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div slot="footer" class="footer">
|
|
|
|
|
|
<button id="asset-edit-download" :class="{'footer__btn--disabled': prevent_opt.save}" :disabled="prevent_opt.save" class="footer__btn" @click="downloadTxt">
|
|
|
|
|
|
<span style="text-transform:capitalize">{{$t('overall.download')}}</span>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-dialog>
|
2019-12-26 16:31:53 +08:00
|
|
|
|
</div>
|
2019-12-04 13:45:37 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2021-03-19 18:52:19 +08:00
|
|
|
|
import { mapActions } from 'vuex'
|
2021-08-12 09:38:23 +08:00
|
|
|
|
import QRCode from 'qrcodejs2'
|
2021-08-19 12:51:49 +08:00
|
|
|
|
import bus from '@/libs/bus.js'
|
2019-12-04 13:45:37 +08:00
|
|
|
|
export default {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
name: 'login',
|
|
|
|
|
|
data () {
|
2019-12-04 13:45:37 +08:00
|
|
|
|
return {
|
|
|
|
|
|
loginData: {
|
|
|
|
|
|
username: '',
|
2021-03-25 09:46:59 +08:00
|
|
|
|
pin: '',
|
2021-08-12 09:38:23 +08:00
|
|
|
|
remember: false,
|
|
|
|
|
|
authCode: ''
|
2019-12-04 13:45:37 +08:00
|
|
|
|
},
|
2021-04-16 21:10:31 +08:00
|
|
|
|
license: {
|
|
|
|
|
|
warnInfo: '',
|
|
|
|
|
|
token: '',
|
|
|
|
|
|
valid: false
|
|
|
|
|
|
},
|
|
|
|
|
|
uploadFileList: [],
|
|
|
|
|
|
uploadFile: { file: '', path: '', uuid: '' },
|
2020-12-08 21:53:37 +08:00
|
|
|
|
loading: false,
|
2021-10-13 09:17:51 +08:00
|
|
|
|
lang: 'en', // en/cn
|
2021-08-12 09:38:23 +08:00
|
|
|
|
verifyShow: false,
|
|
|
|
|
|
authBindShow: false,
|
|
|
|
|
|
authToken: '',
|
|
|
|
|
|
QRCode: '',
|
|
|
|
|
|
bindAuthCode: '',
|
2021-08-13 13:47:12 +08:00
|
|
|
|
authKey: '',
|
2021-08-12 09:38:23 +08:00
|
|
|
|
dialogLoading: false,
|
|
|
|
|
|
fileShow: false,
|
|
|
|
|
|
fileContent: '',
|
|
|
|
|
|
recoveryCode: []
|
2019-12-04 13:45:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
...mapActions(['loginSuccess']),
|
|
|
|
|
|
login () {
|
2021-05-12 11:43:43 +08:00
|
|
|
|
if (this.loading || !this.license.valid) {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
return
|
2020-12-08 21:53:37 +08:00
|
|
|
|
}
|
2021-04-26 21:42:15 +08:00
|
|
|
|
// if (this.license.valid && this.validateLogin() && (this.$route.path == '/' || this.$route.path == '/login')) {
|
|
|
|
|
|
if (this.validateLogin() && (this.$route.path == '/' || this.$route.path == '/login')) {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
this.loading = true
|
2021-08-13 13:47:12 +08:00
|
|
|
|
this.$post('/sys/login', this.loginData).then(res => {
|
2020-02-19 15:16:38 +08:00
|
|
|
|
if (res.code == 200) {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
// 登录成功,记录用户名、token和lang
|
2021-08-13 13:47:12 +08:00
|
|
|
|
this.authToken = res.data.authToken
|
2021-10-13 09:17:51 +08:00
|
|
|
|
this.lang = res.data.user.lang
|
|
|
|
|
|
this.$i18n.locale = this.lang
|
2021-08-13 13:47:12 +08:00
|
|
|
|
sessionStorage.setItem('nz-token', res.data.authToken)
|
2021-08-12 09:38:23 +08:00
|
|
|
|
if (res.data.authFlag === 1) {
|
|
|
|
|
|
if (res.data.authBind === 0) {
|
|
|
|
|
|
this.verifyShow = true
|
|
|
|
|
|
} else if (res.data.authBind === 1) {
|
|
|
|
|
|
this.authBindShow = true
|
|
|
|
|
|
this.dialogLoading = true
|
2021-08-13 13:47:12 +08:00
|
|
|
|
this.$post('/mfa/genkey', { authToken: this.authToken }).then(res => {
|
|
|
|
|
|
this.dialogLoading = false
|
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
this.authToken = res.data.authToken
|
|
|
|
|
|
this.authKey = res.data.authKey
|
|
|
|
|
|
this.bindQRCode(res.data.otpauth)
|
|
|
|
|
|
})
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.authBindShow = false
|
|
|
|
|
|
this.$message.error(res.message)
|
|
|
|
|
|
}
|
2021-08-12 09:38:23 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
sessionStorage.setItem('nz-username', this.loginData.username)
|
|
|
|
|
|
localStorage.setItem('nz-username', this.loginData.username)
|
|
|
|
|
|
localStorage.setItem('nz-prometheus-federation-enabled', res.data.prometheusFederationEnabled)
|
|
|
|
|
|
localStorage.setItem('nz-language', this.lang)
|
|
|
|
|
|
this.loginSuccess(res)
|
|
|
|
|
|
}
|
2020-02-19 15:16:38 +08:00
|
|
|
|
} else {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
this.$message.error(res.msg)
|
2020-02-19 15:16:38 +08:00
|
|
|
|
}
|
2020-12-08 21:53:37 +08:00
|
|
|
|
}).finally(() => {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
this.loading = false
|
|
|
|
|
|
})
|
2020-02-19 15:16:38 +08:00
|
|
|
|
}
|
2019-12-04 13:45:37 +08:00
|
|
|
|
},
|
2021-08-12 09:38:23 +08:00
|
|
|
|
verify () {
|
|
|
|
|
|
const params = {
|
|
|
|
|
|
authToken: this.authToken,
|
|
|
|
|
|
authCode: this.loginData.authCode
|
|
|
|
|
|
}
|
2021-08-13 13:47:12 +08:00
|
|
|
|
this.$post('/mfa/verify', params).then(res => {
|
2021-08-12 15:52:48 +08:00
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
|
sessionStorage.setItem('nz-username', this.loginData.username)
|
|
|
|
|
|
localStorage.setItem('nz-username', this.loginData.username)
|
|
|
|
|
|
localStorage.setItem('nz-prometheus-federation-enabled', res.data.prometheusFederationEnabled)
|
2021-10-14 13:40:13 +08:00
|
|
|
|
localStorage.setItem('nz-language', this.lang)
|
2021-08-12 15:52:48 +08:00
|
|
|
|
this.loginSuccess(res)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.authToken = res.data.authToken
|
2021-08-13 14:29:17 +08:00
|
|
|
|
this.$message.error(res.msg)
|
2021-08-12 15:52:48 +08:00
|
|
|
|
}
|
2021-08-12 09:38:23 +08:00
|
|
|
|
})
|
|
|
|
|
|
},
|
2021-10-13 09:17:51 +08:00
|
|
|
|
// changeLang (lang) {
|
|
|
|
|
|
// this.lang = lang
|
|
|
|
|
|
// this.langListShow = false
|
|
|
|
|
|
// this.$i18n.locale = 'cn'
|
|
|
|
|
|
// localStorage.setItem('nz-language', this.lang)
|
|
|
|
|
|
// },
|
2021-03-19 18:52:19 +08:00
|
|
|
|
validateLogin () {
|
2021-03-25 09:46:59 +08:00
|
|
|
|
if (!this.loginData.username || !this.loginData.pin) {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
this.$message.error('Empty username or password')
|
|
|
|
|
|
return false
|
2019-12-26 16:31:53 +08:00
|
|
|
|
} else {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
return true
|
2020-02-19 15:16:38 +08:00
|
|
|
|
}
|
2021-04-16 21:10:31 +08:00
|
|
|
|
},
|
2021-05-12 11:43:43 +08:00
|
|
|
|
licenseStat () {
|
2021-07-23 15:49:18 +08:00
|
|
|
|
/* this.license.valid = false
|
2021-05-12 11:43:43 +08:00
|
|
|
|
this.license.warnInfo = 'hehehe'
|
2021-07-23 15:49:18 +08:00
|
|
|
|
this.license.token = 'dRqrWja/PzI8FrWVJeGqLw==' */
|
2021-04-16 21:10:31 +08:00
|
|
|
|
this.$get('/sys/license/state').then(response => {
|
2021-05-12 11:43:43 +08:00
|
|
|
|
if (response.code && response.code === 200) {
|
2021-04-16 21:10:31 +08:00
|
|
|
|
this.license.warnInfo = ''
|
|
|
|
|
|
this.license.valid = true
|
|
|
|
|
|
} else {
|
2021-04-21 18:24:25 +08:00
|
|
|
|
this.license.valid = false
|
2021-04-16 21:10:31 +08:00
|
|
|
|
this.license.warnInfo = response.msg
|
|
|
|
|
|
}
|
|
|
|
|
|
this.license.token = response.token
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2021-05-12 11:43:43 +08:00
|
|
|
|
handleChange (file, fileList) {
|
2021-04-16 21:10:31 +08:00
|
|
|
|
if (fileList.length > 0) {
|
|
|
|
|
|
this.uploadFileList = [fileList[fileList.length - 1]]
|
|
|
|
|
|
}
|
|
|
|
|
|
this.uploadFile.file = this.uploadFileList[0]
|
|
|
|
|
|
this.upload()
|
|
|
|
|
|
},
|
|
|
|
|
|
upload () {
|
|
|
|
|
|
const form = new FormData()
|
|
|
|
|
|
form.append('file', this.uploadFile.file.raw)
|
|
|
|
|
|
this.$post('/sys/license/upload', form, { 'Content-Type': 'multipart/form-data' }).then(res => {
|
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
|
this.licenseStat()
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$message.error(res.msg)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2021-08-12 09:38:23 +08:00
|
|
|
|
},
|
|
|
|
|
|
bindQRCode: function (text) {
|
|
|
|
|
|
text = text || 'https://www.baidu.com'
|
|
|
|
|
|
if (!this.QRCode) {
|
|
|
|
|
|
this.QRCode = new QRCode(this.$refs.qrCodeDiv, {
|
|
|
|
|
|
text: text,
|
|
|
|
|
|
width: 124,
|
|
|
|
|
|
height: 124,
|
|
|
|
|
|
colorDark: '#333333', // 二维码颜色
|
|
|
|
|
|
colorLight: '#ffffff', // 二维码背景色
|
|
|
|
|
|
correctLevel: QRCode.CorrectLevel.L// 容错率,L/M/H
|
|
|
|
|
|
})
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.QRCode.makeCode(text)
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
closeDialog () {
|
|
|
|
|
|
this.authBindShow = false
|
|
|
|
|
|
this.bindAuthCode = ''
|
|
|
|
|
|
},
|
|
|
|
|
|
bindCode () {
|
|
|
|
|
|
this.prevent_opt.save = true
|
2021-08-13 13:47:12 +08:00
|
|
|
|
this.$post('/mfa/bind', { authToken: this.authToken, authCode: this.bindAuthCode }).then(res => {
|
2021-08-12 15:52:48 +08:00
|
|
|
|
this.prevent_opt.save = false
|
2021-08-12 09:38:23 +08:00
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
|
this.authBindShow = false
|
|
|
|
|
|
this.bindAuthCode = ''
|
2021-08-12 17:13:11 +08:00
|
|
|
|
this.recoveryCode = res.data.recoveryCode
|
2021-08-12 09:38:23 +08:00
|
|
|
|
this.fileContent = this.recoveryCode.join(' \n ')
|
|
|
|
|
|
this.fileShow = true
|
|
|
|
|
|
} else {
|
2021-08-13 13:47:12 +08:00
|
|
|
|
this.authToken = res.data.authToken
|
2021-08-12 09:38:23 +08:00
|
|
|
|
this.$message.error(this.$t('login.bindFail'))
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
jumpDlw () {
|
|
|
|
|
|
window.open('https://google-authenticator.en.softonic.com/android')
|
|
|
|
|
|
},
|
|
|
|
|
|
downloadTxt () {
|
|
|
|
|
|
const element = document.createElement('a')
|
|
|
|
|
|
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(this.fileContent))
|
2021-08-13 14:29:17 +08:00
|
|
|
|
element.setAttribute('download', 'Nezha recovery codes')
|
2021-08-12 09:38:23 +08:00
|
|
|
|
element.style.display = 'none'
|
|
|
|
|
|
element.click()
|
|
|
|
|
|
},
|
|
|
|
|
|
copyValue () {
|
|
|
|
|
|
const domUrl = document.createElement('input')
|
|
|
|
|
|
domUrl.value = this.fileContent
|
|
|
|
|
|
domUrl.id = 'creatDom'
|
|
|
|
|
|
document.body.appendChild(domUrl)
|
|
|
|
|
|
domUrl.select() // 选择对象
|
|
|
|
|
|
document.execCommand('Copy') // 执行浏览器复制命令
|
|
|
|
|
|
const creatDom = document.getElementById('creatDom')
|
|
|
|
|
|
creatDom.parentNode.removeChild(creatDom)
|
|
|
|
|
|
this.$message.success(this.$t('overall.copySuccess'))
|
2021-08-19 12:51:49 +08:00
|
|
|
|
},
|
|
|
|
|
|
initEvent () {
|
|
|
|
|
|
bus.$on('profile-dialog', () => {
|
|
|
|
|
|
this.authBindShow = true
|
|
|
|
|
|
})
|
2020-02-19 15:16:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
2021-05-12 11:43:43 +08:00
|
|
|
|
/* 'loginData.username'(n, o) {
|
2020-02-19 15:16:38 +08:00
|
|
|
|
let lang = localStorage.getItem('nz-language-' + n);
|
|
|
|
|
|
if (lang) {
|
2019-12-26 16:31:53 +08:00
|
|
|
|
this.lang = lang;
|
2020-03-12 18:04:04 +08:00
|
|
|
|
this.$i18n.locale = this.lang;
|
2020-02-19 15:16:38 +08:00
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
} */
|
2020-02-19 15:16:38 +08:00
|
|
|
|
},
|
2021-03-19 18:52:19 +08:00
|
|
|
|
mounted () {
|
|
|
|
|
|
const _this = this
|
|
|
|
|
|
this.$i18n.locale = this.lang
|
2021-08-13 14:43:39 +08:00
|
|
|
|
// document.onkeydown = function (e) {
|
|
|
|
|
|
// if (e.key === 'Enter') {
|
|
|
|
|
|
// _this.login()
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
2021-03-19 18:52:19 +08:00
|
|
|
|
document.getElementById('usernameInput').focus()
|
2021-04-16 21:10:31 +08:00
|
|
|
|
this.licenseStat()
|
2021-08-19 12:51:49 +08:00
|
|
|
|
this.initEvent()
|
2019-12-04 13:45:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
2020-02-18 21:31:39 +08:00
|
|
|
|
<style scoped lang="scss">
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.login {
|
2021-05-12 11:43:43 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
position: relative;
|
2019-12-26 16:31:53 +08:00
|
|
|
|
background-image: url("../../assets/img/login-background.png");
|
2020-02-18 21:31:39 +08:00
|
|
|
|
background-size: cover;
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
.model {
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
width: 100%;
|
2020-02-18 21:31:39 +08:00
|
|
|
|
background-color: rgba(130, 130, 135, 0.4);
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
z-index: 1;
|
2019-12-05 16:48:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-02-18 21:31:39 +08:00
|
|
|
|
.logo {
|
|
|
|
|
|
z-index: 2;
|
2021-05-12 11:43:43 +08:00
|
|
|
|
width: 460px;
|
2021-05-12 13:53:00 +08:00
|
|
|
|
img{
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2021-08-12 09:38:23 +08:00
|
|
|
|
.login-main {
|
|
|
|
|
|
z-index: 2;
|
|
|
|
|
|
background: rgba(106,106,106,0.5);
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
padding: 55px 50px 0px 50px;
|
|
|
|
|
|
}
|
2020-02-18 21:31:39 +08:00
|
|
|
|
.login-box {
|
|
|
|
|
|
z-index: 2;
|
2021-05-12 11:43:43 +08:00
|
|
|
|
width: 460px;
|
2021-08-12 09:38:23 +08:00
|
|
|
|
.login-label{
|
|
|
|
|
|
font-family: Roboto-Medium;
|
|
|
|
|
|
font-size: 22px;
|
|
|
|
|
|
color: #FFFFFF;
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
color: #ffffff;
|
|
|
|
|
|
}
|
|
|
|
|
|
.login-label-foot{
|
|
|
|
|
|
font-family: Roboto-Medium;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: #DEDEDE;
|
|
|
|
|
|
line-height: 20px;
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
color: #DEDEDE;
|
|
|
|
|
|
word-break: keep-all;
|
|
|
|
|
|
width: 90%;
|
|
|
|
|
|
}
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2020-02-18 21:31:39 +08:00
|
|
|
|
|
|
|
|
|
|
.login-box .login-input {
|
2021-05-12 11:43:43 +08:00
|
|
|
|
padding: 12px 0;
|
2020-02-18 21:31:39 +08:00
|
|
|
|
height: 60px;
|
2020-02-20 10:34:12 +08:00
|
|
|
|
position: relative;
|
|
|
|
|
|
}
|
|
|
|
|
|
.login-box .login-input .nz-icon {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
left: 18px;
|
|
|
|
|
|
top: 50%;
|
|
|
|
|
|
transform: translateY(-50%);
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
font-size: 20px;
|
2019-12-05 16:48:23 +08:00
|
|
|
|
}
|
2020-02-18 21:31:39 +08:00
|
|
|
|
.login-box .login-input input {
|
|
|
|
|
|
height: 100%;
|
2020-02-20 10:34:12 +08:00
|
|
|
|
width: calc(100% - 60px);
|
2020-02-18 21:31:39 +08:00
|
|
|
|
background-color: rgba(0, 0, 0, 0.55);
|
2020-02-20 10:34:12 +08:00
|
|
|
|
padding-left: 60px;
|
2020-02-18 21:31:39 +08:00
|
|
|
|
font-size: 20px;
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
outline: none;
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
border-radius: 4px;
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2020-02-18 21:31:39 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.login-foot {
|
2021-08-12 09:38:23 +08:00
|
|
|
|
padding-top: 15px;
|
2020-02-18 21:31:39 +08:00
|
|
|
|
display: flex;
|
2021-10-13 09:17:51 +08:00
|
|
|
|
width: 460px;
|
2020-02-18 21:31:39 +08:00
|
|
|
|
justify-content: space-between;
|
2020-02-19 15:16:38 +08:00
|
|
|
|
position: relative;
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2020-02-18 21:31:39 +08:00
|
|
|
|
|
|
|
|
|
|
.login-btn {
|
|
|
|
|
|
color: white;
|
2021-05-12 11:43:43 +08:00
|
|
|
|
border-radius: $--button-border-radius;
|
|
|
|
|
|
background-color: var(--theme-color-light-20);
|
2020-02-18 21:31:39 +08:00
|
|
|
|
border: none;
|
|
|
|
|
|
outline: none;
|
|
|
|
|
|
height: 44px;
|
2021-10-13 09:17:51 +08:00
|
|
|
|
width: 100%;
|
2020-02-18 21:31:39 +08:00
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
font-size: 14px;
|
2021-05-12 11:43:43 +08:00
|
|
|
|
transition: all linear .2s;
|
|
|
|
|
|
}
|
|
|
|
|
|
.login-btn:not(.nz-btn-disabled):hover {
|
|
|
|
|
|
background-color: var(--theme-color-light-30);
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2020-02-18 21:31:39 +08:00
|
|
|
|
|
2020-02-19 15:16:38 +08:00
|
|
|
|
.login-foot-lang {
|
2019-12-26 16:31:53 +08:00
|
|
|
|
position: relative;
|
2020-02-18 21:31:39 +08:00
|
|
|
|
cursor: pointer;
|
2021-08-12 09:38:23 +08:00
|
|
|
|
background: rgba(0,0,0,0.25);
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
padding: 0 14px;
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2020-02-20 10:34:12 +08:00
|
|
|
|
.login-foot-lang .nz-icon:not(.nz-icon-arrow-up):not(.nz-icon-arrow-down) {
|
|
|
|
|
|
font-size: 30px;
|
2020-02-18 21:31:39 +08:00
|
|
|
|
color: white;
|
|
|
|
|
|
margin-right: 30px;
|
2020-02-20 10:34:12 +08:00
|
|
|
|
line-height: 45px;
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2020-02-19 15:16:38 +08:00
|
|
|
|
.login-foot-lang-list {
|
|
|
|
|
|
position: absolute;
|
2020-02-20 10:34:12 +08:00
|
|
|
|
height: 25px;
|
|
|
|
|
|
padding: 12px;
|
2020-02-19 15:16:38 +08:00
|
|
|
|
background-color: rgba(0, 0, 0, 0.55);
|
2021-08-12 09:38:23 +08:00
|
|
|
|
top: 70px;
|
2020-02-19 15:16:38 +08:00
|
|
|
|
right: 0;
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.login-foot-lang-list .nz-icon {
|
2020-02-20 10:34:12 +08:00
|
|
|
|
font-size: 25px;
|
2020-02-19 15:16:38 +08:00
|
|
|
|
color: white;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
2020-12-08 21:53:37 +08:00
|
|
|
|
.login-foot .el-loading-spinner {
|
|
|
|
|
|
width: 36px;
|
|
|
|
|
|
height: 36px;
|
|
|
|
|
|
}
|
2020-02-19 15:16:38 +08:00
|
|
|
|
.login-foot-lang-list::before {
|
|
|
|
|
|
content: " ";
|
|
|
|
|
|
width: 0px;
|
|
|
|
|
|
height: 0px;
|
|
|
|
|
|
border-width: 10px;
|
|
|
|
|
|
border-style: solid;
|
|
|
|
|
|
border-color: transparent transparent rgba(0, 0, 0, 0.55) transparent;
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
top: -20px;
|
|
|
|
|
|
left: 50%;
|
|
|
|
|
|
transform: translateX(-50%);
|
|
|
|
|
|
}
|
2020-12-15 18:47:30 +08:00
|
|
|
|
.login-foot-buildOn{
|
2020-12-16 14:09:44 +08:00
|
|
|
|
position: absolute;
|
2020-12-16 17:09:02 +08:00
|
|
|
|
bottom: 20px;
|
2020-12-16 14:09:44 +08:00
|
|
|
|
z-index: 100;
|
2021-05-12 11:43:43 +08:00
|
|
|
|
left: 50%;
|
|
|
|
|
|
transform: translateX(-50%);
|
2020-12-15 18:47:30 +08:00
|
|
|
|
a{
|
2020-12-16 17:09:02 +08:00
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: #eee;
|
|
|
|
|
|
text-shadow: 1px 1px 3px #333;
|
2020-12-15 18:47:30 +08:00
|
|
|
|
text-decoration: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-02-18 21:31:39 +08:00
|
|
|
|
.nz-icon-arrow-down, .nz-icon-arrow-up {
|
2019-12-26 16:31:53 +08:00
|
|
|
|
position: absolute;
|
2020-02-18 21:31:39 +08:00
|
|
|
|
font-size: 18px;
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
top: 50%;
|
2021-08-12 09:38:23 +08:00
|
|
|
|
right: 8px;
|
2020-02-18 21:31:39 +08:00
|
|
|
|
transform: translateY(-50%);
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2021-04-16 21:10:31 +08:00
|
|
|
|
.login-license{
|
|
|
|
|
|
margin-top: 40px;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
line-height: 30px;
|
|
|
|
|
|
.license-warn{
|
2021-05-12 11:43:43 +08:00
|
|
|
|
color: #d92926;
|
|
|
|
|
|
text-shadow: 1px 1px 3px #ddd;
|
2021-04-16 21:10:31 +08:00
|
|
|
|
}
|
2021-05-12 11:43:43 +08:00
|
|
|
|
.license-info {
|
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
text-shadow: 1px 1px 3px #333;
|
2021-04-16 21:10:31 +08:00
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
.login-btn{
|
2021-05-12 11:43:43 +08:00
|
|
|
|
height: 40px;
|
|
|
|
|
|
width: auto;
|
|
|
|
|
|
padding: 0 20px;
|
2021-04-16 21:10:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-08-12 09:38:23 +08:00
|
|
|
|
.login-dialog-title{
|
|
|
|
|
|
background: #F9F9F9;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: #666666;
|
|
|
|
|
|
letter-spacing: 0;
|
|
|
|
|
|
line-height: 20px;
|
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
padding: 10px;
|
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
|
word-break: keep-all;
|
|
|
|
|
|
}
|
|
|
|
|
|
.login-dialog-title2{
|
|
|
|
|
|
background: rgba(246,248,250, 0.9);
|
|
|
|
|
|
border: 1px solid #E7EAED;
|
|
|
|
|
|
border-radius: 2px;
|
|
|
|
|
|
height: 248px;
|
|
|
|
|
|
padding: 15px;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
.copy-value-content{
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
right: 5px;
|
|
|
|
|
|
top: 5px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
.login-dialog-recover{
|
|
|
|
|
|
height: calc(100% - 30px);overflow-y: auto
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.enter-code{
|
|
|
|
|
|
ont-size: 14px;
|
|
|
|
|
|
color: #666666;
|
|
|
|
|
|
letter-spacing: 0;
|
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.qrCode-box{
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
.qrCode-content{
|
|
|
|
|
|
padding: 4px;
|
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.qrCode-text{
|
|
|
|
|
|
width: 60%;
|
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: #666666;
|
|
|
|
|
|
letter-spacing: 0;
|
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
}
|
|
|
|
|
|
.qrCode-authKey{
|
|
|
|
|
|
background: rgba(246,248,250,09);
|
|
|
|
|
|
border: 1px solid #E7EAED;
|
|
|
|
|
|
border-radius: 2px;
|
|
|
|
|
|
padding: 5px 12px;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: #333333;
|
|
|
|
|
|
letter-spacing: 0;
|
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
margin-top: 12px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.footer {
|
|
|
|
|
|
.footer__btn {
|
|
|
|
|
|
margin: 0 15px;
|
|
|
|
|
|
height: 30px;
|
|
|
|
|
|
min-width: 74px;
|
|
|
|
|
|
padding: 0 15px;
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
background-color: var(--theme-color);
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
outline: none;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
transition: background-color linear .2s, color linear .1s;
|
|
|
|
|
|
}
|
|
|
|
|
|
.footer__btn:hover:not(.footer__btn--disabled) {
|
|
|
|
|
|
background-color: var(--theme-color-light-20);
|
|
|
|
|
|
}
|
|
|
|
|
|
.footer__btn--light {
|
|
|
|
|
|
background-color: white;
|
|
|
|
|
|
border: 1px solid $--primary-border-color;
|
|
|
|
|
|
color: #333;
|
|
|
|
|
|
}
|
|
|
|
|
|
.footer__btn.footer__btn--light:hover:not(.footer__btn--disabled) {
|
|
|
|
|
|
background-color: white;
|
|
|
|
|
|
border-color: var(--theme-color-light-50);
|
|
|
|
|
|
color: var(--theme-color);
|
|
|
|
|
|
}
|
|
|
|
|
|
.footer__btn--disabled {
|
|
|
|
|
|
opacity: .6;
|
|
|
|
|
|
cursor: default;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/deep/ .nz-dialog .el-dialog__body{
|
|
|
|
|
|
padding-bottom: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
.verify-link{
|
|
|
|
|
|
font-family: Roboto-Black;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: #3C92F1;
|
|
|
|
|
|
letter-spacing: 0;
|
|
|
|
|
|
line-height: 20px;
|
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
.verify-link:hover{
|
|
|
|
|
|
border-bottom: 1px solid #3C92F1;
|
|
|
|
|
|
}
|
2021-08-12 17:13:11 +08:00
|
|
|
|
.circle{
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
width: 6px;
|
|
|
|
|
|
height: 6px;
|
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
background: #CECECE;
|
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
|
}
|
2021-04-16 21:10:31 +08:00
|
|
|
|
</style>
|
|
|
|
|
|
<style>
|
|
|
|
|
|
.license-upload .el-upload-list{
|
|
|
|
|
|
display: none;
|
|
|
|
|
|
}
|
2019-12-26 16:31:53 +08:00
|
|
|
|
</style>
|