这些是我的路线:

const routes:Routes =[
  {path:'', component:WelcomeComponent},
  {path:'profile', component: ProfileComponent},
  {path:'addcourse', component: AddcourseComponent},
  {path:'course', component: CourseComponent},
  {path:'editCourse', component: EditCourseComponent},
  {path:'addLectures', component: AddLectureComponent},
  {path:'login', component:LoginComponent},
  {path:'register', component:RegisterComponent},
  // { path: 'newform', canActivate:[AuthGuard], component:NewFomComponent},
  { path: '**', redirectTo:'', pathMatch:'full'}

我的应用程序从欢迎页面开始,当我点击登录时它会带我进入课程页面,点击课程后,应用程序应该带我到课程组件,但它会重定向到欢迎页面,当我点击登录时它给了我这个错误:

错误:未捕获(在承诺中):SecurityError:无法在'History'上执行'pushState':具有URL的历史状态对象'http://%28login%29/ ' cannot be created in a document with origin ' http://localhost:4200 ' and URL ' http://localhost:4200/ '. Error: Failed to execute ' pushState ' on '历史': A history state object with URL ' http://%28login%29/ ' cannot be created in a document with origin ' http://localhost:4200 ' and URL ' http://localhost:4200/' . 我已经查找了类似的问题,并且所有人都建议检查基本href,在我的应用程序中它设置为/所以没有问题 . 任何人都可以请我做错了什么?