Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ant-design-pro-vue
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tianzhuanghu
ant-design-pro-vue
Commits
8476d565
Commit
8476d565
authored
Nov 12, 2018
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #7
parent
a59d4a43
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
22 deletions
+62
-22
GlobalLayout.vue
src/components/page/GlobalLayout.vue
+19
-0
Logo.vue
src/components/tools/Logo.vue
+1
-1
TwoStepCaptcha.vue
src/components/tools/TwoStepCaptcha.vue
+27
-17
router.config.js
src/config/router.config.js
+1
-1
defaultConfig.js
src/defaultConfig.js
+1
-0
device.js
src/utils/device.js
+1
-1
Login.vue
src/views/user/Login.vue
+12
-2
No files found.
src/components/page/GlobalLayout.vue
View file @
8476d565
...
...
@@ -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
{
box-shadow
:
0
1px
4px
rgba
(
0
,
21
,
41
,
.08
);
position
:
relative
;
...
...
src/components/tools/Logo.vue
View file @
8476d565
<
template
>
<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"
>
<h1
v-if=
"showTitle"
>
{{
title
}}
</h1>
</router-link>
...
...
src/components/tools/TwoStepCaptcha.vue
View file @
8476d565
...
...
@@ -9,7 +9,7 @@
<div
slot=
"title"
:style=
"
{ textAlign: 'center' }">两步验证
</div>
<template
slot=
"footer"
>
<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>
...
...
@@ -18,19 +18,21 @@
<a-spin
:spinning=
"stepLoading"
>
<a-form
layout=
"vertical"
:auto-form-create=
"(form)=>{this.form = form}"
>
<p
style=
"text-align: center"
v-if=
"!stepLoading"
>
请在手机中打开 Google Authenticator 或两步验证 APP
<br
/>
输入 6 位动态码
</p>
<p
style=
"text-align: center"
v-else
>
正在验证..
<br/>
请稍后
</p>
<a-form-item
:style=
"{ textAlign: 'center' }"
hasFeedback
fieldDecoratorId=
"stepCode"
:fieldDecoratorOptions=
"{rules: [{ required: true, message: '请输入 6 位动态码!', pattern: /^\d{6}$/, len: 6 }]}"
>
<a-input
:style=
"{ textAlign: 'center' }"
@
keyup
.
enter
.
native=
"handleStepOk"
placeholder=
"000000"
/>
</a-form-item>
<p
style=
"text-align: center"
>
<a
@
click=
"onForgeStepCode"
>
遗失手机?
</a>
</p>
<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-else
>
正在验证..
<br/>
请稍后
</p>
<a-form-item
:style=
"{ textAlign: 'center' }"
hasFeedback
fieldDecoratorId=
"stepCode"
:fieldDecoratorOptions=
"{rules: [{ required: true, message: '请输入 6 位动态码!', pattern: /^\d{6}$/, len: 6 }]}"
>
<a-input
:style=
"{ textAlign: 'center' }"
@
keyup
.
enter
.
native=
"handleStepOk"
placeholder=
"000000"
/>
</a-form-item>
<p
style=
"text-align: center"
>
<a
@
click=
"onForgeStepCode"
>
遗失手机?
</a>
</p>
</div>
</a-form>
</a-spin>
</a-modal>
...
...
@@ -69,11 +71,19 @@ export default {
})
},
handleCancel
()
{
this
.
visible
=
false
this
.
$emit
(
'cancel'
)
},
onForgeStepCode
()
{
}
}
};
</
script
>
\ No newline at end of file
</
script
>
<
style
lang=
"scss"
scoped
>
.step-form-wrapper
{
margin
:
0
auto
;
width
:
80%
;
max-width
:
400px
;
}
</
style
>
\ No newline at end of file
src/config/router.config.js
View file @
8476d565
...
...
@@ -7,7 +7,7 @@ export const asyncRouterMap = [
name
:
'index'
,
component
:
BasicLayout
,
meta
:
{
title
:
'首页'
},
redirect
:
'/dashboard/
analysis
'
,
redirect
:
'/dashboard/
workplace
'
,
children
:
[
// dashboard
{
...
...
src/defaultConfig.js
View file @
8476d565
...
...
@@ -3,6 +3,7 @@
* primaryColor - 默认主题色
* navTheme - sidebar theme ['dark', 'light'] 两种主题
* colorWeak - 色盲模式
* layout - 整体布局方式 ['sidemenu', 'topmenu'] 两种布局
*
* storageOptions: {} - Vue-ls 插件配置项 (localStorage/sessionStorage)
*
...
...
src/utils/device.js
View file @
8476d565
...
...
@@ -16,7 +16,7 @@ const enquireScreen = function (call) {
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
)
}
...
...
src/views/user/Login.vue
View file @
8476d565
...
...
@@ -84,7 +84,11 @@
</div>
</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>
</
template
>
...
...
@@ -132,7 +136,7 @@
},
methods
:
{
...
mapActions
([
"Login"
]),
...
mapActions
([
"Login"
,
"Logout"
]),
// handler
handleUsernameOrEmail
(
rule
,
value
,
callback
)
{
const
regex
=
/^
([
a-zA-Z0-9_-
])
+@
([
a-zA-Z0-9_-
])
+
((\.[
a-zA-Z0-9_-
]{2,3}){1,2})
$/
;
...
...
@@ -230,6 +234,12 @@
stepCaptchaSuccess
()
{
this
.
loginSuccess
()
},
stepCaptchaCancel
()
{
this
.
Logout
().
then
(()
=>
{
this
.
loginBtn
=
false
this
.
stepCaptchaVisible
=
false
})
},
loginSuccess
()
{
this
.
loginBtn
=
false
this
.
$router
.
push
({
name
:
"dashboard"
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment