Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
da2513e0
M
metersphere
项目概览
MeterSphere
/
metersphere
上一次同步 大约 3 年
通知
25
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
metersphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
da2513e0
编写于
2月 27, 2020
作者:
C
Captain.B
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
login i18n
上级
9c2b728d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
33 addition
and
12 deletion
+33
-12
frontend/src/i18n/en_US.js
frontend/src/i18n/en_US.js
+6
-0
frontend/src/i18n/zh_CN.js
frontend/src/i18n/zh_CN.js
+6
-0
frontend/src/login/Login.vue
frontend/src/login/Login.vue
+12
-11
frontend/src/login/login.js
frontend/src/login/login.js
+9
-1
未找到文件。
frontend/src/i18n/en_US.js
浏览文件 @
da2513e0
...
...
@@ -15,6 +15,12 @@ const en_US = {
'
prompt
'
:
'
Prompt
'
,
'
operating
'
:
'
Operating
'
,
'
input_limit
'
:
'
Within {0} and {1} characters
'
,
'
login
'
:
'
Sign In
'
,
'
welcome
'
:
'
Welcome back, please enter username and password to log in to MeterSphere
'
,
'
username
'
:
'
Username
'
,
'
password
'
:
'
Password
'
,
'
input_username
'
:
'
Please enter username
'
,
'
input_password
'
:
'
Please enter password
'
,
},
workspace
:
{
'
create
'
:
'
Create Workspace
'
,
...
...
frontend/src/i18n/zh_CN.js
浏览文件 @
da2513e0
...
...
@@ -15,6 +15,12 @@ const zh_CN = {
'
prompt
'
:
'
提示
'
,
'
operating
'
:
'
操作
'
,
'
input_limit
'
:
'
长度在 {0} 到 {1} 个字符
'
,
'
login
'
:
'
登录
'
,
'
welcome
'
:
'
欢迎回来,请输入用户名和密码登录MeterSphere
'
,
'
username
'
:
'
用户名
'
,
'
password
'
:
'
密码
'
,
'
input_username
'
:
'
请输入用户名
'
,
'
input_password
'
:
'
请输入密码
'
,
},
workspace
:
{
'
create
'
:
'
创建工作空间
'
,
...
...
frontend/src/login/Login.vue
浏览文件 @
da2513e0
...
...
@@ -7,25 +7,27 @@
<img
src=
"../assets/MeterSphere-彩色.png"
style=
"width: 224px"
alt=
""
>
</div>
<div
class=
"title"
>
<span
id=
"s1"
>
登录
</span>
<span
id=
"s1"
>
{{
$t
(
'
commons.login
'
)
}}
</span>
<span
id=
"s2"
>
MeterSphere
</span>
</div>
<div
class=
"border"
></div>
<div
class=
"welcome"
>
欢迎回来,请输入用户名和密码登录MeterSphere
{{
$t
(
'
commons.welcome
'
)
}}
</div>
<div
class=
"form"
>
<el-form-item
prop=
"username"
>
<el-input
v-model=
"form.username"
placeholder=
"邮箱"
autofocus
autocomplete=
"off"
maxlength=
"100"
<el-input
v-model=
"form.username"
:placeholder=
"$t('commons.username')"
autofocus
autocomplete=
"off"
maxlength=
"100"
show-word-limit
/>
</el-form-item>
<el-form-item
prop=
"password"
>
<el-input
v-model=
"form.password"
placeholder=
"密码
"
show-password
autocomplete=
"off"
<el-input
v-model=
"form.password"
:placeholder=
"$t('commons.password')
"
show-password
autocomplete=
"off"
maxlength=
"20"
show-word-limit
/>
</el-form-item>
</div>
<div
class=
"btn"
>
<el-button
type=
"primary"
class=
"submit"
@
click=
"submit('form')"
>
登录
<el-button
type=
"primary"
class=
"submit"
@
click=
"submit('form')"
>
{{
$t
(
'
commons.login
'
)
}}
</el-button>
</div>
<div
class=
"msg"
>
...
...
@@ -48,7 +50,7 @@
export
default
{
name
:
"
Login
"
,
data
()
{
let
validateEmail
=
(
rule
,
value
,
callback
)
=>
{
/*
let validateEmail = (rule, value, callback) => {
// eslint-disable-next-line no-useless-escape
let EMAIL_REGEX = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
if (!EMAIL_REGEX.test(value)) {
...
...
@@ -56,7 +58,7 @@
} else {
callback();
}
};
};
*/
return
{
form
:
{
username
:
''
,
...
...
@@ -64,12 +66,11 @@
},
rules
:
{
username
:
[
{
required
:
true
,
message
:
'
请输入邮箱
'
,
trigger
:
'
blur
'
},
{
validator
:
validateEmail
,
trigger
:
'
blur
'
}
{
required
:
true
,
message
:
this
.
$t
(
'
commons.input_username
'
),
trigger
:
'
blur
'
},
],
password
:
[
{
required
:
true
,
message
:
'
请输入密码
'
,
trigger
:
'
blur
'
},
{
min
:
6
,
max
:
20
,
message
:
'
长度在 6 到 20 个字符
'
,
trigger
:
'
blur
'
}
{
required
:
true
,
message
:
this
.
$t
(
'
commons.input_password
'
)
,
trigger
:
'
blur
'
},
{
min
:
6
,
max
:
20
,
message
:
this
.
$t
(
'
commons.input_limit
'
,
[
6
,
20
])
,
trigger
:
'
blur
'
}
]
},
msg
:
''
,
...
...
frontend/src/login/login.js
浏览文件 @
da2513e0
import
Vue
from
'
vue
'
;
import
{
Button
,
Col
,
Form
,
FormItem
,
Input
,
Row
}
from
'
element-ui
'
;
import
ElementUI
,
{
Button
,
Col
,
Form
,
FormItem
,
Input
,
Row
}
from
'
element-ui
'
;
import
'
element-ui/lib/theme-chalk/index.css
'
;
import
Login
from
"
./Login.vue
"
;
import
Ajax
from
"
../common/ajax
"
;
import
i18n
from
"
../i18n/i18n
"
;
Vue
.
config
.
productionTip
=
false
;
Vue
.
use
(
ElementUI
,
{
i18n
:
(
key
,
value
)
=>
i18n
.
t
(
key
,
value
)
});
Vue
.
use
(
Row
);
Vue
.
use
(
Col
);
Vue
.
use
(
Form
);
...
...
@@ -13,7 +19,9 @@ Vue.use(Input);
Vue
.
use
(
Button
);
Vue
.
use
(
Ajax
);
new
Vue
({
el
:
'
#login
'
,
i18n
,
render
:
h
=>
h
(
Login
)
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录