This commit is contained in:
@@ -9,7 +9,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||||||
namespace Dilon.Database.Migrations.Migrations
|
namespace Dilon.Database.Migrations.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(DefaultDbContext))]
|
[DbContext(typeof(DefaultDbContext))]
|
||||||
[Migration("20210423050618_Init")]
|
[Migration("20210423073632_Init")]
|
||||||
partial class Init
|
partial class Init
|
||||||
{
|
{
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
@@ -25,15 +25,7 @@ namespace Dilon.EntityFramework.Core
|
|||||||
|
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
{
|
{
|
||||||
optionsBuilder.UseMySql(
|
optionsBuilder.UseMySql(GetDatabaseConnectionString(), ServerVersion.FromString("5.5.53"));
|
||||||
GetDatabaseConnectionString(),
|
|
||||||
ServerVersion.FromString("5.5.53-mysql"),
|
|
||||||
p => p.EnableRetryOnFailure(
|
|
||||||
maxRetryCount: 5,
|
|
||||||
maxRetryDelay: TimeSpan.FromSeconds(30),
|
|
||||||
errorNumbersToAdd: new int[] { 2 }
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
base.OnConfiguring(optionsBuilder);
|
base.OnConfiguring(optionsBuilder);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace Dilon.EntityFramework.Core
|
|||||||
options.CustomizeMultiTenants(); // 自定义租户
|
options.CustomizeMultiTenants(); // 自定义租户
|
||||||
|
|
||||||
options.AddDb<DefaultDbContext>();
|
options.AddDb<DefaultDbContext>();
|
||||||
options.AddDb<MultiTenantDbContext, MultiTenantDbContextLocator>();
|
options.AddDb<MultiTenantDbContext>();
|
||||||
}, "Dilon.Database.Migrations");
|
}, "Dilon.Database.Migrations");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -117,16 +117,24 @@ for (let key in urls) {
|
|||||||
reslove([ArrayBuffer, Blob].indexOf(data.constructor) > -1 ? res : data)
|
reslove([ArrayBuffer, Blob].indexOf(data.constructor) > -1 ? res : data)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(({ response: { data } }) => {
|
.catch(({ response }) => {
|
||||||
if (process.env.VUE_APP_NODE_ENV === 'development') {
|
if (process.env.VUE_APP_NODE_ENV === 'development') {
|
||||||
errorNotification(data)
|
const { data, status } = response
|
||||||
|
if (data.constructor === String) {
|
||||||
|
errorNotification({
|
||||||
|
message: data,
|
||||||
|
code: status
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
errorNotification(data)
|
||||||
|
}
|
||||||
reject(data)
|
reject(data)
|
||||||
if (data.code === status.Unauthorized) {
|
if (data.code === status.Unauthorized) {
|
||||||
handlerUnauthorized()
|
handlerUnauthorized()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
errorNotification({
|
errorNotification({
|
||||||
message: '发生错误,请联系管理员'
|
message: '系统发生错误,请联系管理员'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user