mirror of
https://github.com/fjykTec/ModernWMS.git
synced 2024-09-20 06:56:08 +08:00
Merge branch 'release'
This commit is contained in:
commit
62e17273fc
|
@ -50,28 +50,27 @@ namespace ModernWMS.Core.Extentions
|
|||
var cache = new MemoryCache(new MemoryCacheOptions());
|
||||
return cache;
|
||||
});
|
||||
var Mysql_connection = configuration.GetConnectionString("MySqlConn");
|
||||
var SqlLite_connection = configuration.GetConnectionString("SqlLiteConn");
|
||||
var SqlServer_connection = configuration.GetConnectionString("SqlServerConn");
|
||||
var Postgre_connection = configuration.GetConnectionString("PostGresConn");
|
||||
var database_config = configuration.GetSection("Database")["db"];
|
||||
services.AddDbContextPool<SqlDBContext>(t =>
|
||||
{
|
||||
if (database_config == "SqlLite")
|
||||
{
|
||||
var SqlLite_connection = configuration.GetConnectionString("SqlLiteConn");
|
||||
t.UseSqlite(SqlLite_connection, b => b.MigrationsAssembly("ModernWMS"));
|
||||
}
|
||||
else if (database_config == "MySql")
|
||||
{
|
||||
var Mysql_connection = configuration.GetConnectionString("MySqlConn");
|
||||
t.UseMySql(Mysql_connection, new MySqlServerVersion(new Version(8, 0, 26)));
|
||||
}
|
||||
else if(database_config == "SqlServer")
|
||||
else if (database_config == "SqlServer")
|
||||
{
|
||||
var SqlServer_connection = configuration.GetConnectionString("SqlServerConn");
|
||||
t.UseSqlServer(SqlServer_connection);
|
||||
}
|
||||
|
||||
else if(database_config == "PostGres")
|
||||
else if (database_config == "PostGres")
|
||||
{
|
||||
var Postgre_connection = configuration.GetConnectionString("PostGresConn");
|
||||
t.UseNpgsql(Postgre_connection);
|
||||
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
|
||||
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);
|
||||
|
@ -104,8 +103,8 @@ namespace ModernWMS.Core.Extentions
|
|||
options.DataAnnotationLocalizerProvider = (type, factory) =>
|
||||
factory.Create(typeof(ModernWMS.Core.MultiLanguage));
|
||||
}); ;
|
||||
|
||||
}
|
||||
|
||||
public static void UseExtensionsConfigure(this IApplicationBuilder app, IWebHostEnvironment env, IServiceProvider serviceProvider, IConfiguration configuration)
|
||||
{
|
||||
if (env.IsDevelopment())
|
||||
|
@ -130,7 +129,9 @@ namespace ModernWMS.Core.Extentions
|
|||
endpoints.MapControllers();
|
||||
});
|
||||
}
|
||||
|
||||
#region Swagger
|
||||
|
||||
/// <summary>
|
||||
/// Swagger
|
||||
/// </summary>
|
||||
|
@ -162,7 +163,6 @@ namespace ModernWMS.Core.Extentions
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
if (settings.XmlFiles != null && settings.XmlFiles.Count > 0)
|
||||
{
|
||||
settings.XmlFiles.ForEach(fileName =>
|
||||
|
@ -178,7 +178,6 @@ namespace ModernWMS.Core.Extentions
|
|||
c.OperationFilter<AppendAuthorizeToSummaryOperationFilter>();
|
||||
c.OperationFilter<SecurityRequirementsOperationFilter>();
|
||||
|
||||
|
||||
c.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme
|
||||
{
|
||||
Description = "please input Bearer {token}",
|
||||
|
@ -187,10 +186,10 @@ namespace ModernWMS.Core.Extentions
|
|||
Type = SecuritySchemeType.ApiKey
|
||||
});
|
||||
c.SwaggerGeneratorOptions.DescribeAllParametersInCamelCase = false;
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// register Swagger
|
||||
/// </summary>
|
||||
|
@ -198,7 +197,6 @@ namespace ModernWMS.Core.Extentions
|
|||
/// <param name="configuration">配置文件</param>
|
||||
private static void UseSwaggerConfigure(this IApplicationBuilder app, IConfiguration configuration)
|
||||
{
|
||||
|
||||
var swaggerSettings = configuration.GetSection("SwaggerSettings");
|
||||
|
||||
if (swaggerSettings != null && swaggerSettings["Name"].Equals("ModernWMS"))
|
||||
|
@ -214,14 +212,14 @@ namespace ModernWMS.Core.Extentions
|
|||
|
||||
c.IndexStream = () => Assembly.GetExecutingAssembly().GetManifestResourceStream("ModernWMS.Core.Swagger.index.html");
|
||||
c.RoutePrefix = "";
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion Swagger
|
||||
|
||||
#region JWT
|
||||
|
||||
/// <summary>
|
||||
/// register JWT
|
||||
/// </summary>
|
||||
|
@ -229,7 +227,6 @@ namespace ModernWMS.Core.Extentions
|
|||
/// <param name="configuration">configuration</param>
|
||||
private static void AddTokenGeneratorService(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
|
||||
if (services == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(services));
|
||||
|
@ -261,24 +258,23 @@ namespace ModernWMS.Core.Extentions
|
|||
};
|
||||
})
|
||||
.AddScheme<AuthenticationSchemeOptions, ApiResponseHandler>(nameof(ApiResponseHandler), o => { });
|
||||
|
||||
}
|
||||
|
||||
private static void UseTokenGeneratorConfigure(this IApplicationBuilder app, IConfiguration configuration)
|
||||
{
|
||||
app.UseAuthentication();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region dynamic injection
|
||||
#endregion JWT
|
||||
|
||||
#region dynamic injection
|
||||
|
||||
/// <summary>
|
||||
/// judge the dll to be injected by IDependency
|
||||
/// judge the dll to be injected by IDependency
|
||||
/// </summary>
|
||||
/// <param name="services">services</param>
|
||||
private static IServiceCollection RegisterAssembly(this IServiceCollection services)
|
||||
{
|
||||
|
||||
|
||||
var path = AppDomain.CurrentDomain.RelativeSearchPath ?? AppDomain.CurrentDomain.BaseDirectory;
|
||||
var referencedAssemblies = System.IO.Directory.GetFiles(path, "ModernWMS*.dll").Select(Assembly.LoadFrom).ToArray();
|
||||
|
||||
|
@ -298,8 +294,7 @@ namespace ModernWMS.Core.Extentions
|
|||
services.AddScoped<Services.IAccountService, Services.AccountService>();
|
||||
return services;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#endregion dynamic injection
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,8 +2,8 @@
|
|||
<div class="languageIcon">
|
||||
<v-menu>
|
||||
<template #activator="{ props }">
|
||||
<!-- <v-icon icon="mdi-translate" color="#666666" v-bind="props"></v-icon> -->
|
||||
<v-icon icon="mdi-web" color="#666666" v-bind="props"></v-icon>
|
||||
<v-icon icon="mdi-translate" color="#666666" v-bind="props"></v-icon>
|
||||
<!-- <v-icon icon="mdi-web" color="#666666" v-bind="props"></v-icon> -->
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item v-for="(item, index) in data.languageList" :key="index" :value="index" @click="method.changeLanguage(item.value)">
|
||||
|
|
|
@ -15,7 +15,7 @@ export default {
|
|||
operate: 'Operate',
|
||||
edit: 'Edit',
|
||||
delete: 'Delete',
|
||||
close: 'Colse',
|
||||
close: 'Close',
|
||||
submit: 'Submit',
|
||||
reset: 'Reset',
|
||||
confirm: 'Confirm',
|
||||
|
@ -142,7 +142,7 @@ export default {
|
|||
restPwd: 'Reset password',
|
||||
checkboxIsNull: 'Please select data!',
|
||||
beforeResetPwd: 'Are you sure you want to reset the passwords of these users?',
|
||||
afterResetPwd: 'Password reset succeeded, The new password is ',
|
||||
afterResetPwd: 'Password reset succeeded, the new password is ',
|
||||
user_register_name: 'User Name',
|
||||
email: 'Email',
|
||||
auth_string: 'Password'
|
||||
|
@ -156,7 +156,7 @@ export default {
|
|||
warehouse_name: 'Warehouse Name',
|
||||
city: 'City',
|
||||
address: 'Address',
|
||||
contact_tel: 'Acontact Tel',
|
||||
contact_tel: 'Contact Tel',
|
||||
manager: 'Manager',
|
||||
is_valid: 'Valid',
|
||||
area_name: 'Reservoir Name',
|
||||
|
|
|
@ -19,16 +19,22 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { reactive } from 'vue'
|
||||
import { reactive, onMounted } from 'vue'
|
||||
import LoginForm from '@/components/login/login-form.vue'
|
||||
import LanguagesSwitch from '@/components/system/languages.vue'
|
||||
import Logo from '@/components/system/logo.vue'
|
||||
import { emitter } from '@/utils/bus.js'
|
||||
|
||||
const method = reactive({
|
||||
toICP: () => {
|
||||
window.open('https://beian.miit.gov.cn/', '_blank')
|
||||
}
|
||||
})
|
||||
|
||||
// 回到登录界面清除状态
|
||||
onMounted(() => {
|
||||
emitter.emit('closeLoading')
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
|
@ -42,7 +48,6 @@ const method = reactive({
|
|||
height: 100%;
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
position: relative;
|
||||
.loginLeft {
|
||||
width: 70%;
|
||||
display: flex;
|
||||
|
|
Loading…
Reference in a new issue