diff --git a/Source/Starfish.Webapp/Pages/User/Edit.razor b/Source/Starfish.Webapp/Pages/User/Edit.razor
index d659621..ffcf715 100644
--- a/Source/Starfish.Webapp/Pages/User/Edit.razor
+++ b/Source/Starfish.Webapp/Pages/User/Edit.razor
@@ -102,7 +102,7 @@
{
if (!string.Equals(Password, Confirm))
{
- throw new Exception("Password not match.");
+ throw new ValidationException(Resources.IDS_ERROR_PASSWORD_NOT_MATCH);
}
var request = new UserCreateDto
diff --git a/Source/Starfish.Webapp/Pages/User/Login.razor b/Source/Starfish.Webapp/Pages/User/Login.razor
index 6b942ac..8805891 100644
--- a/Source/Starfish.Webapp/Pages/User/Login.razor
+++ b/Source/Starfish.Webapp/Pages/User/Login.razor
@@ -6,6 +6,7 @@
@inject NavigationManager Navigation
@inject AuthenticationStateProvider Authentication
+@inject IConfiguration Configuration
@inject IJSRuntime Script
@inject IToastService ToastService
@inject IIdentityApi Api
@@ -19,7 +20,7 @@
Starfish
- 配置管理和服务发现
+ @(Resources.IDS_COMMON_SUBTITLE)
@@ -28,10 +29,10 @@
-
+
-
+
@@ -40,15 +41,17 @@
-
- Register new user?
+ @if (Configuration.GetValue("FeatureManagement:UserRegistration"))
+ {
+ @(Resources.IDS_LOGIN_BUTTON_TEXT_REGISTER)
+ }
-
+
@code {
@@ -113,10 +116,10 @@
private async Task SubmitAsync(CancellationToken cancellationToken = default)
{
var dto = new AuthRequestDto
- {
- UserName = UserName,
- Password = Password
- };
+ {
+ UserName = UserName,
+ Password = Password
+ };
return await Api.GrantTokenAsync(dto, cancellationToken).EnsureSuccess(cancellationToken);
}
diff --git a/Source/Starfish.Webapp/Pages/User/Register.razor b/Source/Starfish.Webapp/Pages/User/Register.razor
index 50426e4..a1cea41 100644
--- a/Source/Starfish.Webapp/Pages/User/Register.razor
+++ b/Source/Starfish.Webapp/Pages/User/Register.razor
@@ -15,7 +15,7 @@
Starfish
- 配置管理和服务发现
+ @(Resources.IDS_COMMON_SUBTITLE)
diff --git a/Source/Starfish.Webapp/Pages/User/ResetPassword.razor b/Source/Starfish.Webapp/Pages/User/ResetPassword.razor
index fa71f12..be355c8 100644
--- a/Source/Starfish.Webapp/Pages/User/ResetPassword.razor
+++ b/Source/Starfish.Webapp/Pages/User/ResetPassword.razor
@@ -51,7 +51,7 @@
if (!string.Equals(Password, Confirm))
{
- throw new ValidationException("Password and confirm password are not the same.");
+ throw new ValidationException(Resources.IDS_ERROR_PASSWORD_NOT_MATCH);
}
var data = new ResetPasswordRequestDto()
diff --git a/Source/Starfish.Webapp/Properties/Resources.resx b/Source/Starfish.Webapp/Properties/Resources.resx
index 9e01898..ac3bad6 100644
--- a/Source/Starfish.Webapp/Properties/Resources.resx
+++ b/Source/Starfish.Webapp/Properties/Resources.resx
@@ -183,6 +183,9 @@
Submit
+
+ Configuration management & service discovery
+
Yes
@@ -342,6 +345,9 @@
Sync to Redis
+
+ The password you entered are not the same.
+
Configuration
@@ -366,9 +372,18 @@
Teams
+
+ Home
+
+
+ Forget password?
+
Login
+
+ Register new user
+
Login
diff --git a/Source/Starfish.Webapp/Properties/Resources.zh-Hans.resx b/Source/Starfish.Webapp/Properties/Resources.zh-Hans.resx
index 299150b..761112a 100644
--- a/Source/Starfish.Webapp/Properties/Resources.zh-Hans.resx
+++ b/Source/Starfish.Webapp/Properties/Resources.zh-Hans.resx
@@ -183,6 +183,9 @@
提交
+
+ 配置管理和服务发现
+
是
@@ -342,6 +345,9 @@
同步到Redis
+
+ 您输入的密码不一致。
+
配置
@@ -366,9 +372,18 @@
团队
+
+ 首页
+
+
+ 忘记密码?
+
登录
+
+ 注册新用户
+
登录
diff --git a/Source/Starfish.Webapp/Properties/Resources.zh-Hant.resx b/Source/Starfish.Webapp/Properties/Resources.zh-Hant.resx
index 734f742..5b87aa0 100644
--- a/Source/Starfish.Webapp/Properties/Resources.zh-Hant.resx
+++ b/Source/Starfish.Webapp/Properties/Resources.zh-Hant.resx
@@ -183,6 +183,9 @@
提交
+
+ 配置管理和服務發現
+
是
@@ -342,6 +345,9 @@
同步到Redis
+
+ 您輸入的密碼不一致。
+
配置
@@ -366,9 +372,18 @@
團隊
+
+ 首頁
+
+
+ 忘記密碼?
+
登入
+
+ 註冊新用戶
+
登入
diff --git a/Source/Starfish.Webapp/wwwroot/appsettings.json b/Source/Starfish.Webapp/wwwroot/appsettings.json
index a4e849a..fd9f7ab 100644
--- a/Source/Starfish.Webapp/wwwroot/appsettings.json
+++ b/Source/Starfish.Webapp/wwwroot/appsettings.json
@@ -8,5 +8,8 @@
"Api": {
"BaseUrl": "http://localhost:5229",
"Timeout": 10000
+ },
+ "FeatureManagement": {
+ "UserRegistration": false
}
}