Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
so-manage-ui
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
smart-operation
so-manage-ui
Commits
7846e648
Commit
7846e648
authored
Mar 21, 2023
by
赵伟庚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[feat](登录页): 对接登录页配置接口,登录页按照配置显示
parent
5df31795
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
338 additions
and
242 deletions
+338
-242
src/components/bg-menu.vue
src/components/bg-menu.vue
+101
-101
src/page/login/index.vue
src/page/login/index.vue
+46
-11
src/page/main/config/loginPage/index.vue
src/page/main/config/loginPage/index.vue
+99
-28
src/page/password/account-form.vue
src/page/password/account-form.vue
+46
-61
src/page/password/index.vue
src/page/password/index.vue
+21
-35
src/page/password/password-form.vue
src/page/password/password-form.vue
+3
-4
src/page/registe/index.vue
src/page/registe/index.vue
+1
-1
src/services/helper.js
src/services/helper.js
+4
-0
src/services/rules.js
src/services/rules.js
+12
-0
src/store/index.js
src/store/index.js
+5
-1
No files found.
src/components/bg-menu.vue
View file @
7846e648
...
...
@@ -4,34 +4,36 @@
:class=
"
{
transparent: transparentBg,
'is-front': isFront,
}"
>
}">
<!-- LOGO -->
<div
@
click=
"gotoPage"
class=
"bg-logo"
>
<img
style=
"width:140px;height:22px;"
src=
"../assets/imgs/img_logo.png"
/>
<img
style=
"width: 140px; height: 22px"
:src=
"systemLogo ? JSON.parse(systemLogo)[0].url : getImageUrl('img_logo.png')"
/>
</div>
<div
class=
"person-menu"
v-if=
"userInfo
&& userInfo.system_id"
>
<div
class=
"person-menu"
v-if=
"userInfo
&& userInfo.system_id"
>
<!-- 用户中心 -->
<div
class=
"user-center nav-item"
>
<span
class=
"user-icon"
>
<img
style=
"width:24px;height:24px;border-radius:50%;vertical-align:middle;"
v-if=
"userInfo&&userInfo.logo"
:src=
"userInfo&&userInfo.logo"
/>
<img
style=
"width:24px;height:24px;border-radius:50%;vertical-align:middle;"
v-else
src=
"../assets/imgs/home_ic_user.png"
/>
<img
style=
"width: 24px; height: 24px; border-radius: 50%; vertical-align: middle"
v-if=
"userInfo && userInfo.logo"
:src=
"userInfo && userInfo.logo"
/>
<img
style=
"width: 24px; height: 24px; border-radius: 50%; vertical-align: middle"
v-else
src=
"../assets/imgs/home_ic_user.png"
/>
</span>
<span
class=
"user-name"
v-if=
"userInfo && userInfo.system_id"
>
{{
userInfo
.
system_account
||
userInfo
.
system_id
}}
<bg-icon
icon=
"#bg-ic-arrow-down"
style=
"font-size:8px;margin-left: 3px;"
></bg-icon>
</span>
<span
class=
"user-name"
v-else
>
请登录
<bg-icon
icon=
"#bg-ic-arrow-down"
style=
"font-size: 8px; margin-left: 3px"
></bg-icon>
</span>
<span
class=
"user-name"
v-else
>
请登录
</span>
<div
class=
"menu-virtual"
></div>
<div
v-if=
"userInfo && userInfo.system_id"
class=
"menu-list"
>
<div
class=
"menu-item text_clip"
@
click.stop=
"menuAction('logout')"
>
退出登录
</div>
<div
class=
"menu-item text_clip"
@
click.stop=
"menuAction('logout')"
>
退出登录
</div>
</div>
</div>
</div>
...
...
@@ -41,34 +43,36 @@
<
script
>
import
{
mapState
,
mapMutations
}
from
"
vuex
"
;
import
{
clearCookie
}
from
"
../services/cookie.js
"
;
import
{
resetRouter
}
from
'
../router/index
'
import
{
normalizeProps
}
from
'
vue-demi
'
;
import
{
resetRouter
}
from
"
../router/index
"
;
import
{
normalizeProps
}
from
"
vue-demi
"
;
import
{
getImageUrl
}
from
"
@/services/helper.js
"
;
export
default
{
name
:
"
BgMenu
"
,
components
:
{
},
props
:{
path
:{
type
:
String
,
default
:
''
components
:
{},
props
:
{
path
:
{
type
:
String
,
default
:
""
,
},
},
data
()
{
return
{
getImageUrl
,
documentScrollTop
:
0
,
cartList
:
[],
showCart
:
true
,
showShopMenu
:
false
,
logo
:
'
../assets/imgs/img_logo.png
'
,
name
:
''
logo
:
"
../assets/imgs/img_logo.png
"
,
name
:
""
,
};
},
computed
:
{
msgUnreadNum
(){
return
this
.
$store
.
state
.
msgUnreadNum
msgUnreadNum
()
{
return
this
.
$store
.
state
.
msgUnreadNum
;
},
nameFlag
(){
return
this
.
$store
.
state
.
nameFlag
nameFlag
()
{
return
this
.
$store
.
state
.
nameFlag
;
},
userInfo
()
{
return
this
.
$store
.
state
.
userInfo
||
{};
...
...
@@ -78,57 +82,57 @@ export default {
},
transparentBg
()
{
return
(
this
.
documentScrollTop
<
180
&&
(
this
.
$route
.
name
===
"
shopRecommend
"
||
this
.
$route
.
name
===
"
shopSearch
"
)
this
.
documentScrollTop
<
180
&&
(
this
.
$route
.
name
===
"
shopRecommend
"
||
this
.
$route
.
name
===
"
shopSearch
"
)
);
},
isFront
()
{
let
path
=
this
.
$route
.
path
;
return
false
return
false
;
},
systemLogo
()
{
return
this
.
$store
.
state
.
systemLogo
;
},
...
mapState
({
fontMenu
(
state
)
{
let
temp
=
[]
fontMenu
(
state
)
{
let
temp
=
[]
;
// state.menu.forEach(e => {
// if(e.dict_group_id=='2cb4f767-fad7-44f2-afa3-f055e15dd2b6'){//font
// temp.push(e)
// }
// });
return
temp
return
temp
;
},
managerMenu
(
state
){
let
temp
=
[]
managerMenu
(
state
)
{
let
temp
=
[]
;
// state.menu.forEach(e => {
// if(e.dict_group_id=='64c156e0-bfff-4bfc-a63a-56effe130a25'){//system
// // 暂时处理运营管控中心-调用日志,后期规划位置后修改
// if (e.menuName !== '运营看板') {
// temp.push(e)
// }
// // temp.push(e)
// }
// });
return
temp
return
temp
;
},
systemMenu
(
state
){
let
temp
=
[]
state
.
menu
.
forEach
(
e
=>
{
if
(
e
.
dict_group_id
==
'
09938937-3db9-47de-b967-7777ea4ebb2d
'
){
//manager
temp
.
push
(
e
)
systemMenu
(
state
)
{
let
temp
=
[];
state
.
menu
.
forEach
((
e
)
=>
{
if
(
e
.
dict_group_id
==
"
09938937-3db9-47de-b967-7777ea4ebb2d
"
)
{
//manager
temp
.
push
(
e
);
}
});
return
temp
}
})
return
temp
;
},
}),
},
watch
:
{
nameFlag
(
n
,
o
)
{
this
.
getLogo
()
}
nameFlag
(
n
,
o
)
{
this
.
getLogo
()
;
}
,
// cartState() {
// this.getCartList();
// },
...
...
@@ -138,26 +142,25 @@ export default {
},
methods
:
{
openMsg
()
{
this
.
$emit
(
'
openMsg
'
,
true
)
this
.
$emit
(
"
openMsg
"
,
true
);
},
...
mapMutations
([
"
setCartNum
"
]),
navAction
(
path
)
{
this
.
$router
.
push
(
path
);
},
gotoPage
(){
window
.
open
(
'
/apaas/portal/ui/#/
'
,
'
_blank
'
)
gotoPage
()
{
window
.
open
(
"
/apaas/portal/ui/#/
"
,
"
_blank
"
);
},
changezz
(
item
){
this
.
$trace
.
setOptionValue
(
'
appID
'
,
item
.
value
)
changezz
(
item
)
{
this
.
$trace
.
setOptionValue
(
"
appID
"
,
item
.
value
);
},
getLogo
(){
getLogo
()
{
// this.$axios.get(`/apaas/system/getPicAndSystemName`).then(res=>{
// if(res.data.code==200){
// let data = res.data.data
// this.name=data.systemName
// this.logo = data.picture
// document.title = this.name
// var link = document.querySelector("link[rel*='icon']")||document.createElement('link');
// link.type = 'image/x-icon';
// link.rel = 'shortcut icon';
...
...
@@ -166,19 +169,19 @@ export default {
// }
// })
},
menuAction
(
n
,
parent
)
{
menuAction
(
n
,
parent
)
{
if
(
n
==
"
logout
"
)
{
this
.
$axios
.
post
(
`/apaas/system/v5/user/logout`
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
'
200
'
)
{
this
.
$axios
.
post
(
`/apaas/system/v5/user/logout`
).
then
(
(
res
)
=>
{
if
(
res
.
data
.
code
==
"
200
"
)
{
window
.
location
.
href
=
`/apaas/manage/ui/#/login`
;
this
.
$store
.
commit
(
'
setUserInfo
'
,
null
)
clearCookie
(
'
bgToken
'
)
this
.
$message
.
success
(
'
退出成功
'
)
resetRouter
()
}
else
{
this
.
$message
.
error
(
'
退出失败
'
)
this
.
$store
.
commit
(
"
setUserInfo
"
,
null
);
clearCookie
(
"
bgToken
"
);
this
.
$message
.
success
(
"
退出成功
"
);
resetRouter
()
;
}
else
{
this
.
$message
.
error
(
"
退出失败
"
);
}
})
})
;
}
else
if
(
n
==
"
login
"
)
{
let
path
=
this
.
$route
.
path
;
window
.
location
.
href
=
`/apaas/manage/ui/#/login?redirect=
${
path
}
`
;
...
...
@@ -186,38 +189,38 @@ export default {
//是否有子路由,有则寻找子路由的第一个进行跳转,无则直接进行跳转
//使用childMenuAction是模拟template中,子路径点击跳转使用childMenuAction,
//防止出现层级错误的问题
if
(
parent
.
children
&&
parent
.
children
.
length
&&
parent
.
menuType
!==
1
)
{
this
.
childMenuAction
(
parent
.
children
[
0
],
parent
)
}
else
{
this
.
pathToUrl
(
n
,
parent
)
if
(
parent
.
children
&&
parent
.
children
.
length
&&
parent
.
menuType
!==
1
)
{
this
.
childMenuAction
(
parent
.
children
[
0
],
parent
);
}
else
{
this
.
pathToUrl
(
n
,
parent
);
}
}
},
childMenuAction
(
v
,
parent
)
{
childMenuAction
(
v
,
parent
)
{
//最多只有2层目录,childMenuAction已经进入第一层,只需判断是否还有第二层即可
//有第二层则继续找第二层的第一个跳转
//无第二层则直接跳转
if
(
v
.
children
&&
v
.
children
.
length
)
{
if
(
v
.
children
&&
v
.
children
.
length
)
{
for
(
let
index
=
0
;
index
<
v
.
children
.
length
;
index
++
)
{
const
e
=
v
.
children
[
index
];
if
(
e
.
menuType
!==
2
)
{
this
.
pathToUrl
(
e
,
parent
)
break
if
(
e
.
menuType
!==
2
)
{
this
.
pathToUrl
(
e
,
parent
);
break
;
}
}
}
else
{
this
.
pathToUrl
(
v
,
parent
)
}
else
{
this
.
pathToUrl
(
v
,
parent
);
}
},
pathToUrl
(
item
,
parent
)
{
pathToUrl
(
item
,
parent
)
{
//判断是否是外链,是则新开窗口跳转
if
(
item
.
path
.
includes
(
'
http
'
))
{
window
.
open
(
item
.
path
,
'
_blank
'
)
}
else
{
if
(
item
.
path
.
includes
(
"
http
"
))
{
window
.
open
(
item
.
path
,
"
_blank
"
);
}
else
{
//判断是否是新窗口打开
if
(
item
.
new_window
)
{
window
.
open
(
item
.
path
,
'
_blank
'
)
}
else
{
if
(
item
.
new_window
)
{
window
.
open
(
item
.
path
,
"
_blank
"
);
}
else
{
this
.
$router
.
push
(
item
.
path
);
}
}
...
...
@@ -231,18 +234,16 @@ export default {
scrollAction
()
{
this
.
documentScrollTop
=
document
.
documentElement
.
scrollTop
||
0
;
},
},
created
()
{
this
.
getLogo
()
this
.
getLogo
()
;
if
(
this
.
userInfo
)
{
// this.getUserDetail(this.userInfo.user_id)
}
else
{
}
else
{
// this.getUserInfo()
}
},
mounted
()
{
this
.
$nextTick
(
this
.
scrollAction
);
window
.
addEventListener
(
"
scroll
"
,
this
.
scrollAction
,
true
);
window
.
addEventListener
(
"
click
"
,
this
.
shopMenEventListener
);
...
...
@@ -280,19 +281,18 @@ export default {
}
}
>
.menu-virtual
{
>
.menu-virtual
{
width
:
128px
;
height
:
10px
;
position
:
absolute
;
top
:
49px
;
right
:
0
;
z-index
:
9
;
background-color
:
rgba
(
0
,
0
,
0
,
0
);
background-color
:
rgba
(
0
,
0
,
0
,
0
);
}
>
.menu-list
{
box-shadow
:
0px
4px
12px
0px
rgba
(
18
,
30
,
63
,
0
.1
);
box-shadow
:
0px
4px
12px
0px
rgba
(
18
,
30
,
63
,
0
.1
);
background-color
:
#ffffff
;
border-radius
:
4px
;
overflow
:
hidden
;
...
...
@@ -362,15 +362,15 @@ export default {
font-size
:
24px
;
font-weight
:
bolder
;
margin-left
:
10px
;
background
:
linear-gradient
(
to
bottom
,
#d6e0fc
,
#9cb0e5
);
-webkit-background-clip
:text
;
color
:transparent
;
background
:
linear-gradient
(
to
bottom
,
#d6e0fc
,
#9cb0e5
);
-webkit-background-clip
:
text
;
color
:
transparent
;
line-height
:
40px
;
}
}
//个人菜单
.person-menu
{
.person-menu
{
height
:
100%
;
padding-left
:
32px
;
position
:
inherit
;
...
...
@@ -378,14 +378,14 @@ export default {
align-items
:
center
;
column-gap
:
35px
;
.message
{
.message
{
height
:
16px
;
line-height
:
16px
;
background-color
:
#d14731
;
border-radius
:
8px
;
padding
:
0
6px
;
font-size
:
12px
;
color
:
#ffffff
;
color
:
#ffffff
;
position
:
absolute
;
top
:
-8px
;
left
:
12px
;
...
...
src/page/login/index.vue
View file @
7846e648
<
template
>
<div
class=
"login-container"
>
<div
class=
"login-container"
:style=
"
{
'background-image': `url(${
configOptions.backgroundUrl ? JSON.parse(configOptions.backgroundUrl)[0].url : getImageUrl('bg.png')
})`,
}">
<div
class=
"bg-warning"
>
系统有效期剩余345 天,请管理员及时更换license!
</div>
<div
class=
"bg-main"
>
<!--
<div
class=
"bg-logo"
>
...
...
@@ -23,9 +29,17 @@
</div>
<!-- v-if="pageType !== 'register'" -->
<div
class=
"bg-msg"
>
<p>
Copyright © 比格大数据, All Rights Reserved.
</p>
<p>
ICP备案序号:晋ICP备12000773号 | 晋公网安备 14010602060307号
</p>
<p>
法律声明 | 隐私政策
</p>
<p
v-if=
"configOptions && configOptions.patent"
>
{{
configOptions
.
patent
}}
</p>
<p
v-if=
"configOptions"
>
<span
class=
"can_click_text"
@
click=
"open(configOptions.icpUrl)"
>
{{
configOptions
.
icpFiling
}}
|
</span>
<span
class=
"can_click_text"
@
click=
"open(configOptions.publicSecurityUrl)"
>
{{
configOptions
.
publicSecurityFiling
}}
</span>
</p>
<p>
<span
class=
"can_click_text"
@
click=
"open(configOptions.legalStatementUrl)"
>
法律声明
</span>
|
<span
class=
"can_click_text"
@
click=
"open(configOptions.privacyPolicyUrl)"
>
隐私政策
</span>
</p>
</div>
</div>
</
template
>
...
...
@@ -33,18 +47,18 @@
<
script
setup
>
import
LoginByAccount
from
"
@/components/login-by-account.vue
"
;
import
LoginByCode
from
"
@/components/login-by-code.vue
"
;
// import RegisterPersonalUser from "@/components/register-personal-user.vue";
// import RegisterFrimUser from "@/components/register-firm-user.vue";
// import RegisterOrgUser from "@/components/register-org-user.vue";
// import RegisterSuccess from "@/components/register-success.vue";
import
{
ref
,
computed
,
onMounted
}
from
"
vue
"
;
import
axios
from
"
axios
"
;
import
{
ElMessage
}
from
"
element-plus
"
;
import
{
ref
,
onBeforeMount
,
onMounted
}
from
"
vue
"
;
import
{
useRouter
}
from
"
vue-router
"
;
import
store
from
"
../../store
"
;
import
{
getImageUrl
}
from
"
@/services/helper.js
"
;
const
router
=
useRouter
();
const
pageType
=
ref
(
"
login
"
);
const
loginTab
=
ref
(
"
account
"
);
const
registerTab
=
ref
(
"
registerTab
"
);
const
configOptions
=
ref
({});
const
switchPageType
=
(
type
)
=>
{
// pageType.value = type
router
.
push
(
"
/registe
"
);
...
...
@@ -52,13 +66,34 @@ const switchPageType = (type) => {
const
password
=
()
=>
{
router
.
push
(
"
/password
"
);
};
const
getLoginPageConfig
=
()
=>
{
axios
.
get
(
`/apaas/system/v5/login/loginDetail`
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
configOptions
.
value
=
res
.
data
.
data
||
null
;
store
.
commit
(
"
setSystemLogo
"
,
configOptions
.
value
.
logoUrl
);
}
else
{
ElMessage
.
error
(
res
.
data
.
data
);
}
});
};
const
open
=
(
url
)
=>
{
if
(
url
!==
""
)
{
window
.
open
(
url
);
}
else
{
return
;
}
};
onBeforeMount
(()
=>
{
getLoginPageConfig
();
});
</
script
>
<
style
lang=
"scss"
scoped
>
.login-container
{
width
:
100vw
;
height
:
calc
(
100vh
-
56px
);
background-image
:
url("@/assets/imgs/bg
_zhuce
.png")
;
background-image
:
url("@/assets/imgs/bg.png")
;
background-size
:
100%
100%
;
background-position
:
center
center
;
position
:
relative
;
...
...
src/page/main/config/loginPage/index.vue
View file @
7846e648
...
...
@@ -4,55 +4,60 @@
<bg-breadcrumb></bg-breadcrumb>
<div
class=
"main_container"
>
<div
class=
"form_content apaas_scroll_nor"
>
<el-form
ref=
"refForm"
:model=
"formData"
:rules=
"rules"
label-width=
"
82
px"
class=
"registerForm"
>
<el-form-item
label=
"LOGO"
prop=
"logo"
>
<el-form
ref=
"refForm"
:model=
"formData"
:rules=
"rules"
label-width=
"
96
px"
class=
"registerForm"
>
<el-form-item
label=
"LOGO"
prop=
"logo
Url
"
>
<bg-upload-image
v-model=
"formData.logo"
:fileSize=
"1"
v-model=
"formData.logoUrl"
:showTips=
"true"
customTips=
"请选择图片上传:支持jpg、png等格式,图片需小于500KBB"
customTips=
"请选择图片上传:支持jpg、png等格式,图片需小于500KB"
:fileSize=
"500"
:fileSizeUnit=
"'KB'"
:limit=
"1"
listType=
"picture-card"
@
change=
"changeLogo"
:accept=
"['.jpg', '.jpeg', '.png']"
></bg-upload-image>
</el-form-item>
<el-form-item
label=
"登录背景图"
prop=
"ba
nner
"
>
<el-form-item
label=
"登录背景图"
prop=
"ba
ckgroundUrl
"
>
<bg-upload-image
v-model=
"formData.ba
nner
"
:fileSize=
"
1
"
v-model=
"formData.ba
ckgroundUrl
"
:fileSize=
"
2
"
:showTips=
"true"
customTips=
"请选择图片上传:大小1920 * 1026像素支持jpg、png等格式,图片需小于
1
MB"
customTips=
"请选择图片上传:大小1920 * 1026像素支持jpg、png等格式,图片需小于
2
MB"
:limit=
"1"
listType=
"picture-card"
@
change=
"changeBanner"
:accept=
"['.jpg', '.jpeg', '.png']"
></bg-upload-image>
</el-form-item>
<bg-form-gap
title=
"底部所有权内容"
></bg-form-gap>
<el-form-item
label=
"内容"
prop=
"force"
>
<el-input
placeholder=
"例如:Copyright © 某某大数据, All Rights Reserved."
maxlength=
"100"
></el-input>
<el-form-item
label=
"内容"
prop=
"patent"
>
<el-input
v-model.trim=
"formData.patent"
placeholder=
"例如:Copyright © 某某大数据, All Rights Reserved."
></el-input>
</el-form-item>
<bg-form-gap
title=
"底部ICP备案"
></bg-form-gap>
<el-form-item
label=
"内容"
prop=
"
force
"
>
<el-input
placeholder=
"请输入"
maxlength=
"100
"
></el-input>
<el-form-item
label=
"内容"
prop=
"
icpFiling
"
>
<el-input
placeholder=
"请输入"
v-model.trim=
"formData.icpFiling
"
></el-input>
</el-form-item>
<el-form-item
label=
"跳转连接"
prop=
"
force
"
>
<el-input
placeholder=
"例如:https://...或http://..."
maxlength=
"100
"
></el-input>
<el-form-item
label=
"跳转连接"
prop=
"
icpUrl
"
>
<el-input
placeholder=
"例如:https://...或http://..."
v-model.trim=
"formData.icpUrl
"
></el-input>
</el-form-item>
<bg-form-gap
title=
"底部公安网备案"
></bg-form-gap>
<el-form-item
label=
"内容"
prop=
"
force
"
>
<el-input
placeholder=
"请输入"
maxlength=
"100
"
></el-input>
<el-form-item
label=
"内容"
prop=
"
publicSecurityFiling
"
>
<el-input
placeholder=
"请输入"
v-model.trim=
"formData.publicSecurityFiling
"
></el-input>
</el-form-item>
<el-form-item
label=
"跳转连接"
prop=
"
force
"
>
<el-input
placeholder=
"例如:https://...或http://..."
maxlength=
"100
"
></el-input>
<el-form-item
label=
"跳转连接"
prop=
"
publicSecurityUrl
"
>
<el-input
placeholder=
"例如:https://...或http://..."
v-model.trim=
"formData.publicSecurityUrl
"
></el-input>
</el-form-item>
<bg-form-gap
title=
"法律声明"
></bg-form-gap>
<el-form-item
label=
"跳转连接"
prop=
"
force
"
>
<el-input
placeholder=
"例如:https://...或http://..."
maxlength=
"100
"
></el-input>
<el-form-item
label=
"跳转连接"
prop=
"
legalStatementUrl
"
>
<el-input
placeholder=
"例如:https://...或http://..."
v-model.trim=
"formData.legalStatementUrl
"
></el-input>
</el-form-item>
<bg-form-gap
title=
"隐私政策"
></bg-form-gap>
<el-form-item
label=
"跳转连接"
prop=
"
force
"
>
<el-input
placeholder=
"例如:https://...或http://..."
maxlength=
"100
"
></el-input>
<el-form-item
label=
"跳转连接"
prop=
"
privacyPolicyUrl
"
>
<el-input
placeholder=
"例如:https://...或http://..."
v-model.trim=
"formData.privacyPolicyUrl
"
></el-input>
</el-form-item>
</el-form>
</div>
...
...
@@ -70,13 +75,79 @@ import axios from "../../../../request/http.js";
import
{
ElMessage
}
from
"
element-plus
"
;
import
{
useRouter
}
from
"
vue-router
"
;
import
bgBreadcrumb
from
"
@/components/bg-breadcrumb.vue
"
;
import
{
validateLink
}
from
"
@/services/rules.js
"
;
//表单数据
const
formData
=
reactive
({
logo
:
""
,
const
refForm
=
ref
(
null
);
const
state
=
reactive
({
formData
:
{
logoUrl
:
[],
backgroundUrl
:
[],
patent
:
""
,
icpFiling
:
""
,
icpUrl
:
""
,
publicSecurityFiling
:
""
,
publicSecurityUrl
:
""
,
legalStatementUrl
:
""
,
privacyPolicyUrl
:
""
,
},
//表单数据
rules
:
{
logoUrl
:
[{
required
:
true
,
message
:
"
请上传Logo
"
,
trigger
:
"
change
"
}],
backgroundUrl
:
[{
required
:
true
,
message
:
"
请上传背景图
"
,
trigger
:
"
change
"
}],
icpUrl
:
[{
validator
:
validateLink
,
trigger
:
"
blur
"
}],
publicSecurityUrl
:
[{
validator
:
validateLink
,
trigger
:
"
blur
"
}],
legalStatementUrl
:
[{
validator
:
validateLink
,
trigger
:
"
blur
"
}],
privacyPolicyUrl
:
[{
validator
:
validateLink
,
trigger
:
"
blur
"
}],
},
//表单校验规则
});
//表单校验规则
const
rules
=
reactive
({});
const
changeLogo
=
(
value
)
=>
{
if
(
value
&&
value
.
length
>
0
)
{
refForm
.
value
.
clearValidate
(
"
logoUrl
"
);
}
};
const
changeBanner
=
(
value
)
=>
{
if
(
value
&&
value
.
length
>
0
)
{
refForm
.
value
.
clearValidate
(
"
backgroundUrl
"
);
}
};
const
save
=
()
=>
{
refForm
.
value
.
validate
((
valid
)
=>
{
if
(
valid
)
{
let
params
=
{
...
state
.
formData
}
params
.
logoUrl
=
JSON
.
stringify
(
params
.
logoUrl
)
params
.
backgroundUrl
=
JSON
.
stringify
(
params
.
backgroundUrl
)
axios
.
put
(
`/apaas/system/v5/login/updateLogin`
,
params
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
ElMessage
.
success
(
res
.
data
.
msg
)
getLoginPageConfig
()
}
else
{
ElMessage
.
error
(
res
.
data
.
data
)
}
})
}
else
{
ElMessage
.
error
(
"
请先将表单填写完整
"
);
}
});
};
const
getLoginPageConfig
=
()
=>
{
axios
.
get
(
`/apaas/system/v5/login/loginDetail`
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
let
data
=
res
.
data
.
data
data
.
logoUrl
=
data
.
logoUrl
?
JSON
.
parse
(
data
.
logoUrl
)
:
[]
data
.
backgroundUrl
=
data
.
backgroundUrl
?
JSON
.
parse
(
data
.
backgroundUrl
)
:
[]
Object
.
assign
(
state
.
formData
,
data
)
}
else
{
ElMessage
.
error
(
res
.
data
.
data
)
}
})
}
onBeforeMount
(()
=>
{
getLoginPageConfig
()
})
const
{
formData
,
rules
}
=
toRefs
(
state
);
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/page/password/account-form.vue
View file @
7846e648
...
...
@@ -7,25 +7,20 @@
ref=
"accountRef"
style=
"max-width: 90%"
>
<el-form-item
label=
"手机号"
prop=
"phone"
>
<el-input
v-model=
"accountForm.phone"
@
input=
"phoneChange"
/>
<el-input
v-model=
"accountForm.phone"
@
input=
"phoneChange"
/>
</el-form-item>
<el-form-item
label=
"账号"
prop=
"account"
>
<el-form-item
label=
"账号"
prop=
"account"
>
<el-input
v-model=
"accountForm.account"
disabled
/>
</el-form-item>
<el-form-item
label=
"验证码"
prop=
"code"
>
<div
class=
"msg-code"
>
<el-input
v-model=
"accountForm.code"
placeholder=
"请输入"
style=
"860px"
>
</el-input>
<el-input
v-model=
"accountForm.code"
placeholder=
"请输入"
style=
"860px"
>
</el-input>
<div
class=
"yzm_img"
>
<el-button
type=
"primary"
@
click.prevent=
"getMsgCode()"
style=
"width: 100%;height: 34px;
"
>
{{
countDown
>
0
?
countDown
+
'
秒后再次获取
'
:
'
发送验证码
'
}}
</el-button>
<el-button
type=
"primary"
:disabled=
"countDown > 0"
@
click.prevent=
"getMsgCode()"
style=
"width: 100%; height: 34px
"
>
{{
countDown
>
0
?
countDown
+
"
秒后再次获取
"
:
"
发送验证码
"
}}
</el-button>
</div>
</div>
</div>
</el-form-item>
</el-form>
</
template
>
...
...
@@ -34,32 +29,25 @@
import
{
reactive
,
ref
,
onBeforeMount
,
onMounted
,
computed
}
from
"
vue
"
;
import
axios
from
"
@/request/http.js
"
;
import
{
ElMessage
}
from
"
element-plus
"
;
import
{
validatePhone
}
from
"
@/services/rules.js
"
const
props
=
defineProps
({
});
import
{
validatePhone
}
from
"
@/services/rules.js
"
;
const
props
=
defineProps
({});
const
accountForm
=
reactive
({
phone
:
""
,
account
:
""
,
code
:
""
code
:
""
,
});
const
formRules
=
reactive
({
phone
:
[
{
required
:
true
,
message
:
"
请输入手机号
"
,
trigger
:
"
blur
"
},
{
validator
:
validatePhone
,
trigger
:
"
blur
"
},
],
account
:
[
{
required
:
true
,
message
:
"
请输入账号
"
,
trigger
:
"
blur
"
},
],
code
:
[
{
required
:
true
,
message
:
"
请输入验证码
"
,
trigger
:
"
blur
"
},
],
account
:
[{
required
:
true
,
message
:
"
请输入账号
"
,
trigger
:
"
blur
"
}],
code
:
[{
required
:
true
,
message
:
"
请输入验证码
"
,
trigger
:
"
blur
"
}],
});
const
countDown
=
ref
(
0
)
const
countDownTimer
=
ref
(
null
)
const
countDown
=
ref
(
0
)
;
const
countDownTimer
=
ref
(
null
)
;
const
accountRef
=
ref
(
null
);
const
emit
=
defineEmits
([
"
action
"
]);
...
...
@@ -84,54 +72,51 @@ const setForm = (data) => {
};
const
getMsgCode
=
()
=>
{
if
(
accountForm
.
account
)
{
axios
.
post
(
'
/apaas/system/v5/sms/verifyCode
'
,{
phone
:
accountForm
.
phone
}).
then
(({
data
})
=>
{
if
(
data
.
code
==
200
)
{
countDownAction
();
}
else
{
ElMessage
.
error
(
data
.
data
);
}
});
}
else
{
ElMessage
.
error
(
"
该手机号未注册,请核对手机号!
"
);
if
(
accountForm
.
account
)
{
axios
.
post
(
"
/apaas/system/v5/sms/verifyCode
"
,
{
phone
:
accountForm
.
phone
}).
then
(({
data
})
=>
{
if
(
data
.
code
==
200
)
{
countDownAction
();
}
else
{
ElMessage
.
error
(
data
.
data
);
}
};
// 获取验证码
});
}
else
{
ElMessage
.
error
(
"
该手机号未注册,请核对手机号!
"
);
}
};
// 获取验证码
const
countDownAction
=
()
=>
{
countDown
.
value
=
60
;
if
(
countDownTimer
.
value
)
{
clearInterval
(
countDownTimer
.
value
);
}
countDownTimer
.
value
=
setInterval
(()
=>
{
if
(
countDown
.
value
>
0
)
{
countDown
.
value
--
;
}
else
{
clearInterval
(
countDownTimer
.
value
);
}
},
1000
);
}
countDown
.
value
=
60
;
if
(
countDownTimer
.
value
)
{
clearInterval
(
countDownTimer
.
value
);
}
countDownTimer
.
value
=
setInterval
(()
=>
{
if
(
countDown
.
value
>
0
)
{
countDown
.
value
--
;
}
else
{
clearInterval
(
countDownTimer
.
value
);
}
},
1000
);
};
const
phoneChange
=
()
=>
{
if
(
accountForm
.
phone
.
length
>
10
)
{
accountRef
.
value
.
validateField
(
'
phone
'
).
then
(
valid
=>
{
if
(
valid
)
{
if
(
accountForm
.
phone
.
length
>
10
)
{
accountRef
.
value
.
validateField
(
"
phone
"
).
then
((
valid
)
=>
{
if
(
valid
)
{
axios
.
get
(
`/apaas/system/v5/user/phoneToAccount?phone=
${
accountForm
.
phone
}
`
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
accountForm
.
account
=
res
.
data
.
data
||
''
accountForm
.
account
=
res
.
data
.
data
||
""
;
}
else
{
ElMessage
.
error
(
res
.
data
.
data
);
}
});
}
})
})
;
}
}
onBeforeMount
(()
=>
{
};
});
onBeforeMount
(()
=>
{
});
onMounted
(()
=>
{});
...
...
src/page/password/index.vue
View file @
7846e648
...
...
@@ -3,7 +3,7 @@
<div
class=
"bg-breadcrumb"
>
<el-breadcrumb
separator=
"/"
>
<el-breadcrumb-item
:to=
"
{ path: '/login' }"> 登录
</el-breadcrumb-item>
<el-breadcrumb-item
>
忘记密码
</el-breadcrumb-item>
<el-breadcrumb-item>
忘记密码
</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div
class=
"page_content flex_cloumn"
>
...
...
@@ -52,13 +52,8 @@
v-show=
"step === 1"
ref=
"accountFromRef"
:form-type=
"route.query.id ? true : false"
:id=
"route.query.id"
@
action=
"getAccountFromData"
></accountFrom>
<passwordForm
v-show=
"step === 2"
ref=
"passwordFormRef"
:id=
"route.query.id"
@
action=
"getPasswordFormData"
></passwordForm>
<passwordForm
v-show=
"step === 2"
ref=
"passwordFormRef"
@
action=
"getPasswordFormData"
></passwordForm>
<div
class=
"process_end"
v-show=
"step === 3"
>
<div>
<div>
...
...
@@ -66,11 +61,7 @@
<img
v-else
src=
"@/assets/imgs/img_data-fail.png"
alt=
""
/>
</div>
<div
class=
"font_bold"
>
{{
successFlag
? "密码修改成功"
: "密码修改失败"
}}
{{ successFlag ? "密码修改成功" : "密码修改失败" }}
</div>
<el-button
type=
"primary"
@
click=
"cancel"
>
返回登录页
</el-button>
<el-button
type=
"primary"
@
click=
"continueEdit"
>
重新修改
</el-button>
...
...
@@ -101,7 +92,7 @@ import { reactive, ref, onBeforeMount, toRefs, computed, onBeforeUnmount, onMoun
import
CryptoJS
from
"
crypto-js
"
;
import
axios
from
"
@/request/http.js
"
;
import
{
ElMessage
}
from
"
element-plus
"
;
import
{
Encrypt
}
from
"
@/services/secret.js
"
import
{
Encrypt
}
from
"
@/services/secret.js
"
;
const
route
=
useRoute
();
const
router
=
useRouter
();
const
step
=
ref
(
1
);
...
...
@@ -113,7 +104,7 @@ const formData = reactive({
code
:
""
,
new_password
:
""
,
});
});
const
successFlag
=
ref
(
false
);
// 下一步
...
...
@@ -126,7 +117,6 @@ const getAccountFromData = (data) => {
Object
.
assign
(
formData
,
data
);
step
.
value
=
2
;
//校验手机号验证码 未出接口
}
else
{
}
};
...
...
@@ -134,19 +124,18 @@ const getAccountFromData = (data) => {
const
getPasswordFormData
=
(
data
)
=>
{
if
(
data
)
{
Object
.
assign
(
formData
,
data
);
let
params
=
{
phone
:
formData
.
phone
,
password
:
Encrypt
(
formData
.
new_password
)
};
axios
.
post
(
`/apaas/system/v5/user/update/pwd`
,
params
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
successFlag
.
value
=
true
;
}
else
{
ElMessage
.
error
(
res
.
data
.
data
);
}
step
.
value
=
3
;
});
let
params
=
{
phone
:
formData
.
phone
,
password
:
Encrypt
(
formData
.
new_password
),
};
axios
.
post
(
`/apaas/system/v5/user/update/pwd`
,
params
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
successFlag
.
value
=
true
;
}
else
{
ElMessage
.
error
(
res
.
data
.
data
);
}
step
.
value
=
3
;
});
}
};
//上一步
...
...
@@ -169,18 +158,15 @@ const cancel = () => {
router
.
go
(
-
1
);
};
onBeforeUnmount
(()
=>
{});
onMounted
(()
=>
{
});
onMounted
(()
=>
{});
</
script
>
<
style
scoped
>
.password_container
{
margin
:
0
auto
;
width
:
1200px
;
height
:
70%
;
margin
:
0
auto
;
width
:
1200px
;
height
:
70%
;
}
.flex_cloumn
{
display
:
flex
;
...
...
src/page/password/password-form.vue
View file @
7846e648
...
...
@@ -21,8 +21,7 @@ const passwordForm = reactive({
new_password
:
""
,
confirm_password
:
""
,
});
const
props
=
defineProps
({
});
const
props
=
defineProps
({});
const
validatePass
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
!==
passwordForm
.
new_password
)
{
...
...
@@ -34,8 +33,8 @@ const validatePass = (rule, value, callback) => {
const
passwordFormRules
=
reactive
({
new_password
:
[
{
required
:
true
,
message
:
"
请输入新密码
"
,
trigger
:
"
blur
"
},
{
min
:
8
,
message
:
"
密码长度不得低于8位
"
,
trigger
:
"
blur
"
},
{
required
:
true
,
message
:
"
请输入新密码
"
,
trigger
:
"
blur
"
},
{
min
:
8
,
message
:
"
密码长度不得低于8位
"
,
trigger
:
"
blur
"
},
],
confirm_password
:
[
{
required
:
true
,
message
:
"
请确认密码
"
,
trigger
:
"
blur
"
},
...
...
src/page/registe/index.vue
View file @
7846e648
...
...
@@ -62,7 +62,7 @@
<div
class=
"msg-code"
>
<el-input
v-model=
"infoForm.code"
placeholder=
"请输入"
style=
"860px"
>
</el-input>
<div
class=
"yzm_img"
>
<el-button
type=
"primary"
style=
"width: 100%; height: 34px"
@
click=
"sendSms"
:disabled=
"countDown"
>
<el-button
type=
"primary"
style=
"width: 100%; height: 34px"
@
click=
"sendSms"
:disabled=
"countDown
> 0
"
>
{{ countDown > 0 ? countDown + "秒后再次获取" : "发送验证码" }}
</el-button>
</div>
...
...
src/services/helper.js
View file @
7846e648
...
...
@@ -255,6 +255,9 @@ var getFirstChild = function(menuObj,path){
}
}
}
var
getImageUrl
=
function
(
name
)
{
return
new
URL
(
`../assets/imgs/
${
name
}
`
,
import
.
meta
.
url
).
href
;
};
var
pathToUrl
=
(
path
)
=>
{
if
(
path
.
includes
(
'
http
'
)){
...
...
@@ -279,4 +282,5 @@ export {
timeForMatAdd
,
useConsole
,
getFirstChild
,
getImageUrl
,
}
src/services/rules.js
View file @
7846e648
...
...
@@ -55,3 +55,15 @@ export function validateIdNumber(rule, value, callback) {
}
},
100
);
}
// 验证身份证号码
export
function
validateLink
(
rule
,
value
,
callback
)
{
const
reg
=
/^
(
http
(
s
)?
:
\/\/)\w
+
[^\s]
+
(\.[^\s]
+
){1,}
$/
setTimeout
(()
=>
{
if
(
reg
.
test
(
value
)
||
value
==
""
)
{
callback
()
}
else
{
callback
(
new
Error
(
"
地址格式不正确,请重新输入
"
))
}
})
}
src/store/index.js
View file @
7846e648
...
...
@@ -12,7 +12,8 @@ const store = createStore({
menuObj
:{},
treeFlag
:
false
,
registerValid
:
false
,
msgUnreadNum
:
0
msgUnreadNum
:
0
,
systemLogo
:
""
,
},
getters
:
{
count
(
state
)
{
...
...
@@ -50,6 +51,9 @@ const store = createStore({
setUnreadNum
(
state
,
num
)
{
state
.
msgUnreadNum
=
num
},
setSystemLogo
(
state
,
logo
)
{
state
.
systemLogo
=
logo
}
},
actions
:
{}
});
...
...
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