feat:请求方法全部换成新的request类,并且引入useEcharts hook
This commit is contained in:
@@ -222,7 +222,7 @@ namespace Yi.Framework.SqlSugarCore
|
|||||||
{
|
{
|
||||||
if (Options.EnabledSqlLog)
|
if (Options.EnabledSqlLog)
|
||||||
{
|
{
|
||||||
Logger.CreateLogger<SqlSugarDbContext>().LogDebug(UtilMethods.GetSqlString(DbType.SqlServer, sql, pars));
|
Logger.CreateLogger<SqlSugarDbContext>().LogDebug("Yi-SQL执行:"+UtilMethods.GetSqlString(DbType.SqlServer, sql, pars));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,16 +3,24 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
using Volo.Abp.Auditing;
|
using Volo.Abp.Auditing;
|
||||||
using Volo.Abp.DependencyInjection;
|
using Volo.Abp.DependencyInjection;
|
||||||
|
using Yi.Framework.Core.Helper;
|
||||||
|
using Yi.Framework.SqlSugarCore.Abstractions;
|
||||||
|
|
||||||
namespace Yi.Framework.SqlSugarCore
|
namespace Yi.Framework.SqlSugarCore
|
||||||
{
|
{
|
||||||
public class SqlSugarLogAuditingStore : IAuditingStore, ISingletonDependency
|
public class SqlSugarLogAuditingStore : IAuditingStore, ISingletonDependency
|
||||||
{
|
{
|
||||||
|
private readonly ILogger<SqlSugarLogAuditingStore> _logger;
|
||||||
|
public SqlSugarLogAuditingStore(ILogger<SqlSugarLogAuditingStore> logger, ISqlSugarDbContext sqlSugarDbContext)
|
||||||
|
{
|
||||||
|
_logger= logger;
|
||||||
|
}
|
||||||
public Task SaveAsync(AuditLogInfo auditInfo)
|
public Task SaveAsync(AuditLogInfo auditInfo)
|
||||||
{
|
{
|
||||||
//Console.WriteLine(auditInfo.ExecutionTime);
|
_logger.LogDebug("Yi-请求追踪:"+JsonHelper.ObjToStr(auditInfo, "yyyy-MM-dd HH:mm:ss"));
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,11 +15,6 @@ namespace Yi.Framework.SqlSugarCore.Uow
|
|||||||
|
|
||||||
public async Task CommitAsync(CancellationToken cancellationToken = default)
|
public async Task CommitAsync(CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
await Console.Out.WriteLineAsync("事务提交");
|
|
||||||
|
|
||||||
Console.WriteLine(_sqlsugarDbContext.SqlSugarClient.ContextID + "---------------");
|
|
||||||
await _sqlsugarDbContext.SqlSugarClient.Ado.CommitTranAsync();
|
await _sqlsugarDbContext.SqlSugarClient.Ado.CommitTranAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,8 +25,6 @@ namespace Yi.Framework.SqlSugarCore.Uow
|
|||||||
|
|
||||||
public async Task RollbackAsync(CancellationToken cancellationToken = default)
|
public async Task RollbackAsync(CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
await Console.Out.WriteLineAsync("事务回滚");
|
|
||||||
Console.WriteLine(_sqlsugarDbContext.SqlSugarClient.ContextID);
|
|
||||||
await _sqlsugarDbContext.SqlSugarClient.Ado.RollbackTranAsync();
|
await _sqlsugarDbContext.SqlSugarClient.Ado.RollbackTranAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
{
|
{
|
||||||
public class AccessLogDto
|
public class AccessLogDto
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
|
||||||
public long Number { get; set; }
|
public long Number { get; set; }
|
||||||
public DateTime? LastModificationTime { get; set; }
|
public DateTime? LastModificationTime { get; set; }
|
||||||
public DateTime CreationTime { get; set; }
|
public DateTime CreationTime { get; set; }
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Discuss
|
|||||||
{
|
{
|
||||||
public class DiscussGetListInputVo : PagedAndSortedResultRequestDto
|
public class DiscussGetListInputVo : PagedAndSortedResultRequestDto
|
||||||
{
|
{
|
||||||
public string Title { get; set; }
|
public string? Title { get; set; }
|
||||||
|
|
||||||
public Guid? PlateId { get; set; }
|
public Guid? PlateId { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace Yi.Framework.Bbs.Application.Services
|
|||||||
/// 触发
|
/// 触发
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("")]
|
[HttpPost("access-log")]
|
||||||
public async Task AccessAsync()
|
public async Task AccessAsync()
|
||||||
{
|
{
|
||||||
//可判断http重复,防止同一ip多次访问
|
//可判断http重复,防止同一ip多次访问
|
||||||
|
|||||||
@@ -3,17 +3,17 @@ using Volo.Abp.BackgroundWorkers.Quartz;
|
|||||||
|
|
||||||
namespace Yi.Framework.Rbac.Application.Jobs
|
namespace Yi.Framework.Rbac.Application.Jobs
|
||||||
{
|
{
|
||||||
public class TestJob : QuartzBackgroundWorkerBase
|
//public class TestJob : QuartzBackgroundWorkerBase
|
||||||
{
|
//{
|
||||||
public TestJob()
|
// public TestJob()
|
||||||
{
|
// {
|
||||||
JobDetail = JobBuilder.Create<TestJob>().WithIdentity(nameof(TestJob)).Build();
|
// JobDetail = JobBuilder.Create<TestJob>().WithIdentity(nameof(TestJob)).Build();
|
||||||
Trigger = TriggerBuilder.Create().WithIdentity(nameof(TestJob)).WithCronSchedule("* * * * * ? *").Build();
|
// Trigger = TriggerBuilder.Create().WithIdentity(nameof(TestJob)).WithCronSchedule("* * * * * ? *").Build();
|
||||||
}
|
// }
|
||||||
public override Task Execute(IJobExecutionContext context)
|
// public override Task Execute(IJobExecutionContext context)
|
||||||
{
|
// {
|
||||||
Console.WriteLine("你好,世界");
|
// Console.WriteLine("你好,世界");
|
||||||
return Task.CompletedTask;
|
// return Task.CompletedTask;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ namespace Yi.Framework.Rbac.Application
|
|||||||
|
|
||||||
public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context)
|
public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context)
|
||||||
{
|
{
|
||||||
//await context.AddBackgroundWorkerAsync<TestJob>();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,11 +28,7 @@ namespace Yi.Abp.SqlSugarCore
|
|||||||
|
|
||||||
protected override void OnLogExecuting(string sql, SugarParameter[] pars)
|
protected override void OnLogExecuting(string sql, SugarParameter[] pars)
|
||||||
{
|
{
|
||||||
//获取原生SQL推荐 5.1.4.63 性能OK
|
base.OnLogExecuting(sql, pars);
|
||||||
//UtilMethods.GetNativeSql(sql,pars)
|
|
||||||
|
|
||||||
//获取无参数化SQL 影响性能只适合调试
|
|
||||||
this.Logger.CreateLogger<YiDbContext>().LogInformation(UtilMethods.GetSqlString(DbType.SqlServer, sql, pars));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnLogExecuted(string sql, SugarParameter[] pars)
|
protected override void OnLogExecuted(string sql, SugarParameter[] pars)
|
||||||
|
|||||||
1274
Yi.Abp.Net8/src/Yi.Abp.Web/Logs/log-20231212.txt
Normal file
1274
Yi.Abp.Net8/src/Yi.Abp.Web/Logs/log-20231212.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,36 @@
|
|||||||
|
using Serilog;
|
||||||
|
using Serilog.Events;
|
||||||
using Yi.Abp.Web;
|
using Yi.Abp.Web;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־,<2C><>ʹ<EFBFBD><CAB9>{SourceContext}<7D><>¼
|
||||||
builder.WebHost.UseUrls(builder.Configuration["App:SelfUrl"]);
|
Log.Logger = new LoggerConfiguration()
|
||||||
builder.Host.UseAutofac();
|
.MinimumLevel.Debug()
|
||||||
await builder.Services.AddApplicationAsync<YiAbpWebModule>();
|
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
|
||||||
var app = builder.Build();
|
.MinimumLevel.Override("Microsoft.AspNetCore.Hosting.Diagnostics",LogEventLevel.Error)
|
||||||
await app.InitializeApplicationAsync();
|
.MinimumLevel.Override("Quartz", LogEventLevel.Warning)
|
||||||
await app.RunAsync();
|
.Enrich.FromLogContext()
|
||||||
|
.WriteTo.Async(c => c.File("Logs/log-.txt", rollingInterval: RollingInterval.Day))
|
||||||
|
.WriteTo.Async(c => c.Console())
|
||||||
|
.CreateLogger();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Log.Information("Yi<59><69><EFBFBD><EFBFBD>-Abp.vNext<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
|
||||||
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
builder.WebHost.UseUrls(builder.Configuration["App:SelfUrl"]);
|
||||||
|
builder.Host.UseAutofac();
|
||||||
|
builder.Host.UseSerilog();
|
||||||
|
await builder.Services.AddApplicationAsync<YiAbpWebModule>();
|
||||||
|
var app = builder.Build();
|
||||||
|
await app.InitializeApplicationAsync();
|
||||||
|
await app.RunAsync();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.Fatal(ex, "Yi<59><69><EFBFBD><EFBFBD>-Abp.vNext<78><74><EFBFBD><EFBFBD>ը<EFBFBD><D5A8>");
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Log.CloseAndFlush();
|
||||||
|
}
|
||||||
@@ -10,6 +10,8 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.14" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.14" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.12" />
|
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.12" />
|
||||||
|
<PackageReference Include="Serilog.AspNetCore" Version="7.0.0" />
|
||||||
|
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
|
||||||
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="7.4.2" />
|
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="7.4.2" />
|
||||||
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="7.4.1" />
|
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="7.4.1" />
|
||||||
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="7.4.1" />
|
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="7.4.1" />
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ using Volo.Abp.AspNetCore.Mvc.AntiForgery;
|
|||||||
using Volo.Abp.AspNetCore.Serilog;
|
using Volo.Abp.AspNetCore.Serilog;
|
||||||
using Volo.Abp.Auditing;
|
using Volo.Abp.Auditing;
|
||||||
using Volo.Abp.Autofac;
|
using Volo.Abp.Autofac;
|
||||||
using Volo.Abp.Json;
|
|
||||||
using Volo.Abp.Modularity;
|
using Volo.Abp.Modularity;
|
||||||
using Volo.Abp.Swashbuckle;
|
using Volo.Abp.Swashbuckle;
|
||||||
using Yi.Abp.Application;
|
using Yi.Abp.Application;
|
||||||
@@ -25,7 +24,7 @@ using Yi.Framework.Rbac.Domain.Shared.Options;
|
|||||||
namespace Yi.Abp.Web
|
namespace Yi.Abp.Web
|
||||||
{
|
{
|
||||||
[DependsOn(
|
[DependsOn(
|
||||||
typeof(YiAbpSqlSugarCoreModule),
|
typeof(YiAbpSqlSugarCoreModule),
|
||||||
typeof(YiAbpApplicationModule),
|
typeof(YiAbpApplicationModule),
|
||||||
|
|
||||||
typeof(AbpAspNetCoreMvcModule),
|
typeof(AbpAspNetCoreMvcModule),
|
||||||
@@ -43,6 +42,7 @@ namespace Yi.Abp.Web
|
|||||||
public override Task ConfigureServicesAsync(ServiceConfigurationContext context)
|
public override Task ConfigureServicesAsync(ServiceConfigurationContext context)
|
||||||
{
|
{
|
||||||
var configuration = context.Services.GetConfiguration();
|
var configuration = context.Services.GetConfiguration();
|
||||||
|
var host = context.Services.GetHostingEnvironment();
|
||||||
var service = context.Services;
|
var service = context.Services;
|
||||||
|
|
||||||
//请求日志
|
//请求日志
|
||||||
@@ -65,10 +65,7 @@ namespace Yi.Abp.Web
|
|||||||
{
|
{
|
||||||
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
|
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
|
||||||
});
|
});
|
||||||
Configure<AbpJsonOptions>(options =>
|
|
||||||
{
|
|
||||||
options.OutputDateTimeFormat = "yyyy-MM-dd HH:mm:ss";
|
|
||||||
});
|
|
||||||
Configure<AbpAntiForgeryOptions>(options =>
|
Configure<AbpAntiForgeryOptions>(options =>
|
||||||
{
|
{
|
||||||
options.AutoValidate = false;
|
options.AutoValidate = false;
|
||||||
@@ -77,7 +74,7 @@ namespace Yi.Abp.Web
|
|||||||
//Swagger
|
//Swagger
|
||||||
context.Services.AddYiSwaggerGen<YiAbpWebModule>(options =>
|
context.Services.AddYiSwaggerGen<YiAbpWebModule>(options =>
|
||||||
{
|
{
|
||||||
options.SwaggerDoc("default", new OpenApiInfo { Title = "Yi.Framework.Abp", Version = "v1",Description="集大成者" });
|
options.SwaggerDoc("default", new OpenApiInfo { Title = "Yi.Framework.Abp", Version = "v1", Description = "集大成者" });
|
||||||
});
|
});
|
||||||
|
|
||||||
//跨域
|
//跨域
|
||||||
@@ -145,7 +142,6 @@ namespace Yi.Abp.Web
|
|||||||
var env = context.GetEnvironment();
|
var env = context.GetEnvironment();
|
||||||
var app = context.GetApplicationBuilder();
|
var app = context.GetApplicationBuilder();
|
||||||
|
|
||||||
|
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
|
||||||
//跨域
|
//跨域
|
||||||
|
|||||||
Binary file not shown.
8
Yi.BBS.Vue3/package-lock.json
generated
8
Yi.BBS.Vue3/package-lock.json
generated
@@ -14,6 +14,7 @@
|
|||||||
"element-plus": "^2.2.32",
|
"element-plus": "^2.2.32",
|
||||||
"highlight": "^0.2.4",
|
"highlight": "^0.2.4",
|
||||||
"i": "^0.3.7",
|
"i": "^0.3.7",
|
||||||
|
"lodash": "^4.17.21",
|
||||||
"marked": "^4.2.12",
|
"marked": "^4.2.12",
|
||||||
"mavon-editor": "^3.0.0",
|
"mavon-editor": "^3.0.0",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
@@ -2555,8 +2556,9 @@
|
|||||||
},
|
},
|
||||||
"node_modules/lodash": {
|
"node_modules/lodash": {
|
||||||
"version": "4.17.21",
|
"version": "4.17.21",
|
||||||
"resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz",
|
"resolved": "http://10.10.78.31:8081/repository/hmx-public/lodash/-/lodash-4.17.21.tgz",
|
||||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
||||||
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/lodash-es": {
|
"node_modules/lodash-es": {
|
||||||
"version": "4.17.21",
|
"version": "4.17.21",
|
||||||
@@ -5813,7 +5815,7 @@
|
|||||||
},
|
},
|
||||||
"lodash": {
|
"lodash": {
|
||||||
"version": "4.17.21",
|
"version": "4.17.21",
|
||||||
"resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz",
|
"resolved": "http://10.10.78.31:8081/repository/hmx-public/lodash/-/lodash-4.17.21.tgz",
|
||||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||||
},
|
},
|
||||||
"lodash-es": {
|
"lodash-es": {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
"element-plus": "^2.2.32",
|
"element-plus": "^2.2.32",
|
||||||
"highlight": "^0.2.4",
|
"highlight": "^0.2.4",
|
||||||
"i": "^0.3.7",
|
"i": "^0.3.7",
|
||||||
|
"lodash": "^4.17.21",
|
||||||
"marked": "^4.2.12",
|
"marked": "^4.2.12",
|
||||||
"mavon-editor": "^3.0.0",
|
"mavon-editor": "^3.0.0",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
import request from '@/utils/request'
|
import request from "@/config/axios/service";
|
||||||
|
|
||||||
// 触发访问
|
// 触发访问
|
||||||
export function access() {
|
export function access() {
|
||||||
return request({
|
return request({
|
||||||
url: '/access-log',
|
url: "/access-log",
|
||||||
method: 'post'
|
method: "post",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 获取本周数据
|
// 获取本周数据
|
||||||
export function getWeek() {
|
export function getWeek() {
|
||||||
return request({
|
return request({
|
||||||
url: '/access-log/week',
|
url: "/access-log/week",
|
||||||
method: 'get'
|
method: "get",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
@@ -1,79 +1,78 @@
|
|||||||
import request from '@/utils/request'
|
import request from "@/config/axios/service";
|
||||||
|
|
||||||
// 登录方法
|
// 登录方法
|
||||||
export function login(username, password, code, uuid) {
|
export function login(username, password, code, uuid) {
|
||||||
const data = {
|
const data = {
|
||||||
username,
|
username,
|
||||||
password,
|
password,
|
||||||
code,
|
code,
|
||||||
uuid
|
uuid,
|
||||||
}
|
};
|
||||||
return request({
|
return request({
|
||||||
url: '/account/login',
|
url: "/account/login",
|
||||||
headers: {
|
headers: {
|
||||||
isToken: false
|
isToken: false,
|
||||||
},
|
},
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 注册方法
|
// 注册方法
|
||||||
export function register(userName,password,phone,code,uuid) {
|
export function register(userName, password, phone, code, uuid) {
|
||||||
const data = {
|
const data = {
|
||||||
userName,
|
userName,
|
||||||
password,
|
password,
|
||||||
phone,
|
phone,
|
||||||
code,
|
code,
|
||||||
uuid
|
uuid,
|
||||||
}
|
};
|
||||||
return request({
|
return request({
|
||||||
url: '/account/register',
|
url: "/account/register",
|
||||||
headers: {
|
headers: {
|
||||||
isToken: false
|
isToken: false,
|
||||||
},
|
},
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取用户详细信息
|
|
||||||
export function getInfo() {
|
|
||||||
return request({
|
|
||||||
url: '/account',
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// 获取用户详细信息
|
||||||
|
export function getInfo() {
|
||||||
|
return request({
|
||||||
|
url: "/account",
|
||||||
|
method: "get",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 退出方法
|
// 退出方法
|
||||||
export function logout() {
|
export function logout() {
|
||||||
return request({
|
return request({
|
||||||
url: '/account/logout',
|
url: "/account/logout",
|
||||||
method: 'post'
|
method: "post",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取验证码
|
// 获取验证码
|
||||||
export function getCodeImg() {
|
export function getCodeImg() {
|
||||||
return request({
|
return request({
|
||||||
url: '/account/captcha-image',
|
url: "/account/captcha-image",
|
||||||
headers: {
|
headers: {
|
||||||
isToken: false
|
isToken: false,
|
||||||
},
|
},
|
||||||
method: 'get',
|
method: "get",
|
||||||
timeout: 20000
|
timeout: 20000,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 获取短信验证码
|
// 获取短信验证码
|
||||||
export function getCodePhone(phone) {
|
export function getCodePhone(phone) {
|
||||||
return request({
|
return request({
|
||||||
url: '/account/captcha-phone',
|
url: "/account/captcha-phone",
|
||||||
headers: {
|
headers: {
|
||||||
isToken: false
|
isToken: false,
|
||||||
},
|
},
|
||||||
method: 'post',
|
method: "post",
|
||||||
timeout: 20000,
|
timeout: 20000,
|
||||||
data:{phone}
|
data: { phone },
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import myaxios from '@/utils/request'
|
import request from "@/config/axios/service";
|
||||||
export function operate(discussId){
|
export function operate(discussId) {
|
||||||
if(discussId==undefined)
|
if (discussId == undefined) {
|
||||||
{
|
return;
|
||||||
return;
|
}
|
||||||
}
|
return request({
|
||||||
return myaxios({
|
url: `/agree/operate/${discussId}`,
|
||||||
url: `/agree/operate/${discussId}`,
|
method: "post",
|
||||||
method: 'post'
|
});
|
||||||
})
|
}
|
||||||
};
|
|
||||||
|
|||||||
@@ -1,41 +1,40 @@
|
|||||||
import myaxios from '@/utils/request'
|
import request from "@/config/axios/service";
|
||||||
export function getList(data){
|
export function getList(data) {
|
||||||
return myaxios({
|
return request({
|
||||||
url: '/article',
|
url: "/article",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params:data
|
params: data,
|
||||||
})
|
});
|
||||||
};
|
}
|
||||||
export function get(id){
|
export function get(id) {
|
||||||
return myaxios({
|
return request({
|
||||||
url: `/article/${id}`,
|
url: `/article/${id}`,
|
||||||
method: 'get'
|
method: "get",
|
||||||
})
|
});
|
||||||
};
|
}
|
||||||
export function add(data){
|
export function add(data) {
|
||||||
return myaxios({
|
return request({
|
||||||
url: `/article`,
|
url: `/article`,
|
||||||
method: 'post',
|
method: "post",
|
||||||
data:data
|
data: data,
|
||||||
})
|
});
|
||||||
};
|
}
|
||||||
export function update(id,data){
|
export function update(id, data) {
|
||||||
return myaxios({
|
return request({
|
||||||
url: `/article/${id}`,
|
url: `/article/${id}`,
|
||||||
method: 'put',
|
method: "put",
|
||||||
data:data
|
data: data,
|
||||||
})
|
});
|
||||||
};
|
}
|
||||||
export function del(ids){
|
export function del(ids) {
|
||||||
return myaxios({
|
return request({
|
||||||
url: `/article/${ids}`,
|
url: `/article/${ids}`,
|
||||||
method: 'delete'
|
method: "delete",
|
||||||
})
|
});
|
||||||
};
|
}
|
||||||
export function all(discussId)
|
export function all(discussId) {
|
||||||
{
|
return request({
|
||||||
return myaxios({
|
url: `/article/all/discuss-id/${discussId}`,
|
||||||
url: `/article/all/discuss-id/${discussId}`,
|
method: "get",
|
||||||
method: 'get'
|
});
|
||||||
})
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
import myaxios from '@/utils/request'
|
import request from "@/config/axios/service";
|
||||||
export function getList(data){
|
|
||||||
return myaxios({
|
export function getList(data) {
|
||||||
url: '/banner',
|
return request({
|
||||||
method: 'get',
|
url: "/banner",
|
||||||
params:data
|
method: "get",
|
||||||
})
|
params: data,
|
||||||
};
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,22 +1,23 @@
|
|||||||
import myaxios from '@/utils/request'
|
import request from "@/config/axios/service";
|
||||||
export function getListByDiscussId(discussId,data){
|
|
||||||
return myaxios({
|
|
||||||
url: `/comment/discuss-id/${discussId}`,
|
|
||||||
method: 'get',
|
|
||||||
params:data
|
|
||||||
})
|
|
||||||
};
|
|
||||||
export function add(data){
|
|
||||||
return myaxios({
|
|
||||||
url: `/comment`,
|
|
||||||
method: 'post',
|
|
||||||
data:data
|
|
||||||
})
|
|
||||||
};
|
|
||||||
|
|
||||||
export function del(ids){
|
export function getListByDiscussId(discussId, data) {
|
||||||
return myaxios({
|
return request({
|
||||||
url: `/comment/${ids}`,
|
url: `/comment/discuss-id/${discussId}`,
|
||||||
method: 'delete'
|
method: "get",
|
||||||
})
|
params: data,
|
||||||
};
|
});
|
||||||
|
}
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: `/comment`,
|
||||||
|
method: "post",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(ids) {
|
||||||
|
return request({
|
||||||
|
url: `/comment/${ids}`,
|
||||||
|
method: "delete",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,51 +1,48 @@
|
|||||||
import myaxios from '@/utils/request'
|
import request from "@/config/axios/service";
|
||||||
export function getList(data){
|
|
||||||
return myaxios({
|
|
||||||
url: '/discuss',
|
|
||||||
method: 'get',
|
|
||||||
params:data
|
|
||||||
})
|
|
||||||
};
|
|
||||||
export function getTopList(data){
|
|
||||||
|
|
||||||
if(data==undefined)
|
export function getList(data) {
|
||||||
{
|
return request({
|
||||||
data={isTop:true}
|
url: "/discuss",
|
||||||
}
|
method: "get",
|
||||||
else
|
params: data,
|
||||||
{
|
});
|
||||||
data["isTop"]=true;
|
}
|
||||||
}
|
export function getTopList(data) {
|
||||||
|
if (data == undefined) {
|
||||||
|
data = { isTop: true };
|
||||||
|
} else {
|
||||||
|
data["isTop"] = true;
|
||||||
|
}
|
||||||
|
|
||||||
return myaxios({
|
return request({
|
||||||
url: '/discuss',
|
url: "/discuss",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params:data
|
params: data,
|
||||||
})
|
});
|
||||||
};
|
}
|
||||||
export function get(id){
|
export function get(id) {
|
||||||
return myaxios({
|
return request({
|
||||||
url: `/discuss/${id}`,
|
url: `/discuss/${id}`,
|
||||||
method: 'get'
|
method: "get",
|
||||||
})
|
});
|
||||||
};
|
}
|
||||||
export function add(data){
|
export function add(data) {
|
||||||
return myaxios({
|
return request({
|
||||||
url: `/discuss`,
|
url: `/discuss`,
|
||||||
method: 'post',
|
method: "post",
|
||||||
data:data
|
data: data,
|
||||||
})
|
});
|
||||||
};
|
}
|
||||||
export function update(id,data){
|
export function update(id, data) {
|
||||||
return myaxios({
|
return request({
|
||||||
url: `/discuss/${id}`,
|
url: `/discuss/${id}`,
|
||||||
method: 'put',
|
method: "put",
|
||||||
data:data
|
data: data,
|
||||||
})
|
});
|
||||||
};
|
}
|
||||||
export function del(ids){
|
export function del(ids) {
|
||||||
return myaxios({
|
return request({
|
||||||
url: `/discuss/${ids}`,
|
url: `/discuss/${ids}`,
|
||||||
method: 'delete'
|
method: "delete",
|
||||||
})
|
});
|
||||||
};
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import myaxios from '@/utils/request'
|
import request from "@/config/axios/service";
|
||||||
export function upload(data){
|
|
||||||
return myaxios({
|
export function upload(data) {
|
||||||
url: '/file',
|
return request({
|
||||||
method: 'post',
|
url: "/file",
|
||||||
data:data,
|
method: "post",
|
||||||
headers: { 'Content-Type': 'multipart/form-data' }
|
data: data,
|
||||||
})
|
headers: { "Content-Type": "multipart/form-data" },
|
||||||
};
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import myaxios from '@/utils/request'
|
import request from "@/config/axios/service";
|
||||||
export function getList(data){
|
|
||||||
return myaxios({
|
export function getList(data) {
|
||||||
url: '/plate',
|
return request({
|
||||||
method: 'get',
|
url: "/plate",
|
||||||
params:data
|
method: "get",
|
||||||
})
|
params: data,
|
||||||
};
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,133 +1,131 @@
|
|||||||
import myaxios from '@/utils/request'
|
import request from "@/config/axios/service";
|
||||||
|
|
||||||
// 查询用户列表
|
// 查询用户列表
|
||||||
export function listUser(query) {
|
export function listUser(query) {
|
||||||
return myaxios({
|
return request({
|
||||||
url: '/user',
|
url: "/user",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: query
|
params: query,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询用户详细
|
// 查询用户详细
|
||||||
export function getUser(userId) {
|
export function getUser(userId) {
|
||||||
return myaxios({
|
return request({
|
||||||
url: '/user/' + parseStrEmpty(userId),
|
url: "/user/" + parseStrEmpty(userId),
|
||||||
method: 'get'
|
method: "get",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增用户
|
// 新增用户
|
||||||
export function addUser(data) {
|
export function addUser(data) {
|
||||||
return myaxios({
|
return request({
|
||||||
url: '/user',
|
url: "/user",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改用户
|
// 修改用户
|
||||||
export function updateUser(id, data) {
|
export function updateUser(id, data) {
|
||||||
return myaxios({
|
return request({
|
||||||
url: `/user/${id}`,
|
url: `/user/${id}`,
|
||||||
method: 'put',
|
method: "put",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除用户
|
// 删除用户
|
||||||
export function delUser(userId) {
|
export function delUser(userId) {
|
||||||
return myaxios({
|
return request({
|
||||||
url: `/user/${userId}`,
|
url: `/user/${userId}`,
|
||||||
method: 'delete',
|
method: "delete",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用户密码重置
|
// 用户密码重置
|
||||||
export function resetUserPwd(id, password) {
|
export function resetUserPwd(id, password) {
|
||||||
const data = {
|
const data = {
|
||||||
password
|
password,
|
||||||
}
|
};
|
||||||
|
|
||||||
|
return request({
|
||||||
return myaxios({
|
|
||||||
url: `/account/rest-password/${id}`,
|
url: `/account/rest-password/${id}`,
|
||||||
method: 'put',
|
method: "put",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用户状态修改
|
// 用户状态修改
|
||||||
export function changeUserStatus(userId, isDel) {
|
export function changeUserStatus(userId, isDel) {
|
||||||
return myaxios({
|
return request({
|
||||||
url: `/user/${userId}/${isDel}`,
|
url: `/user/${userId}/${isDel}`,
|
||||||
method: 'put'
|
method: "put",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询用户个人信息
|
// 查询用户个人信息
|
||||||
export function getUserProfile() {
|
export function getUserProfile() {
|
||||||
return myaxios({
|
return request({
|
||||||
url: '/account',
|
url: "/account",
|
||||||
method: 'get'
|
method: "get",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改用户个人信息
|
// 修改用户个人信息
|
||||||
export function updateUserProfile(data) {
|
export function updateUserProfile(data) {
|
||||||
return myaxios({
|
return request({
|
||||||
url: `/user/profile`,
|
url: `/user/profile`,
|
||||||
method: 'put',
|
method: "put",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 只修改用户头像
|
// 只修改用户头像
|
||||||
export function updateUserIcon(data) {
|
export function updateUserIcon(data) {
|
||||||
return myaxios({
|
return request({
|
||||||
url: `/account/icon`,
|
url: `/account/icon`,
|
||||||
method: 'put',
|
method: "put",
|
||||||
data:{icon:data}
|
data: { icon: data },
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 用户密码重置
|
// 用户密码重置
|
||||||
export function updateUserPwd(oldPassword, newPassword) {
|
export function updateUserPwd(oldPassword, newPassword) {
|
||||||
const data = {
|
const data = {
|
||||||
oldPassword,
|
oldPassword,
|
||||||
newPassword
|
newPassword,
|
||||||
}
|
};
|
||||||
return myaxios({
|
return request({
|
||||||
url: '/account/password',
|
url: "/account/password",
|
||||||
method: 'put',
|
method: "put",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用户头像上传
|
// 用户头像上传
|
||||||
export function uploadAvatar(data) {
|
export function uploadAvatar(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/profile/avatar',
|
url: "/system/user/profile/avatar",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询授权角色
|
// 查询授权角色
|
||||||
export function getAuthRole(userId) {
|
export function getAuthRole(userId) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/authRole/' + userId,
|
url: "/system/user/authRole/" + userId,
|
||||||
method: 'get'
|
method: "get",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 保存授权角色
|
// 保存授权角色
|
||||||
export function updateAuthRole(data) {
|
export function updateAuthRole(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/authRole',
|
url: "/system/user/authRole",
|
||||||
method: 'put',
|
method: "put",
|
||||||
params: data
|
params: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// // 查询部门下拉树结构
|
// // 查询部门下拉树结构
|
||||||
|
|||||||
@@ -1,55 +1,51 @@
|
|||||||
<template>
|
<template>
|
||||||
<div ref="VisitsLineChart"></div>
|
<div ref="VisitsLineChart"></div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import * as echarts from 'echarts/core';
|
import * as echarts from "echarts/core";
|
||||||
import { GridComponent } from 'echarts/components';
|
import { GridComponent } from "echarts/components";
|
||||||
import { LineChart } from 'echarts/charts';
|
import { LineChart } from "echarts/charts";
|
||||||
import { UniversalTransition } from 'echarts/features';
|
import { UniversalTransition } from "echarts/features";
|
||||||
import { CanvasRenderer } from 'echarts/renderers';
|
import { CanvasRenderer } from "echarts/renderers";
|
||||||
import { ref ,onMounted} from 'vue';
|
import { ref, onMounted } from "vue";
|
||||||
import { getWeek } from '@/apis/accessApi.js'
|
import { getWeek } from "@/apis/accessApi.js";
|
||||||
echarts.use([GridComponent, LineChart, CanvasRenderer, UniversalTransition]);
|
echarts.use([GridComponent, LineChart, CanvasRenderer, UniversalTransition]);
|
||||||
|
|
||||||
const VisitsLineChart=ref(null);
|
const VisitsLineChart = ref(null);
|
||||||
|
|
||||||
onMounted(async()=>{
|
onMounted(async () => {
|
||||||
var myChart = echarts.init(VisitsLineChart.value, null, {
|
var myChart = echarts.init(VisitsLineChart.value, null, {
|
||||||
width: 320,
|
width: 320,
|
||||||
height: 230
|
height: 230,
|
||||||
});
|
});
|
||||||
var option;
|
var option;
|
||||||
|
|
||||||
const response=await getWeek();
|
const response = await getWeek();
|
||||||
|
|
||||||
var numberData=response.data.map(x=>x.number);
|
var numberData = response.data.map((x) => x.number);
|
||||||
|
|
||||||
option = {
|
option = {
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: "category",
|
||||||
boundaryGap: false,
|
boundaryGap: false,
|
||||||
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
|
data: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value'
|
type: "value",
|
||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
data: numberData,
|
data: numberData,
|
||||||
type: 'line',
|
type: "line",
|
||||||
areaStyle: {}
|
areaStyle: {},
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
option && myChart.setOption(option);
|
option && myChart.setOption(option);
|
||||||
|
|
||||||
window.addEventListener('resize', function() {
|
window.addEventListener("resize", function () {
|
||||||
myChart.resize();
|
myChart.resize();
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
50
Yi.BBS.Vue3/src/hooks/useEcharts.js
Normal file
50
Yi.BBS.Vue3/src/hooks/useEcharts.js
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import * as echarts from "echarts";
|
||||||
|
import { onMounted, onUnmounted, watch } from "vue";
|
||||||
|
import { debounce } from "@/utils/index";
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
|
// containerRef echarts实例 props 传入的值 baseOptions 图表初始化渲染
|
||||||
|
export default function useEcharts(containerRef, emits, props, baseOptions) {
|
||||||
|
let chart = null;
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
chart = echarts.init(containerRef.value);
|
||||||
|
init();
|
||||||
|
chart.on("click", function (param) {
|
||||||
|
emits("chart-click", param);
|
||||||
|
});
|
||||||
|
//自适应不同屏幕时改变图表尺寸
|
||||||
|
window.addEventListener("resize", cancalDebounce);
|
||||||
|
});
|
||||||
|
// 用于将echarts实例暴露出去使用
|
||||||
|
const getChart = () => chart;
|
||||||
|
onUnmounted(() => {
|
||||||
|
chart && chart.dispose();
|
||||||
|
window.removeEventListener("resize", cancalDebounce);
|
||||||
|
});
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
let option = _.cloneDeep(baseOptions);
|
||||||
|
chart.setOption(option);
|
||||||
|
chart.setOption(props.option);
|
||||||
|
}
|
||||||
|
|
||||||
|
function resize() {
|
||||||
|
chart && chart.resize();
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.option,
|
||||||
|
(val) => {
|
||||||
|
chart && chart.setOption(val);
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
|
|
||||||
|
const cancalDebounce = debounce(resize, 500);
|
||||||
|
|
||||||
|
return {
|
||||||
|
getChart,
|
||||||
|
resize,
|
||||||
|
};
|
||||||
|
}
|
||||||
12
Yi.BBS.Vue3/src/utils/index.js
Normal file
12
Yi.BBS.Vue3/src/utils/index.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
//设置防抖,保证无论拖动窗口大小,只执行一次获取浏览器宽高的方法
|
||||||
|
export const debounce = (fun, delay) => {
|
||||||
|
let timer;
|
||||||
|
return function () {
|
||||||
|
if (timer) {
|
||||||
|
clearTimeout(timer);
|
||||||
|
}
|
||||||
|
timer = setTimeout(() => {
|
||||||
|
fun();
|
||||||
|
}, delay);
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -131,8 +131,8 @@ onMounted(async () => {
|
|||||||
plateList.value = plateData.items;
|
plateList.value = plateData.items;
|
||||||
const { data: discussData } = await discussGetList(query);
|
const { data: discussData } = await discussGetList(query);
|
||||||
discussList.value = discussData.items;
|
discussList.value = discussData.items;
|
||||||
const { data: bannerData } = await bannerGetList();
|
// const { data: bannerData } = await bannerGetList();
|
||||||
bannerList.value = bannerData.items;
|
// bannerList.value = bannerData.items;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
1160
Yi.Bbs.Vue3/yarn.lock
Normal file
1160
Yi.Bbs.Vue3/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user