Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
apaas-login
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gzga-jzapi
apaas-login
Commits
82258cf5
You need to sign in or sign up before continuing.
Commit
82258cf5
authored
Sep 18, 2021
by
张俊
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
https://cloud.wodcloud.com/git/apaas/apaas-login
into dev
parents
fb65f81f
91fe4ad0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
310 additions
and
77 deletions
+310
-77
.beagle.yml
.beagle.yml
+1
-1
config/index.js
config/index.js
+47
-19
src/components/bg-identify.vue
src/components/bg-identify.vue
+183
-0
src/pages/login.vue
src/pages/login.vue
+79
-57
No files found.
.beagle.yml
View file @
82258cf5
...
@@ -104,7 +104,7 @@ pipeline:
...
@@ -104,7 +104,7 @@ pipeline:
namespace
:
apaas-v3
namespace
:
apaas-v3
deployment
:
apaas-login
deployment
:
apaas-login
container
:
apaas-login
container
:
apaas-login
registry
:
registry.cn-qingdao.aliyuncs.com
registry
:
registry.cn-qingdao.aliyuncs.com
/wod/apaas-login:v3.0
when
:
when
:
branch
:
branch
:
-
dev
-
dev
...
...
config/index.js
View file @
82258cf5
'
use strict
'
"
use strict
"
;
// Template version: 1.3.1
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.
// see http://vuejs-templates.github.io/webpack for documentation.
const
path
=
require
(
'
path
'
)
const
path
=
require
(
"
path
"
);
module
.
exports
=
{
module
.
exports
=
{
dev
:
{
dev
:
{
// Paths
// Paths
assetsSubDirectory
:
'
static
'
,
assetsSubDirectory
:
"
static
"
,
assetsPublicPath
:
'
/
'
,
assetsPublicPath
:
"
/
"
,
proxyTable
:
{},
proxyTable
:
{
"
/apaas
"
:
{
target
:
"
https://apaas3.wodcloud.com/apaas/
"
,
changeOrigin
:
true
,
pathRewrite
:
{
"
^/apaas
"
:
""
,
},
},
"
/awecloud
"
:
{
target
:
"
https://apaas3.wodcloud.com/awecloud/
"
,
changeOrigin
:
true
,
pathRewrite
:
{
"
^/awecloud
"
:
""
,
},
},
"
/vmap
"
:
{
target
:
"
https://apaas3.wodcloud.com/vmap/
"
,
changeOrigin
:
true
,
pathRewrite
:
{
"
^/vmap
"
:
""
,
},
},
"
/iam
"
:
{
target
:
"
https://apaas3.wodcloud.com/iam/
"
,
changeOrigin
:
true
,
pathRewrite
:
{
"
^/iam
"
:
""
,
},
},
},
// Various Dev Server settings
// Various Dev Server settings
host
:
'
localhost
'
,
// can be overwritten by process.env.HOST
host
:
"
localhost
"
,
// can be overwritten by process.env.HOST
port
:
8080
,
// can be overwritten by process.env.PORT, if port is in use, a free one will be determined
port
:
8080
,
// can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser
:
false
,
autoOpenBrowser
:
false
,
errorOverlay
:
true
,
errorOverlay
:
true
,
...
@@ -33,44 +61,44 @@ module.exports = {
...
@@ -33,44 +61,44 @@ module.exports = {
*/
*/
// https://webpack.js.org/configuration/devtool/#development
// https://webpack.js.org/configuration/devtool/#development
devtool
:
'
cheap-module-eval-source-map
'
,
devtool
:
"
cheap-module-eval-source-map
"
,
// If you have problems debugging vue-files in devtools,
// If you have problems debugging vue-files in devtools,
// set this to false - it *may* help
// set this to false - it *may* help
// https://vue-loader.vuejs.org/en/options.html#cachebusting
// https://vue-loader.vuejs.org/en/options.html#cachebusting
cacheBusting
:
true
,
cacheBusting
:
true
,
cssSourceMap
:
true
cssSourceMap
:
true
,
},
},
build
:
{
build
:
{
// Template for index.html
// Template for index.html
index
:
path
.
resolve
(
__dirname
,
'
../dist
'
,
'
iam
'
,
'
login
'
,
'
index.html
'
),
index
:
path
.
resolve
(
__dirname
,
"
../dist
"
,
"
iam
"
,
"
login
"
,
"
index.html
"
),
// Paths
// Paths
assetsRoot
:
path
.
resolve
(
__dirname
,
'
../dist
'
,
'
iam
'
,
'
login
'
),
assetsRoot
:
path
.
resolve
(
__dirname
,
"
../dist
"
,
"
iam
"
,
"
login
"
),
assetsSubDirectory
:
'
static
'
,
assetsSubDirectory
:
"
static
"
,
assetsPublicPath
:
'
/iam/login/
'
,
assetsPublicPath
:
"
/iam/login/
"
,
/**
/**
* Source Maps
* Source Maps
*/
*/
productionSourceMap
:
true
,
productionSourceMap
:
true
,
// https://webpack.js.org/configuration/devtool/#production
// https://webpack.js.org/configuration/devtool/#production
devtool
:
'
#source-map
'
,
devtool
:
"
#source-map
"
,
// Gzip off by default as many popular static hosts such as
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
// npm install --save-dev compression-webpack-plugin
productionGzip
:
false
,
productionGzip
:
false
,
productionGzipExtensions
:
[
'
js
'
,
'
css
'
],
productionGzipExtensions
:
[
"
js
"
,
"
css
"
],
// Run the build command with an extra argument to
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport
:
process
.
env
.
npm_config_report
bundleAnalyzerReport
:
process
.
env
.
npm_config_report
,
}
}
,
}
}
;
src/components/bg-identify.vue
0 → 100644
View file @
82258cf5
<
template
>
<div
class=
"bg-identify"
@
click=
"refreshCode"
>
<canvas
:width=
"contentWidth"
:height=
"contentHeight"
></canvas>
</div>
</
template
>
<
script
>
export
default
{
name
:
"
BgIdentify
"
,
model
:
{
prop
:
"
identifyCode
"
,
event
:
"
change
"
,
},
props
:
{
identifyCode
:
{
type
:
String
,
default
:
"
1234
"
,
},
fontSizeMin
:
{
type
:
Number
,
default
:
25
,
},
fontSizeMax
:
{
type
:
Number
,
default
:
30
,
},
backgroundColorMin
:
{
type
:
Number
,
default
:
255
,
},
backgroundColorMax
:
{
type
:
Number
,
default
:
255
,
},
colorMin
:
{
type
:
Number
,
default
:
0
,
},
colorMax
:
{
type
:
Number
,
default
:
160
,
},
lineColorMin
:
{
type
:
Number
,
default
:
100
,
},
lineColorMax
:
{
type
:
Number
,
default
:
255
,
},
dotColorMin
:
{
type
:
Number
,
default
:
0
,
},
dotColorMax
:
{
type
:
Number
,
default
:
255
,
},
contentWidth
:
{
type
:
Number
,
default
:
150
,
},
contentHeight
:
{
type
:
Number
,
default
:
38
,
},
},
data
()
{
return
{
identifyCodes
:
"
1234567890
"
,
};
},
methods
:
{
randomNum
(
min
,
max
)
{
return
Math
.
floor
(
Math
.
random
()
*
(
max
-
min
)
+
min
);
},
randomColor
(
min
,
max
)
{
let
r
=
this
.
randomNum
(
min
,
max
);
let
g
=
this
.
randomNum
(
min
,
max
);
let
b
=
this
.
randomNum
(
min
,
max
);
return
"
rgb(
"
+
r
+
"
,
"
+
g
+
"
,
"
+
b
+
"
)
"
;
},
drawPic
()
{
let
canvas
=
this
.
$el
.
querySelector
(
"
canvas
"
);
let
ctx
=
canvas
.
getContext
(
"
2d
"
);
ctx
.
textBaseline
=
"
bottom
"
;
ctx
.
fillStyle
=
this
.
randomColor
(
this
.
backgroundColorMin
,
this
.
backgroundColorMax
);
ctx
.
fillRect
(
0
,
0
,
this
.
contentWidth
,
this
.
contentHeight
);
for
(
let
i
=
0
;
i
<
this
.
identifyCode
.
length
;
i
++
)
{
this
.
drawText
(
ctx
,
this
.
identifyCode
[
i
],
i
);
}
this
.
drawLine
(
ctx
);
this
.
drawDot
(
ctx
);
},
drawText
(
ctx
,
txt
,
i
)
{
ctx
.
fillStyle
=
this
.
randomColor
(
this
.
colorMin
,
this
.
colorMax
);
ctx
.
font
=
this
.
randomNum
(
this
.
fontSizeMin
,
this
.
fontSizeMax
)
+
"
px SimHei
"
;
let
x
=
(
i
+
1
)
*
(
this
.
contentWidth
/
(
this
.
identifyCode
.
length
+
1
));
let
y
=
this
.
randomNum
(
this
.
fontSizeMax
,
this
.
contentHeight
-
5
);
var
deg
=
this
.
randomNum
(
-
45
,
45
);
// 修改坐标原点和旋转角度
ctx
.
translate
(
x
,
y
);
ctx
.
rotate
((
deg
*
Math
.
PI
)
/
180
);
ctx
.
fillText
(
txt
,
0
,
0
);
// 恢复坐标原点和旋转角度
ctx
.
rotate
((
-
deg
*
Math
.
PI
)
/
180
);
ctx
.
translate
(
-
x
,
-
y
);
},
drawLine
(
ctx
)
{
// 绘制干扰线
for
(
let
i
=
0
;
i
<
5
;
i
++
)
{
ctx
.
strokeStyle
=
this
.
randomColor
(
this
.
lineColorMin
,
this
.
lineColorMax
);
ctx
.
beginPath
();
ctx
.
moveTo
(
this
.
randomNum
(
0
,
this
.
contentWidth
),
this
.
randomNum
(
0
,
this
.
contentHeight
)
);
ctx
.
lineTo
(
this
.
randomNum
(
0
,
this
.
contentWidth
),
this
.
randomNum
(
0
,
this
.
contentHeight
)
);
ctx
.
stroke
();
}
},
drawDot
(
ctx
)
{
// 绘制干扰点
for
(
let
i
=
0
;
i
<
80
;
i
++
)
{
ctx
.
fillStyle
=
this
.
randomColor
(
0
,
255
);
ctx
.
beginPath
();
ctx
.
arc
(
this
.
randomNum
(
0
,
this
.
contentWidth
),
this
.
randomNum
(
0
,
this
.
contentHeight
),
1
,
0
,
2
*
Math
.
PI
);
ctx
.
fill
();
}
},
refreshCode
()
{
let
identifyCode
=
""
;
for
(
let
i
=
0
;
i
<
4
;
i
++
)
{
identifyCode
+=
this
.
identifyCodes
[
this
.
randomNum
(
0
,
this
.
identifyCodes
.
length
)
];
}
this
.
$emit
(
"
change
"
,
identifyCode
);
this
.
$nextTick
(()
=>
{
this
.
drawPic
();
});
},
},
mounted
()
{
if
(
this
.
identifyCode
)
{
this
.
drawPic
();
}
else
{
this
.
refreshCode
();
}
},
};
</
script
>
<
style
scoped
>
.bg-identify
{
border
:
1px
solid
#dcdfe6
;
box-sizing
:
border-box
;
border-radius
:
8px
;
overflow
:
hidden
;
}
.bg-identify
>
canvas
{
display
:
block
;
}
</
style
>
src/pages/login.vue
View file @
82258cf5
...
@@ -50,17 +50,20 @@
...
@@ -50,17 +50,20 @@
class=
"yzm"
class=
"yzm"
:class=
"ruleFormIcon.yzm ? '' : 'icon_show'"
:class=
"ruleFormIcon.yzm ? '' : 'icon_show'"
>
>
<el-input
<div
class=
"yzm_ctx"
>
v-model.trim=
"yzms.yzm"
<el-input
placeholder=
"请输入验证码"
class=
"yzm_ipt"
:validate-event=
"false"
v-model.trim=
"yzms.yzm"
></el-input>
placeholder=
"请输入验证码"
<img
:validate-event=
"false"
class=
"yzm_img"
></el-input>
title=
"看不清?换一张"
<img
:src=
"imgSrc"
class=
"yzm_img"
@
click=
"getImg()"
title=
"看不清?换一张"
/>
:src=
"imgSrc"
@
click=
"getImg()"
/>
</div>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<el-form>
<el-form>
...
@@ -230,8 +233,8 @@
...
@@ -230,8 +233,8 @@
<div
v-if=
"registerActive == 1"
>
<div
v-if=
"registerActive == 1"
>
<el-form
<el-form
:model=
"yzms"
:model=
"yzms"
:rules=
"yzmRules"
:rules=
"yzmRules
1
"
ref=
"yzms"
ref=
"yzms
_1
"
class=
"demo-ruleForm"
class=
"demo-ruleForm"
>
>
<el-form-item
<el-form-item
...
@@ -239,16 +242,19 @@
...
@@ -239,16 +242,19 @@
:class=
"ruleFormIcon.yzm ? 'yzm' : 'yzm icon_show'"
:class=
"ruleFormIcon.yzm ? 'yzm' : 'yzm icon_show'"
>
>
<p
class=
"item_p"
>
验证码
</p>
<p
class=
"item_p"
>
验证码
</p>
<el-input
<div
class=
"yzm_ctx"
>
v-model.trim=
"yzms.yzm"
<el-input
placeholder=
"请输入验证码"
class=
"yzm_ipt"
:validate-event=
"false"
v-model.trim=
"yzms.yzm"
></el-input>
placeholder=
"请输入验证码"
<s-identify
></el-input>
class=
"yzm_img"
:identifyCode=
"identifyCode"
<bg-identify
@
click.native=
"refreshCode()"
class=
"yzm_img"
></s-identify>
ref=
"bgIdentify"
v-model=
"identifyCode"
/>
</div>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
...
@@ -291,13 +297,15 @@
...
@@ -291,13 +297,15 @@
</div>
</div>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
getCookie
,
clearCookie
,
setCookie
}
from
"
@/utils/common.js
"
;
import
{
getCookie
,
clearCookie
,
setCookie
}
from
"
@/utils/common.js
"
;
import
SIdentify
from
"
@/components/sidentify
"
;
import
SIdentify
from
"
@/components/sidentify
"
;
import
CryptoJS
from
"
crypto-js
"
;
//加密js
import
BgIdentify
from
"
@/components/bg-identify
"
;
import
CryptoJS
from
"
crypto-js
"
;
// 加密js
export
default
{
export
default
{
components
:
{
SIdentify
},
components
:
{
SIdentify
,
BgIdentify
},
data
()
{
data
()
{
var
validatePass
=
(
rule
,
value
,
callback
)
=>
{
var
validatePass
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
!==
this
.
ruleForm_0
.
password1
)
{
if
(
value
!==
this
.
ruleForm_0
.
password1
)
{
...
@@ -426,9 +434,22 @@ export default {
...
@@ -426,9 +434,22 @@ export default {
callback
(
new
Error
(
response
.
data
.
errMsg
));
callback
(
new
Error
(
response
.
data
.
errMsg
));
}
}
})
})
.
catch
(
function
(
response
)
{});
.
catch
(
function
(
response
)
{});
}
};
var
validateCheckCode
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
==
""
)
{
callback
(
new
Error
(
"
请输入验证码
"
));
}
else
{
if
(
value
!==
this
.
identifyCode
)
{
callback
(
new
Error
(
"
验证码错误
"
));
this
.
refreshCode
();
}
else
{
callback
();
}
}
}
};
};
return
{
return
{
form
:
{
form
:
{
userid
:
""
,
userid
:
""
,
...
@@ -458,6 +479,13 @@ export default {
...
@@ -458,6 +479,13 @@ export default {
yzmRules
:
{
yzmRules
:
{
yzm
:
[{
validator
:
validateYzm
}],
yzm
:
[{
validator
:
validateYzm
}],
},
},
identifyCode
:
""
,
yzmRules1
:
{
yzm
:
[
{
required
:
true
,
message
:
"
请输入验证码
"
,
trigger
:
"
blur
"
},
{
validator
:
validateCheckCode
,
trigger
:
"
blur
"
},
],
},
yzmState
:
false
,
yzmState
:
false
,
ruleFormIcon
:
{
ruleFormIcon
:
{
userid1
:
true
,
userid1
:
true
,
...
@@ -607,7 +635,7 @@ export default {
...
@@ -607,7 +635,7 @@ export default {
this
.
imgSrc
=
response
.
data
.
data
.
captcha
;
this
.
imgSrc
=
response
.
data
.
data
.
captcha
;
}
}
})
})
.
catch
(
function
(
response
)
{});
.
catch
(
function
(
response
)
{});
},
},
changePass
()
{
changePass
()
{
this
.
visible
=
!
this
.
visible
;
this
.
visible
=
!
this
.
visible
;
...
@@ -629,8 +657,9 @@ export default {
...
@@ -629,8 +657,9 @@ export default {
},
},
makeCode
(
o
,
l
)
{
makeCode
(
o
,
l
)
{
for
(
let
i
=
0
;
i
<
l
;
i
++
)
{
for
(
let
i
=
0
;
i
<
l
;
i
++
)
{
this
.
identifyCode
+=
this
.
identifyCode
+=
this
.
identifyCodes
[
this
.
identifyCodes
[
this
.
randomNum
(
0
,
this
.
identifyCodes
.
length
)];
this
.
randomNum
(
0
,
this
.
identifyCodes
.
length
)
];
}
}
},
},
getOrganizations
()
{
getOrganizations
()
{
...
@@ -644,7 +673,7 @@ export default {
...
@@ -644,7 +673,7 @@ export default {
let
self
=
this
;
let
self
=
this
;
self
.
$refs
[
"
ruleForm_1
"
].
validate
((
valid
,
obj
)
=>
{
self
.
$refs
[
"
ruleForm_1
"
].
validate
((
valid
,
obj
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
self
.
$refs
[
"
yzms
"
].
validate
((
volid_yzm
,
obj_yzm
)
=>
{
self
.
$refs
[
"
yzms
_1
"
].
validate
((
volid_yzm
,
obj_yzm
)
=>
{
if
(
volid_yzm
)
{
if
(
volid_yzm
)
{
self
.
submitAll
();
self
.
submitAll
();
}
else
{
}
else
{
...
@@ -762,7 +791,26 @@ export default {
...
@@ -762,7 +791,26 @@ export default {
},
},
};
};
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.yzm_ctx
{
width
:
80%
;
margin-left
:
10%
;
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
}
.yzm_ctx
.yzm_ipt
{
width
:
calc
(
100%
-
170px
);
margin
:
0
!important
;
flex-grow
:
1
;
}
.yzm_ctx
.yzm_img
{
width
:
150px
;
flex-shrink
:
0
;
margin-left
:
20px
;
}
.login_backg
{
.login_backg
{
height
:
100vh
;
height
:
100vh
;
background
:
url("~@/assets/image/img_bg.jpg")
center
center
;
background
:
url("~@/assets/image/img_bg.jpg")
center
center
;
...
@@ -890,19 +938,6 @@ export default {
...
@@ -890,19 +938,6 @@ export default {
cursor
:
pointer
;
cursor
:
pointer
;
background
:
url("~@/assets/image/login_eye_dis.png")
no-repeat
center
center
;
background
:
url("~@/assets/image/login_eye_dis.png")
no-repeat
center
center
;
}
}
.login
.yzm
.el-input
{
width
:
42%
;
margin-left
:
10%
;
}
.yzm
{
position
:
relative
;
}
.yzm
.yzm_img
{
position
:
absolute
;
width
:
30%
;
margin-left
:
5%
;
cursor
:
pointer
;
}
.footer_message
{
.footer_message
{
width
:
500px
;
width
:
500px
;
text-align
:
center
;
text-align
:
center
;
...
@@ -970,19 +1005,6 @@ export default {
...
@@ -970,19 +1005,6 @@ export default {
}
}
</
style
>
</
style
>
<
style
>
<
style
>
.login
.yzm
.el-input
{
width
:
40%
;
margin-left
:
10%
;
}
.yzm
{
position
:
relative
;
}
.yzm
.yzm_img
{
position
:
absolute
;
width
:
30%
;
margin-left
:
5%
;
cursor
:
pointer
;
}
.login
.el-input__suffix
{
.login
.el-input__suffix
{
font-size
:
20px
;
font-size
:
20px
;
right
:
10px
;
right
:
10px
;
...
...
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