dart dart-pub flutter flutter-dependencies flutter-animation
[![消息错误]] [1]: https://i.stack.imgur.com/ciKCK.png
我的观点是,如果有人在没有登录的情况下进入授权页面,它将被重定向到登录页面。
这是我的代码(.NET Core 3.1):
我的控制器
[Authorize]
public IActionResult Username()
{
var lstUsername = _dbContext.MT_USERNAME.ToList();
return View(lstUsername);
}
Run Code Online (Sandbox Code Playgroud)
我的 Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<GPServiceDbContext>(options =>
{
options.UseSqlServer(xxx);
});
services.AddControllersWithViews();
services.AddSession(options =>
{
options.IdleTimeout = TimeSpan.FromMinutes(1);
});
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseStatusCodePages(context =>
{
var response = context.HttpContext.Response;
if (response.StatusCode == (int)HttpStatusCode.Unauthorized ||
response.StatusCode == (int)HttpStatusCode.Forbidden)
response.Redirect("/Login/Login");
return Task.CompletedTask; …Run Code Online (Sandbox Code Playgroud) 我每行都有一个删除按钮,我需要log_id从 items 中获取数据以传递给 function deleteLog。该功能始终提醒的log_id是undefined。
如果没有 ,我如何传递log_id给函数?deleteLogundefined
<template>
<b-table striped hover :items="items" :fields="fields">
<template v-slot:cell(Delete)>
<b-button variant="danger" v-on:click="deleteLog(log_id)">Delete</b-button>
</template>
</b-table>
</template>
<script>
export default {
data() {
return {
fields: ['Year', 'Month', 'Round', 'Name', 'Delete', 'log_id'],
items: []
}
}
}
</script>
Run Code Online (Sandbox Code Playgroud) .net-core ×1
asp.net-core ×1
asp.net-mvc ×1
c# ×1
dart ×1
dart-pub ×1
flutter ×1
javascript ×1
vue.js ×1
vuejs2 ×1