Commit 8476d565 by Sendya

fix #7

parent a59d4a43
...@@ -256,6 +256,25 @@ ...@@ -256,6 +256,25 @@
} }
} }
&.tablet {
// overflow: hidden; text-overflow:ellipsis; white-space: nowrap;
.top-nav-header-index {
.header-index-wide {
.header-index-left {
.logo > a {
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
}
}
}
}
.top-nav-header-index { .top-nav-header-index {
box-shadow: 0 1px 4px rgba(0,21,41,.08); box-shadow: 0 1px 4px rgba(0,21,41,.08);
position: relative; position: relative;
......
<template> <template>
<div class="logo"> <div class="logo">
<router-link :to="{name:'dashboard'}" style="overflow: hidden; text-overflow:ellipsis; white-space: nowrap;"> <router-link :to="{name:'dashboard'}">
<img src="~@/assets/logo.svg" alt="logo"> <img src="~@/assets/logo.svg" alt="logo">
<h1 v-if="showTitle">{{ title }}</h1> <h1 v-if="showTitle">{{ title }}</h1>
</router-link> </router-link>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<div slot="title" :style="{ textAlign: 'center' }">两步验证</div> <div slot="title" :style="{ textAlign: 'center' }">两步验证</div>
<template slot="footer"> <template slot="footer">
<div :style="{ textAlign: 'center' }"> <div :style="{ textAlign: 'center' }">
<a-button key="back" @click="visible = false">返回</a-button> <a-button key="back" @click="handleCancel">返回</a-button>
<a-button key="submit" type="primary" :loading="stepLoading" @click="handleStepOk"> <a-button key="submit" type="primary" :loading="stepLoading" @click="handleStepOk">
继续 继续
</a-button> </a-button>
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<a-spin :spinning="stepLoading"> <a-spin :spinning="stepLoading">
<a-form layout="vertical" :auto-form-create="(form)=>{this.form = form}"> <a-form layout="vertical" :auto-form-create="(form)=>{this.form = form}">
<div class="step-form-wrapper">
<p style="text-align: center" v-if="!stepLoading">请在手机中打开 Google Authenticator 或两步验证 APP<br />输入 6 位动态码</p> <p style="text-align: center" v-if="!stepLoading">请在手机中打开 Google Authenticator 或两步验证 APP<br />输入 6 位动态码</p>
<p style="text-align: center" v-else>正在验证..<br/>请稍后</p> <p style="text-align: center" v-else>正在验证..<br/>请稍后</p>
<a-form-item <a-form-item
...@@ -31,6 +32,7 @@ ...@@ -31,6 +32,7 @@
<p style="text-align: center"> <p style="text-align: center">
<a @click="onForgeStepCode">遗失手机?</a> <a @click="onForgeStepCode">遗失手机?</a>
</p> </p>
</div>
</a-form> </a-form>
</a-spin> </a-spin>
</a-modal> </a-modal>
...@@ -69,7 +71,8 @@ export default { ...@@ -69,7 +71,8 @@ export default {
}) })
}, },
handleCancel () { handleCancel () {
this.visible = false
this.$emit('cancel')
}, },
onForgeStepCode() { onForgeStepCode() {
...@@ -77,3 +80,10 @@ export default { ...@@ -77,3 +80,10 @@ export default {
} }
}; };
</script> </script>
<style lang="scss" scoped>
.step-form-wrapper {
margin: 0 auto;
width: 80%;
max-width: 400px;
}
</style>
\ No newline at end of file
...@@ -7,7 +7,7 @@ export const asyncRouterMap = [ ...@@ -7,7 +7,7 @@ export const asyncRouterMap = [
name: 'index', name: 'index',
component: BasicLayout, component: BasicLayout,
meta: { title: '首页' }, meta: { title: '首页' },
redirect: '/dashboard/analysis', redirect: '/dashboard/workplace',
children: [ children: [
// dashboard // dashboard
{ {
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
* primaryColor - 默认主题色 * primaryColor - 默认主题色
* navTheme - sidebar theme ['dark', 'light'] 两种主题 * navTheme - sidebar theme ['dark', 'light'] 两种主题
* colorWeak - 色盲模式 * colorWeak - 色盲模式
* layout - 整体布局方式 ['sidemenu', 'topmenu'] 两种布局
* *
* storageOptions: {} - Vue-ls 插件配置项 (localStorage/sessionStorage) * storageOptions: {} - Vue-ls 插件配置项 (localStorage/sessionStorage)
* *
......
...@@ -16,7 +16,7 @@ const enquireScreen = function (call) { ...@@ -16,7 +16,7 @@ const enquireScreen = function (call) {
call && call(1) call && call(1)
} }
} }
enquireJs.register('screen and (max-width: 980.99px)', handler) enquireJs.register('screen and (max-width: 1087.99px)', handler)
enquireJs.register('screen and (max-width: 767.99px)', handler2) enquireJs.register('screen and (max-width: 767.99px)', handler2)
} }
......
...@@ -84,7 +84,11 @@ ...@@ -84,7 +84,11 @@
</div> </div>
</a-form> </a-form>
<two-step-captcha v-if="requiredTwoStepCaptcha" :visible="stepCaptchaVisible" @success="stepCaptchaSuccess"></two-step-captcha> <two-step-captcha
v-if="requiredTwoStepCaptcha"
:visible="stepCaptchaVisible"
@success="stepCaptchaSuccess"
@cancel="stepCaptchaCancel"></two-step-captcha>
</div> </div>
</template> </template>
...@@ -132,7 +136,7 @@ ...@@ -132,7 +136,7 @@
}, },
methods: { methods: {
...mapActions([ "Login" ]), ...mapActions([ "Login", "Logout" ]),
// handler // handler
handleUsernameOrEmail (rule, value, callback) { handleUsernameOrEmail (rule, value, callback) {
const regex = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/; const regex = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
...@@ -230,6 +234,12 @@ ...@@ -230,6 +234,12 @@
stepCaptchaSuccess () { stepCaptchaSuccess () {
this.loginSuccess() this.loginSuccess()
}, },
stepCaptchaCancel () {
this.Logout().then(() => {
this.loginBtn = false
this.stepCaptchaVisible = false
})
},
loginSuccess () { loginSuccess () {
this.loginBtn = false this.loginBtn = false
this.$router.push({ name: "dashboard" }) this.$router.push({ name: "dashboard" })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment