Skip to content

Commit 8476d56

Browse files
committed
fix #7
1 parent a59d4a4 commit 8476d56

File tree

7 files changed

+61
-21
lines changed

7 files changed

+61
-21
lines changed

src/components/page/GlobalLayout.vue

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,25 @@
256256
}
257257
}
258258
259+
&.tablet {
260+
// overflow: hidden; text-overflow:ellipsis; white-space: nowrap;
261+
.top-nav-header-index {
262+
263+
.header-index-wide {
264+
265+
.header-index-left {
266+
.logo > a {
267+
overflow: hidden;
268+
text-overflow:ellipsis;
269+
white-space: nowrap;
270+
}
271+
}
272+
}
273+
}
274+
275+
}
276+
277+
259278
.top-nav-header-index {
260279
box-shadow: 0 1px 4px rgba(0,21,41,.08);
261280
position: relative;

src/components/tools/Logo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="logo">
3-
<router-link :to="{name:'dashboard'}" style="overflow: hidden; text-overflow:ellipsis; white-space: nowrap;">
3+
<router-link :to="{name:'dashboard'}">
44
<img src="~@/assets/logo.svg" alt="logo">
55
<h1 v-if="showTitle">{{ title }}</h1>
66
</router-link>

src/components/tools/TwoStepCaptcha.vue

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div slot="title" :style="{ textAlign: 'center' }">两步验证</div>
1010
<template slot="footer">
1111
<div :style="{ textAlign: 'center' }">
12-
<a-button key="back" @click="visible = false">返回</a-button>
12+
<a-button key="back" @click="handleCancel">返回</a-button>
1313
<a-button key="submit" type="primary" :loading="stepLoading" @click="handleStepOk">
1414
继续
1515
</a-button>
@@ -18,19 +18,21 @@
1818

1919
<a-spin :spinning="stepLoading">
2020
<a-form layout="vertical" :auto-form-create="(form)=>{this.form = form}">
21-
<p style="text-align: center" v-if="!stepLoading">请在手机中打开 Google Authenticator 或两步验证 APP<br />输入 6 位动态码</p>
22-
<p style="text-align: center" v-else>正在验证..<br/>请稍后</p>
23-
<a-form-item
24-
:style="{ textAlign: 'center' }"
25-
hasFeedback
26-
fieldDecoratorId="stepCode"
27-
:fieldDecoratorOptions="{rules: [{ required: true, message: '请输入 6 位动态码!', pattern: /^\d{6}$/, len: 6 }]}"
28-
>
29-
<a-input :style="{ textAlign: 'center' }" @keyup.enter.native="handleStepOk" placeholder="000000" />
30-
</a-form-item>
31-
<p style="text-align: center">
32-
<a @click="onForgeStepCode">遗失手机?</a>
33-
</p>
21+
<div class="step-form-wrapper">
22+
<p style="text-align: center" v-if="!stepLoading">请在手机中打开 Google Authenticator 或两步验证 APP<br />输入 6 位动态码</p>
23+
<p style="text-align: center" v-else>正在验证..<br/>请稍后</p>
24+
<a-form-item
25+
:style="{ textAlign: 'center' }"
26+
hasFeedback
27+
fieldDecoratorId="stepCode"
28+
:fieldDecoratorOptions="{rules: [{ required: true, message: '请输入 6 位动态码!', pattern: /^\d{6}$/, len: 6 }]}"
29+
>
30+
<a-input :style="{ textAlign: 'center' }" @keyup.enter.native="handleStepOk" placeholder="000000" />
31+
</a-form-item>
32+
<p style="text-align: center">
33+
<a @click="onForgeStepCode">遗失手机?</a>
34+
</p>
35+
</div>
3436
</a-form>
3537
</a-spin>
3638
</a-modal>
@@ -69,11 +71,19 @@ export default {
6971
})
7072
},
7173
handleCancel () {
72-
74+
this.visible = false
75+
this.$emit('cancel')
7376
},
7477
onForgeStepCode() {
7578
7679
}
7780
}
7881
};
79-
</script>
82+
</script>
83+
<style lang="scss" scoped>
84+
.step-form-wrapper {
85+
margin: 0 auto;
86+
width: 80%;
87+
max-width: 400px;
88+
}
89+
</style>

src/config/router.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const asyncRouterMap = [
77
name: 'index',
88
component: BasicLayout,
99
meta: { title: '首页' },
10-
redirect: '/dashboard/analysis',
10+
redirect: '/dashboard/workplace',
1111
children: [
1212
// dashboard
1313
{

src/defaultConfig.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* primaryColor - 默认主题色
44
* navTheme - sidebar theme ['dark', 'light'] 两种主题
55
* colorWeak - 色盲模式
6+
* layout - 整体布局方式 ['sidemenu', 'topmenu'] 两种布局
67
*
78
* storageOptions: {} - Vue-ls 插件配置项 (localStorage/sessionStorage)
89
*

src/utils/device.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const enquireScreen = function (call) {
1616
call && call(1)
1717
}
1818
}
19-
enquireJs.register('screen and (max-width: 980.99px)', handler)
19+
enquireJs.register('screen and (max-width: 1087.99px)', handler)
2020
enquireJs.register('screen and (max-width: 767.99px)', handler2)
2121
}
2222

src/views/user/Login.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@
8484
</div>
8585
</a-form>
8686

87-
<two-step-captcha v-if="requiredTwoStepCaptcha" :visible="stepCaptchaVisible" @success="stepCaptchaSuccess"></two-step-captcha>
87+
<two-step-captcha
88+
v-if="requiredTwoStepCaptcha"
89+
:visible="stepCaptchaVisible"
90+
@success="stepCaptchaSuccess"
91+
@cancel="stepCaptchaCancel"></two-step-captcha>
8892
</div>
8993
</template>
9094

@@ -132,7 +136,7 @@
132136
133137
},
134138
methods: {
135-
...mapActions([ "Login" ]),
139+
...mapActions([ "Login", "Logout" ]),
136140
// handler
137141
handleUsernameOrEmail (rule, value, callback) {
138142
const regex = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
@@ -230,6 +234,12 @@
230234
stepCaptchaSuccess () {
231235
this.loginSuccess()
232236
},
237+
stepCaptchaCancel () {
238+
this.Logout().then(() => {
239+
this.loginBtn = false
240+
this.stepCaptchaVisible = false
241+
})
242+
},
233243
loginSuccess () {
234244
this.loginBtn = false
235245
this.$router.push({ name: "dashboard" })

0 commit comments

Comments
 (0)