Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
T
TrainSys
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
苏州培训方案
TrainSys
提交
8c7bf2b7
提交
8c7bf2b7
编写于
6月 30, 2025
作者:
Cano1997
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update: 登录页面添加验证码
上级
b4abc9db
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
66 行增加
和
4 行删除
+66
-4
app-login-extend.scss
...ponents/login-view/app-login-extend/app-login-extend.scss
+20
-3
app-login-extend.tsx
...mponents/login-view/app-login-extend/app-login-extend.tsx
+46
-1
未找到文件。
app_Web/src/components/login-view/app-login-extend/app-login-extend.scss
浏览文件 @
8c7bf2b7
...
@@ -5,6 +5,23 @@
...
@@ -5,6 +5,23 @@
width
:
100vw
;
width
:
100vw
;
height
:
100vh
;
height
:
100vh
;
background
:
linear-gradient
(
120deg
,
#a1c4fd
0%
,
#c2e9fb
100%
);
background
:
linear-gradient
(
120deg
,
#a1c4fd
0%
,
#c2e9fb
100%
);
@include
e
(
verification
)
{
.ivu-form-item-content
{
display
:
flex
;
}
.ivu-form-item-content
.ivu-btn.ivu-btn-default
{
margin-left
:
20px
;
margin-top
:
0
;
}
.ivu-input-type-number
{
height
:
40px
;
line-height
:
40px
;
.ivu-input
{
height
:
40px
;
}
}
}
}
}
@media
screen
and
(
max-width
:
720px
)
{
@media
screen
and
(
max-width
:
720px
)
{
...
@@ -121,15 +138,15 @@
...
@@ -121,15 +138,15 @@
.ivu-form
{
.ivu-form
{
position
:
relative
;
position
:
relative
;
&
>
.ivu-btn
{
&
>
.ivu-btn
{
position
:
absolute
;
position
:
absolute
;
right
:
0
;
right
:
0
;
bottom
:
44px
;
bottom
:
44px
;
color
:
getCssVar
(
color
,
primary
);
color
:
getCssVar
(
color
,
primary
);
box-shadow
:
none
;
box-shadow
:
none
;
}
}
&
>
.ivu-btn
:hover
{
&
>
.ivu-btn
:hover
{
background-color
:
transparent
background-color
:
transparent
;
}
}
}
}
}
}
app_Web/src/components/login-view/app-login-extend/app-login-extend.tsx
浏览文件 @
8c7bf2b7
...
@@ -14,6 +14,7 @@ import './app-login-extend.scss';
...
@@ -14,6 +14,7 @@ import './app-login-extend.scss';
interface
LoginData
{
interface
LoginData
{
username
:
string
;
username
:
string
;
password
:
string
;
password
:
string
;
verificationCode
:
string
;
}
}
const
rules
=
{
const
rules
=
{
...
@@ -46,6 +47,7 @@ export default defineComponent({
...
@@ -46,6 +47,7 @@ export default defineComponent({
const
loginData
=
reactive
<
LoginData
>
({
const
loginData
=
reactive
<
LoginData
>
({
username
:
''
,
username
:
''
,
password
:
''
,
password
:
''
,
verificationCode
:
''
,
});
});
const
formRef
=
ref
<
IData
|
null
>
(
null
);
const
formRef
=
ref
<
IData
|
null
>
(
null
);
...
@@ -78,7 +80,11 @@ export default defineComponent({
...
@@ -78,7 +80,11 @@ export default defineComponent({
if
((
ibiz
.
env
as
IData
).
enableSM3
)
{
if
((
ibiz
.
env
as
IData
).
enableSM3
)
{
password
=
ibiz
.
util
.
text
.
sm3
(
password
).
toUpperCase
();
password
=
ibiz
.
util
.
text
.
sm3
(
password
).
toUpperCase
();
}
}
const
res
=
await
ibiz
.
auth
.
v7login
(
loginData
.
username
,
password
);
const
res
=
await
ibiz
.
net
.
post
(
'/v7/loginPwd'
,
{
loginname
:
loginData
.
username
,
password
,
verificationcode
:
loginData
.
verificationCode
,
});
if
(
res
.
ok
)
{
if
(
res
.
ok
)
{
const
{
data
}
=
res
;
const
{
data
}
=
res
;
if
(
data
&&
data
.
token
)
{
if
(
data
&&
data
.
token
)
{
...
@@ -121,6 +127,28 @@ export default defineComponent({
...
@@ -121,6 +127,28 @@ export default defineComponent({
await
modal
.
onWillDismiss
();
await
modal
.
onWillDismiss
();
};
};
const
sendVerificationCode
=
()
=>
{
const
{
username
}
=
loginData
;
ibiz
.
net
.
post
(
`/v7/loginPwd/sendVerificationCode/
${
username
}
`
,
{})
.
then
((
res
:
IData
)
=>
{
if
(
res
.
ok
)
{
ibiz
.
notification
.
success
({
title
:
'获取验证码成功'
,
});
}
else
{
ibiz
.
notification
.
error
({
title
:
res
.
data
?.
message
||
'获取验证码失败'
,
});
}
})
.
catch
((
err
:
IData
)
=>
{
ibiz
.
notification
.
error
({
title
:
(
err
as
IData
).
response
?.
data
?.
message
||
'获取验证码失败'
,
});
});
};
return
()
=>
(
return
()
=>
(
<
div
class=
{
ns
.
b
()
}
>
<
div
class=
{
ns
.
b
()
}
>
<
div
class=
{
ns
.
b
(
'box'
)
}
>
<
div
class=
{
ns
.
b
(
'box'
)
}
>
...
@@ -165,6 +193,23 @@ export default defineComponent({
...
@@ -165,6 +193,23 @@ export default defineComponent({
<
i
-
icon
type=
'ios-unlock'
slot=
'prefix'
></
i
-
icon
>
<
i
-
icon
type=
'ios-unlock'
slot=
'prefix'
></
i
-
icon
>
</
i
-
input
>
</
i
-
input
>
</
i
-
form
-
item
>
</
i
-
form
-
item
>
<
i
-
form
-
item
prop=
'verificationCode'
class=
{
ns
.
e
(
'verification'
)
}
>
<
i
-
input
type=
'number'
value=
{
loginData
.
verificationCode
}
on
-
on
-
change=
{
(
evt
:
InputEvent
)
=>
{
const
{
value
}
=
evt
.
target
as
HTMLInputElement
;
loginData
.
verificationCode
=
value
;
}
}
placeholder=
'请输入验证码'
></
i
-
input
>
<
i
-
button
on
-
click=
{
sendVerificationCode
}
>
获取验证码
</
i
-
button
>
</
i
-
form
-
item
>
<
i
-
button
type=
'text'
on
-
click=
{
onForget
}
>
<
i
-
button
type=
'text'
on
-
click=
{
onForget
}
>
忘记密码
忘记密码
</
i
-
button
>
</
i
-
button
>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录