在我的角度控制器中,我有以下代码来检查是否需要登录:
[LIFECYCLE] [class org.gradle.TaskExecutionLogger] :my-proj-ear:cargoRunLocal FAILED
[INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :my-proj-ear:cargoRunLocal (Thread[main,5,main]) completed. Took 1.528 secs.
[DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[main,5,main]] finished, busy: 2.477 secs, idle: 0.0020 secs
[ERROR] [org.gradle.BuildExceptionReporter]
[ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
[ERROR] [org.gradle.BuildExceptionReporter]
[ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
[ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':my-proj-ear:cargoRunLocal'.
[ERROR] [org.gradle.BuildExceptionReporter] > cargo doesn't support the nested "mkdir" element.
[ERROR] [org.gradle.BuildExceptionReporter]
[ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
[ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':my-proj-ear:cargoRunLocal'.
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:62)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:155)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.Factories$1.create(Factories.java:22)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:152)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:33)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:100)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:94)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:94)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:77)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:47)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.doAction(Main.java:33)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
[ERROR] [org.gradle.BuildExceptionReporter] Caused by: : cargo doesn't support the nested "mkdir" element.
[ERROR] [org.gradle.BuildExceptionReporter] at org.apache.tools.ant.UnknownElement.handleChildren(UnknownElement.java:371)
[ERROR] [org.gradle.BuildExceptionReporter] at org.apache.tools.ant.UnknownElement.configure(UnknownElement.java:204)
[ERROR] [org.gradle.BuildExceptionReporter] at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:163)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.ant.BasicAntBuilder.nodeCompleted(BasicAntBuilder.java:77)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.ant.BasicAntBuilder.doInvokeMethod(BasicAntBuilder.java:92)
[ERROR] [org.gradle.BuildExceptionReporter] at com.bmuschko.gradle.cargo.tasks.local.LocalCargoContainerTask.runAction(LocalCargoContainerTask.groovy:170)
[ERROR] [org.gradle.BuildExceptionReporter] at com.bmuschko.gradle.cargo.tasks.AbstractCargoContainerTask$_start_closure2.doCall(AbstractCargoContainerTask.groovy:92)
[ERROR] [org.gradle.BuildExceptionReporter] at com.bmuschko.gradle.cargo.tasks.AbstractCargoContainerTask$_start_closure2.doCall(AbstractCargoContainerTask.groovy)
[ERROR] [org.gradle.BuildExceptionReporter] at com.bmuschko.gradle.cargo.util.LoggingHandler.withAntLoggingListener(LoggingHandler.groovy:36)
[ERROR] [org.gradle.BuildExceptionReporter] at com.bmuschko.gradle.cargo.util.LoggingHandler$withAntLoggingListener.call(Unknown Source)
[ERROR] [org.gradle.BuildExceptionReporter] at com.bmuschko.gradle.cargo.tasks.AbstractCargoContainerTask.start(AbstractCargoContainerTask.groovy:91)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:226)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:219)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:208)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
[ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
[ERROR] [org.gradle.BuildExceptionReporter] ... 57 more
[ERROR] [org.gradle.BuildExceptionReporter] Caused by: The <cargo> type doesn't support the nested "mkdir" element.
[ERROR] [org.gradle.BuildExceptionReporter] at org.apache.tools.ant.IntrospectionHelper.throwNotSupported(IntrospectionHelper.java:509)
[ERROR] [org.gradle.BuildExceptionReporter] at org.apache.tools.ant.UnknownElement.handleChildren(UnknownElement.java:361)
[ERROR] [org.gradle.BuildExceptionReporter] ... 75 more
[ERROR] [org.gradle.BuildExceptionReporter]
[LIFECYCLE] [org.gradle.BuildResultLogger]
[LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
如果需要登录,那么从控制器我想显示登录页面以获取用户名和密码,然后使用用户名和密码访问Web API,如下所示:
$scope.checkApi = "api/check";
$http.post($scope.checkApi).then(function (response)
{
if (response.status != 200)
{
alert("Logon required.");
}
}, function (response)
{
if (response.status != 200)
{
alert("Logon required.");
}
});
感谢。
答案 0 :(得分:0)
您可以重定向到登录页面而不是提供警报。使用$ window.location.href = url映射登录页面;