mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-21 02:57:54 +08:00
增加演示版本支持,在web.config中配置即可;
增加自定义出差处理,参考ErrorController
This commit is contained in:
@@ -1,17 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Infrastructure;
|
||||
using OpenAuth.Mvc.Models;
|
||||
|
||||
namespace OpenAuth.Mvc.Controllers
|
||||
{
|
||||
public class ErrorController : Controller
|
||||
{
|
||||
// GET: Error
|
||||
public ActionResult NoAccess()
|
||||
public ActionResult Http404()
|
||||
{
|
||||
return View();
|
||||
return Content("貌似URL不在~~", "text/plain");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 演示版本禁止提交
|
||||
/// </summary>
|
||||
public string DemoError()
|
||||
{
|
||||
Response.Charset = "utf-8";
|
||||
var response = new BjuiResponse
|
||||
{
|
||||
statusCode = "400",
|
||||
message = "演示版本,不能进行此操作"
|
||||
};
|
||||
return JsonHelper.Instance.Serialize(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 没有登录
|
||||
/// </summary>
|
||||
/// <returns>ActionResult.</returns>
|
||||
public ActionResult Http401()
|
||||
{
|
||||
return RedirectToAction("Index", "Login");
|
||||
}
|
||||
|
||||
|
||||
public string Http500()
|
||||
{
|
||||
Response.Charset = "utf-8";
|
||||
var response = new BjuiResponse
|
||||
{
|
||||
statusCode = "500",
|
||||
message = "服务器内部错误,请联系管理员"
|
||||
};
|
||||
return JsonHelper.Instance.Serialize(response);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user