Imports System.Net Imports System.Web.Http Imports System.Net.Http Imports Newtonsoft.Json Imports System.Web.Http.Filters ''' <summary> ''' 登入驗證錯誤自訂訊息 ''' </summary> ''' <remarks> </remarks> Public Class TestAuthorizeAttribute Inherits AuthorizeAttribute Protected Overrides Sub HandleUnauthorizedRequest(actionContext As Controllers.HttpActionContext) MyBase.HandleUnauthorizedRequest(actionContext) actionContext.Response.Content = New StringContent(JsonConvert.SerializeObject(New Dictionary(Of String, String) From {{"result", "-1"}}, Formatting.Indented)) Select Case actionContext.Response.StatusCode Case 401 Dim dicError As Dictionary(Of String, String) = New Dictionary(Of String, String) From { {"result", "-1"}, {"msg", "Login F...