diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINYUN/Abp/Sms/Aliyun/AliyunSmsSender.cs b/aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINYUN/Abp/Sms/Aliyun/AliyunSmsSender.cs index 0a3ef9982..5ee48c601 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINYUN/Abp/Sms/Aliyun/AliyunSmsSender.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINYUN/Abp/Sms/Aliyun/AliyunSmsSender.cs @@ -49,9 +49,7 @@ namespace LINYUN.Abp.Sms.Aliyun TryAddTemplateCode(request, smsMessage); TryAddSignName(request, smsMessage); TryAddSendPhone(request, smsMessage); - - var queryParamJson = JsonSerializer.Serialize(smsMessage.Properties); - request.AddQueryParameters("TemplateParam", queryParamJson); + TryAddTemplateParam(request, smsMessage); try { @@ -125,5 +123,14 @@ namespace LINYUN.Abp.Sms.Aliyun request.AddQueryParameters("PhoneNumbers", smsMessage.PhoneNumber); } } + + private void TryAddTemplateParam(CommonRequest request, SmsMessage smsMessage) + { + if (smsMessage.Properties.Count > 0) + { + var queryParamJson = JsonSerializer.Serialize(smsMessage.Properties); + request.AddQueryParameters("TemplateParam", queryParamJson); + } + } } } diff --git a/aspnet-core/modules/permissions/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/PermissionAppService.cs b/aspnet-core/modules/permissions/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/PermissionAppService.cs index c100c9030..a19a33bad 100644 --- a/aspnet-core/modules/permissions/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/PermissionAppService.cs +++ b/aspnet-core/modules/permissions/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/PermissionAppService.cs @@ -9,6 +9,7 @@ using Volo.Abp; using Volo.Abp.Application.Services; using Volo.Abp.Authorization.Permissions; using Volo.Abp.Caching; +using Volo.Abp.Clients; using Volo.Abp.DependencyInjection; using Volo.Abp.MultiTenancy; using Volo.Abp.PermissionManagement; @@ -22,10 +23,12 @@ namespace LINGYUN.Abp.PermissionManagement public class PermissionAppService : ApplicationService, IPermissionAppService { protected PermissionManagementOptions Options { get; } + protected ICurrentClient CurrentClient { get; } protected IDistributedCache Cache { get; } protected IPermissionGrantRepository PermissionGrantRepository { get; } protected IPermissionDefinitionManager PermissionDefinitionManager { get; } public PermissionAppService( + ICurrentClient currentClient, IDistributedCache cache, IPermissionGrantRepository permissionGrantRepository, IPermissionDefinitionManager permissionDefinitionManager, @@ -33,6 +36,7 @@ namespace LINGYUN.Abp.PermissionManagement { Cache = cache; Options = options.Value; + CurrentClient = currentClient; PermissionGrantRepository = permissionGrantRepository; PermissionDefinitionManager = permissionDefinitionManager; } @@ -62,6 +66,12 @@ namespace LINGYUN.Abp.PermissionManagement } } } + if (!CurrentClient.Id.IsNullOrWhiteSpace()) + { + var clientPermissions = await PermissionGrantRepository + .GetListAsync(ClientPermissionValueProvider.ProviderName, CurrentClient.Id); + permissions = permissions.Union(clientPermissions); + } foreach (var permissionGroup in permissionGroups) { var groupDto = new PermissionGroupDto diff --git a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj index 1cda942b4..ca1f77f73 100644 --- a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj +++ b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj @@ -22,7 +22,7 @@ - + diff --git a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/PlatformHttpApiHostModule.cs b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/PlatformHttpApiHostModule.cs index 0cd0722c6..a669d0cb0 100644 --- a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/PlatformHttpApiHostModule.cs +++ b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/PlatformHttpApiHostModule.cs @@ -23,6 +23,7 @@ using Volo.Abp; using Volo.Abp.Account; using Volo.Abp.AspNetCore.Authentication.JwtBearer; using Volo.Abp.AspNetCore.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; using Volo.Abp.Autofac; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.MySQL; @@ -44,7 +45,7 @@ using AbpPermissionManagementApplicationModule = LINGYUN.Abp.PermissionManagemen namespace LINGYUN.Platform { [DependsOn( - typeof(AbpAspNetCoreMultiTenancyModule), + typeof(AbpAspNetCoreMvcUiMultiTenancyModule), typeof(AbpPermissionManagementDomainIdentityModule), typeof(AbpPermissionManagementDomainIdentityServerModule), typeof(ApiGatewayApplicationContractsModule), diff --git a/aspnet-core/services/start-all-service.bat b/aspnet-core/services/start-all-service.bat index c891b0b8c..c7641f6ff 100644 --- a/aspnet-core/services/start-all-service.bat +++ b/aspnet-core/services/start-all-service.bat @@ -3,4 +3,6 @@ cls start .\start-identity-server.bat --run start .\start-apigateway-admin.bat --run -start .\start-platform.bat --run \ No newline at end of file +start .\start-platform.bat --run +ping -n 10 127.1 >nul +start .\start-apigateway-host.bat --run \ No newline at end of file diff --git a/vueJs/src/api/abpconfiguration.ts b/vueJs/src/api/abpconfiguration.ts new file mode 100644 index 000000000..697026231 --- /dev/null +++ b/vueJs/src/api/abpconfiguration.ts @@ -0,0 +1,99 @@ +import ApiService from './serviceBase' + +const serviceUrl = process.env.VUE_APP_BASE_API + +export default class AbpConfigurationService { + public static getAbpConfiguration() { + const _url = '/api/abp/application-configuration' + return ApiService.Get(_url, serviceUrl) + } +} + +export class Auth { + policies?: { [key: string]: boolean} + grantedPolicies?: { [key: string]: boolean} +} + +export class CurrentTenant { + id?: string + name?: string + isAvailable!: boolean +} + +export class CurrentUser { + id?: string + email?: string + userName?: string + tenantId?: string + isAuthenticated!: boolean +} + +export class Feature { + values?: { [key: string]: string} +} + +export class DateTimeFormat { + calendarAlgorithmType!: string + dateSeparator!: string + dateTimeFormatLong!: string + fullDateTimePattern!: string + longTimePattern!: string + shortDatePattern!: string + shortTimePattern!: string +} + +export class CurrentCulture { + cultureName!: string + displayName!: string + englishName!: string + isRightToLeft!: boolean + name!: string + nativeName!: string + threeLetterIsoLanguageName!: string + twoLetterIsoLanguageName!: string + dateTimeFormat!: DateTimeFormat +} + +export class Language { + cultureName!: string + displayName!: string + flagIcon?: string + uiCultureName!: string +} + +export class Localization { + currentCulture!: CurrentCulture + defaultResourceName?: string + languages!: Language[] + values!: {[key:string]: {[key:string]: string}} +} + +export class MultiTenancy { + isEnabled!: boolean +} + +export class Setting { + values?: {[key:string]: string} +} + +export interface IAbpConfiguration { + auth: Auth + currentTenant: CurrentTenant + currentUser: CurrentUser + features: Feature + localization: Localization + multiTenancy: MultiTenancy + objectExtensions: any + setting: Setting +} + +export class AbpConfiguration implements IAbpConfiguration { + auth!: Auth + currentTenant!: CurrentTenant + currentUser!: CurrentUser + features!: Feature + localization!: Localization + multiTenancy!: MultiTenancy + objectExtensions!: any + setting!: Setting +} \ No newline at end of file diff --git a/vueJs/src/api/users.ts b/vueJs/src/api/users.ts index 9444d7fe6..d57b913d3 100644 --- a/vueJs/src/api/users.ts +++ b/vueJs/src/api/users.ts @@ -118,8 +118,53 @@ export default class UserApiService { }) } - public static refreshToken() { - + public static sendPhoneVerifyCode(phoneVerify: PhoneVerify) { + const _url = '/api/account/phone/verify' + return ApiService.HttpRequest({ + baseURL: IdentityServiceUrl, + url: _url, + method: 'POST', + data: phoneVerify + }) + } + + public static userLoginWithPhone(loginData: UserLoginPhoneData) { + const _url = '/connect/token' + const login = { + grant_type: 'phone_verify', + phone_number: loginData.phoneNumber, + phone_verify_code: loginData.verifyCode, + client_id: process.env.VUE_APP_CLIENT_ID, + client_secret: process.env.VUE_APP_CLIENT_SECRET + } + return ApiService.HttpRequest({ + baseURL: IdentityServerUrl, + url: _url, + method: 'POST', + data: qs.stringify(login), + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + }) + } + + public static refreshToken(token: string) { + const _url = '/connect/token' + const refresh = { + grant_type: 'refresh_token', + refresh_token: token, + client_id: process.env.VUE_APP_CLIENT_ID, + client_secret: process.env.VUE_APP_CLIENT_SECRET + } + return ApiService.HttpRequest({ + baseURL: IdentityServerUrl, + url: _url, + method: 'POST', + data: qs.stringify(refresh), + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + }) } public static userLogout(token: string | undefined) { @@ -174,6 +219,24 @@ export class UserLoginData { password!: string } +export enum VerifyType { + register = 0, + signin = 10 +} + +export class PhoneVerify { + phoneNumber!: string + verifyType!:VerifyType +} + +/** 用户手机登录对象 */ +export class UserLoginPhoneData { + /** 手机号码 */ + phoneNumber!: string + /** 手机验证码 */ + verifyCode!: string +} + /** 用户信息对象 由IdentityServer提供 */ export class UserInfo { /** 标识 */ diff --git a/vueJs/src/assets/login-images/login.jpg b/vueJs/src/assets/login-images/login.jpg new file mode 100644 index 000000000..056914494 Binary files /dev/null and b/vueJs/src/assets/login-images/login.jpg differ diff --git a/vueJs/src/components/LangSelect/index.vue b/vueJs/src/components/LangSelect/index.vue index 1a1061594..c96add06d 100644 --- a/vueJs/src/components/LangSelect/index.vue +++ b/vueJs/src/components/LangSelect/index.vue @@ -23,30 +23,12 @@ > English - - Español - - - 日本語 - - - 한국어 - - + diff --git a/vueJs/src/views/profile/index.vue b/vueJs/src/views/profile/index.vue index 090e67fbc..3bdae36f5 100644 --- a/vueJs/src/views/profile/index.vue +++ b/vueJs/src/views/profile/index.vue @@ -51,14 +51,12 @@ import UserCard from './components/UserCard.vue' export interface IProfile { name: string email: string - avatar: string roles: string } const defaultProfile: IProfile = { name: 'Loading...', email: 'Loading...', - avatar: 'Loading...', roles: 'Loading...' } @@ -83,10 +81,6 @@ export default class extends Vue { return UserModule.email } - get avatar() { - return UserModule.avatar - } - get roles() { return UserModule.roles } @@ -99,7 +93,6 @@ export default class extends Vue { this.user = { name: this.name, email: this.email, - avatar: this.avatar, roles: this.roles.join(' | ') } }