devise tree使用

Setting Up an Angular SPA on Rails with Devise and Bootstrap

This article was originally published at jessenovotny.com.

本文最初发表在jessenovotny.com上 。

When I started programming my very first Angular single page application (SPA), I noticed the resources for setup and integration with Devise to be thin or fragmented. The most useful guide I found was actually just a segment of a general Angular with Rails walkthrough. There were other resources that were either too complex or advanced, and they didn’t really go through the initial baby steps. One of the most daunting challenges for a new programmer is starting from scratch. I know, because I’m one of these folks.

当我开始对第一个Angular单页应用程序(SPA)进行编程时,我注意到用于与Devise进行设置和集成的资源很少或很零散。 我发现最有用的指南实际上只是通用Angular with Rails演练的一部分。 还有其他资源太复杂或太高级,它们实际上并没有经过最初的初级步骤。 对于新程序员来说,最艰巨的挑战之一是从头开始。 我知道,因为我是这些人之一。

Most of what I’ve learned through my online course has been delivered in small, increasingly more advanced components. I open a lab, and the groundwork is already laid out, so there isn’t a ton of practice in setting up an app from a blank slate. For the sake of course completion time, this makes sense. Besides, you only need to build a couple apps from the ground up to get a feel for how it’s done. If you haven’t gotten there yet, this walkthrough will be right up your alley.

我从在线课程中学到的大部分内容都是通过小型的,越来越先进的组件提供的。 我开设了一个实验室,并且基础工作已经准备就绪,因此从空白开始设置应用程序并没有太多实践。 为了完成课程,这很有意义。 此外,您只需要从头开始构建几个应用程序即可了解它的完成方式。 如果您还没到那儿,那么这个演练将就在您的小巷。

Once I finally got all the pieces working and my first Angular project was up and running, I felt it pertinent to give back to the community. Since I currently don’t have enough “reputation points” to answer questions on Stack Overflow, the next best thing would be to make my own walkthrough for setting up an Angular SPA on Rails with Devise and Bootstrap. The following is exactly what I wish I had found in my initial research on the topic.

当我终于完成所有工作,并且我的第一个Angular项目启动并运行后,我觉得回馈社区是很重要的。 由于我目前没有足够的“信誉点”来回答有关Stack Overflow的问题,因此,下一个最好的事情就是自己动手,在带有Devise和Bootstrap的Rails上设置Angular SPA。 以下正是我希望对该主题进行初步研究时发现的。

Granted, a huge part of web development is being able to solve complex problems without being handed the solution. I feel that sometimes a new developer just needs a helping hand. So here it is.

当然,Web开发的很大一部分就是能够解决复杂的问题而无需交付解决方案。 我觉得有时候新开发者只需要伸出援手。 就是这样

入门 (Getting Started)

This guide is meant to be a diving board for getting started. It assumes you already have a basic understanding of Angular, Rails, Devise, and Bootstrap. I chose to not explore Active Record, but I do touch on Active Model Serializer, as it’s necessary for sending models to your JavaScript front end. There’s much more to learn about this subject and that would warrant its own series of guides. Likewise, I only go into installing Bootstrap to the point where I can verify it’s working.

本指南旨在成为入门的跳水板。 假定您已经对Angular,Rails,Devise和Bootstrap有基本的了解。 我选择不探索Active Record,但是我确实接触了Active Model Serializer,因为将模型发送到JavaScript前端是必需的。 关于这个主题,还有很多要学习的知识,这将保证它拥有自己的一系列指南。 同样,我只需要安装Bootstrap即可验证它是否正常工作。

Feel free to read along with the video I created for this tutorial:

随时阅读我为本教程创建的视频:

配置 (Setting up)

To get started, you want to open Terminal and navigate to the folder where you want to create your new application. In this demonstration, I’m on the Desktop.

首先,您要打开终端并导航到要在其中创建新应用程序的文件夹。 在此演示中,我在桌面上。

In Terminal, you will run $ rails new YOUR-APP which initializes Rails, creates a directory with the entire framework, and bundles all of the baked in gems. (In case you’re unfamiliar, $ denotes a Terminal command.)

在Terminal中,您将运行$ rails new YOUR-APP ,它将初始化Rails,创建带有整个框架的目录,并将所有烘焙的宝石捆绑在一起。 (如果您不熟悉, $表示终端命令。)

Open your Gemfile, remove gem 'turbolinks' and add the following:

打开您的Gemfile ,删除Gemfile gem 'turbolinks'并添加以下内容:

gem 'bower-rails'
gem 'devise'
gem 'angular-rails-templates' #=> allows us to place our html views in the assets/javascripts directory
gem 'active_model_serializers'
gem 'bootstrap-sass', '~> 3.3.6' #=> bootstrap also requires the 'sass-rails' gem, which should already be included in your gemfile

While Bower isn’t essential to this project, I chose to use it for one simple reason: experience. Sooner or later, I’ll probably find myself working on an app that was built with Bower, so why not start playing with it now?

尽管Bower对该项目不是必不可少的,但出于一个简单的原因,我选择使用它:经验。 迟早,我可能会发现自己正在使用Bower构建的应用程序上工作,那么为什么不立即开始玩呢?

What is Bower? You can learn more on their website, bower.io, but as far as I can tell, it’s essentially a package manager just like Ruby gems or npm. You can install it with npm, but I chose to include the bower-rails gem for this guide.

什么是凉亭? 您可以在他们的网站bower.io上了解更多信息,但是据我所知,它实际上是一个软件包管理器,就像Ruby gems或npm一样。 您可以使用npm安装它,但是我选择在本指南中包括bower-rails gem。

初始化宝石,创建数据库和添加迁移 (Initializing the Gems, Creating a Database and Adding a Migration)

Now we’re going to install/initialize these gems, create our database, add a migration so users can sign up with a username, and then apply these migrations to our schema with the following commands:

现在,我们将安装/初始化这些gem,创建数据库,添加迁移,以便用户可以使用用户名进行注册,然后使用以下命令将这些迁移应用于我们的模式:

$ bundle install
$ rake db:create #=> create database
$ rails g bower_rails:initialize json  #=> generates bower.json file for adding "dependencies"
$ rails g devise:install #=> generates config/initializers/devise.rb, user resources, user model, and user migration with a TON of default configurations for authentication
$ rails g migration AddUsernametoUsers username:string:uniq #=> generates, well, exactly what it says.
$ rake db:migrate

By the time you’ve got momentum building out your app, you’ll likely have many more dependencies or “packages”, but here’s what you’ll need to get started. Add the following vendor dependencies to bower.json:

等到您有能力开发自己的应用程序时,您可能会拥有更多的依赖项或“程序包”,但这就是开始所需要的。 将以下供应商依赖项添加到bower.json

...
"vendor": {
"name": "bower-rails generated vendor assets",
"dependencies": {
"angular": "v1.5.8",
"angular-ui-router": "latest",
"angular-devise": "latest"
}
}

Once you’ve saved those changes in bower.json, you’ll want to install those packages with the following command and then generate your user serializer from the ‘active-model-serializer’ gem installed earlier:

将这些更改保存在bower.json中之后,您将需要使用以下命令安装这些软件包,然后从之前安装的'active-model-serializer'gem生成用户序列化器:

$ rake bower:install
$ rails g serializer user

Look for app/serializers/user_serializer.rb and add , :username directly after attributes :id so that when Devise requests the user’s information from Rails, you can display their chosen username. This is much nicer than saying “Welcome, jesse@email.com” or worse, “Welcome, 5UPer$3CREtP4SSword”. Just kidding, but seriously, don’t do that.

查找app / serializers / user_serializer.rb并在attributes :id之后直接添加, :username ,以便在Devise向Rails请求用户信息时,可以显示其选择的用户名。 这比说“ Welcome,jesse@email.com”好得多,或者说“ Welcome,5UPer $ 3CREtP4SSword”好得多。 只是开玩笑,但认真的是,不要那样做。

Add the following in config/application.rb directly under class Application < Rails::Application:

将以下内容直接添加到config/application.rb class Application < Rails::Application

config.to_prepare do
DeviseController.respond_to :html, :json
end

Since Angular will request information about the user using .json, we need to make sure the DeviseController will respond appropriately, which it doesn’t do by default.

由于角将使用要求有关用户的信息.json ,我们需要确保DeviseController会做出适当的React,它默认情况下不这样做。

完成后端设置 (Completing the Back-end Setup)

We’re getting soooo close to finishing our back-end. Just a few more adjustments …

我们正在SOOOO即将完成我们的后端。 再进行一些调整...

Open config/routes.rb and add the following line under devise_for :users: root 'application#index'. Then replace the contents of app/controllers/application_controller.rb with this whole snippet:

打开config/routes.rb并在devise_for :users下添加以下行devise_for :users root 'application#index' 。 然后,使用以下完整代码段替换app/controllers/application_controller.rb的内容:

class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
before_action :configure_permitted_parameters, if: :devise_controller?
skip_before_action :verify_authenticity_token
respond_to :json
def index
render 'application/index'
end
protected
def configure_permitted_parameters
added_attrs = [:username, :email, :password, :password_confirmation, :remember_me]
devise_parameter_sanitizer.permit :sign_up, keys: added_attrs
devise_parameter_sanitizer.permit :account_update, keys: added_attrs
end
end

We’ve done a few things here. First, we’re telling Rails that :json is our friend; our only view lives in views/application/index.html.erb; don’t worry about authenticity tokens when you get a call from Devise; oh, and our user will have a username.

我们在这里做了一些事情。 首先,我们告诉Rails :json是我们的朋友; 我们唯一的视图位于views/application/index.html.erb ; 当您从Devise接到电话时,不必担心真实性令牌; 哦,我们的用户将有一个用户名。

Next open app/controllers/users_controller.rb and make sure you can access the user in JSON format with any /users/:id.json request:

接下来打开app/controllers/users_controller.rb并确保您可以使用任何/users/:id.json请求以JSON格式访问用户:

class UsersController < ApplicationController
def show
user = User.find(params[:id])
render json: user
end  
end

Don’t worry about setting up the :show resource in routes.rb. Devise has done this for us already!

不用担心在routes.rb设置:show资源。 Devise已经为我们做到了!

By default, Rails will initialize with views/layouts/application.html.erb, but we don’t want that (or rather, I don’t want this), so do the following:

默认情况下,Rails将使用views/layouts/application.html.erb初始化,但是我们不希望这样做(或者,我不希望这样做),因此请执行以下操作:

  • Move that file to app/views/application/.

    此举文件, app/views/application/

  • Rename it to index.html.erb.

    将其重命名为index.html.erb

  • Replace <%= yield %> with <ui-view></ui-view> (we won’t be rendering any erb aside from the script/style tags in our header).

    <%= yield %>替换为<ui-view></ui-view> (除了标题中的脚本/样式标签之外,我们不会渲染任何erb)。

  • Remove any mention of “turoblinks” in the script and stylesheet erb tags.

    删除脚本和样式表erb标签中对“ turoblinks”的任何提及。
  • Add ng-app="myApp" as an attribute to the <body> tag. When we launch our server, Angular will load and frantically search our DOM for this before initializing our app.

    ng-app="myApp"作为属性添加到<body>标签。 当我们启动服务器时,Angular将在初始化我们的应用程序之前加载并疯狂地在DOM中搜索此内容。

The final step to getting our back end configured is laying out our asset pipeline. Bower has already installed a bunch of stuff for us in vendor/assets/bower_components. Likewise, we installed a bunch of sweet gems earlier. Let’s make sure our app can find these scripts and stylesheets:

配置后端的最后一步是布置资产管道。 Bower已经在vendor/assets/bower_components为我们安装了很多东西。 同样,我们之前安装了许多甜美的宝石。 确保我们的应用程序可以找到以下脚本和样式表:

Require the following in app/assets/javascripts/application.js:

app/assets/javascripts/application.js要求以下内容:

//= require jquery
//= require jquery_ujs
//= require angular
//= require angular-ui-router
//= require angular-devise
//= require angular-rails-templates
//= require bootstrap-sprockets
//= require_tree .

Note: don’t forget to remove require turbolinks

注意:别忘了删除require turbolinks

Finally, we must rename app/assets/stylesheets/application.css to application.scss and add these two @import lines at the end of our stylesheet:

最后,我们必须将app/assets/stylesheets/application.css重命名为application.scss并在样式表的末尾添加这两条@import行:

*
*= require_tree .
*= require_self
*/
@import "bootstrap-sprockets";
@import "bootstrap";

Boom!! Now we have everything set up and we can start working on our front end.

繁荣!! 现在我们已完成所有设置,我们可以开始进行前端工作了。

前端 (The Front End)

Here’s a preview of what our Angular application tree will look like. Since we installed the ‘angular-templates’ gem, we can keep all of our HTML files in the assets/javascripts directory with all of our other Angular files:

这是Angular应用程序树的外观预览。 由于我们安装了“ angular-templates” gem,因此我们可以将所有HTML文件和所有其他Angular文件保留在assets/javascripts目录中:

/javascripts/controllers/AuthCtrl.js
/javascripts/controllers/HomeCtrl.js
/javascripts/controllers/NavCtrl.js
/javascripts/directives/NavDirective.js
/javascripts/views/home.html
/javascripts/views/login.html
/javascripts/views/register.html
/javascripts/views/nav.html
/javascripts/app.js
/javascripts/routes.js

First things first: let’s declare our application in app.js and inject the necessary dependencies:

首先,首先要在app.js声明我们的应用程序,并注入必要的依赖项:

(function(){
angular
.module('myApp', ['ui.router', 'Devise', 'templates'])
}())

I’m using an IIFE here, for reasons explained in this quote:

我在这里使用IIFE,原因如下:

Wrapping your AngularJS components in an Immediately Invoked Function Expression (IIFE). This helps to prevent variables and function declarations from living longer than expected in the global scope, which also helps avoid variable collisions. This becomes even more important when your code is minified and bundled into a single file for deployment to a production server by providing variable scope for each file. — Codestyle.co AngularJS Guide

将AngularJS组件包装在立即调用的函数表达式(IIFE)中。 这有助于防止变量和函数声明在全局范围内的寿命超出预期,这也有助于避免变量冲突。 当您的代码经过精简并捆绑到一个文件中以通过为每个文件提供可变作用域来部署到生产服务器时,这一点变得尤为重要。 — Codestyle.co AngularJS指南

Routes.js (Routes.js)

Next, we’re going to stub out our routes.js file. Some of this is a step ahead of where we are now, but I’d rather get it out of the way now than come back:

接下来,我们将routes.js文件。 其中一些步骤比我们现在要领先,但我宁愿现在就摆脱它,也不要回来:

angular
.module('myApp')
.config(function($stateProvider, $urlRouterProvider){
$stateProvider
.state('home', {
url: '/home',
templateUrl: 'views/home.html',
controller: 'HomeCtrl'
})
.state('login', {
url: '/login',
templateUrl: 'views/login.html',
controller: 'AuthCtrl',
onEnter: function(Auth, $state){
Auth.currentUser().then(function(){
$state.go('home')
})
}
})
.state('register', {
url: '/register',
templateUrl: 'views/register.html',
controller: 'AuthCtrl',
onEnter: function(Auth, $state){
Auth.currentUser().then(function(){
$state.go('home')
})
}
})
$urlRouterProvider.otherwise('/home')
})

What we’ve just done is called our angular app ‘myApp’, and called the config function, passing in $stateProvider and $routerUrlProvider as parameters. Immediately we can call $stateProvider and start chaining .state() methods, which take two parameters, the name of the state (‘home’ for example), and an object of data that describes the state, such as its URL, HTML template, and which controller to use. We’re also using $urlRouterProvider just to make sure that the user can’t navigate anywhere but to our predetermined states.

我们刚刚完成的工作称为角度应用程序“ myApp”,并称为配置函数,将$stateProvider$routerUrlProvider作为参数$routerUrlProvider 。 立即我们可以调用$stateProvider并开始链接.state()方法,该方法.state()两个参数,状态的名称(例如“ home”)和描述状态的数据对象,例如其URL,HTML模板,以及要使用的控制器。 我们还使用$urlRouterProvider来确保用户只能导航到我们的预定状态。

A few things you may not yet be familiar with up to this point are onEnter, $state, and Auth. We’ll get to that later.

onEnter ,您可能还不熟悉的一些内容是onEnter$stateAuth 。 我们稍后再讨论。

Now, let’s build our home.html and HomeCtrl.js:

现在,让我们构建我们的home.htmlHomeCtrl.js

<div class="col-lg-8 col-lg-offset-2">
<h1>{{hello}}</h1>
<h3 ng-if="user">Welcome, {{user.username}}</h3>
</div>
angular
.module('myApp')
.controller('HomeCtrl', function($scope, $rootScope, Auth){
$scope.hello = "Hello World"
})

You may want to comment the login/register states and run $ rails s to make sure everything’s working. If it is, you’ll see a big beautiful “Hello World”. If it’s right at the top towards the middle, take a deep breath of relief, because Bootstrap is kicking in and that col-lg stuff is positioning it nicely rather than being stuck in the top left corner.

您可能需要注释登录/注册状态并运行$ rails s ,以确保一切正常。 如果是这样,您会看到一个美丽的“ Hello World”。 如果它正好位于顶部的中间位置,请深呼吸,因为Bootstrap正在插入,并且col-lg物品将其放置在很好的位置,而不是卡在左上角。

What Angular has done is searched the DOM, found the attribute ng-app, initialized “myApp”, navigated to /home by default from our router, located the <ui-view> directive, instantiated our HomeCtrl, injected the $scope object, added a key of hello, assigned it a value of "Hello World", and then rendered home.html with this information within the <ui-view> element. Once in the view, Angular scans for any meaningful commands such as the {{...}} bindings and the ng-if directive and renders the controller’s information as needed. I will admit the order of these operations may be off slightly, but you get the gist of what’s going on under the hood.

Angular完成的工作是搜索DOM,找到属性ng-app ,初始化为“ myApp”,默认情况下从我们的路由器导航到/home ,位于<ui-view>指令,实例化HomeCtrl ,注入了$scope对象,添加了一个hello键,为其分配了"Hello World"值,然后使用<ui-view>元素中的此信息呈现了home.html 。 进入视图后,Angular会扫描任何有意义的命令,例如{{...}}绑定和ng-if指令,并根据需要呈现控制器的信息。 我承认这些操作的顺序可能会略有偏离,但是您可以了解幕后情况。

建立AuthCtrl.js和login.html / register.html文件 (Building Out AuthCtrl.js and login.html/register.html Files)

Since we’ve got all of this nitty gritty behind the scenes information out of the way, let’s build out our AuthCtrl.js and login.html/register.html files:

由于我们已经将所有这些AuthCtrl.js信息隐藏在了后面,所以让我们构建AuthCtrl.jslogin.html / register.html文件:

# login.html
<div class="col-lg-8 col-lg-offset-2">
<h1 class="centered-text">Log In</h1>
<form ng-submit="login()">
<div class="form-group">
<input type="email" class="form-control" placeholder="Email" ng-model="user.email" autofocus>
</div>
<div class="form-group">
<input type="password" class="form-control" placeholder="Password" ng-model="user.password">
</div>
<input type="submit" class="btn btn-info" value="Log In">
</form>
</div>
# register.html
<div class="col-lg-8 col-lg-offset-2">
<h1 class="centered-text">Register</h1>
<form ng-submit="register()">
<div class="form-group">
<input type="email" class="form-control" placeholder="Email" ng-model="user.email" autofocus>
</div>
<div class="form-group">
<input type="username" class="form-control" placeholder="Username" ng-model="user.username" autofocus>
</div>
<div class="form-group">
<input type="password" class="form-control" placeholder="Password" ng-model="user.password">
</div>
<input type="submit" class="btn btn-info" value="Log In">
</form>
<br>
<div class="panel-footer">
Already signed up? <a ui-sref="home.login">Log in here</a>.
</div>
</div>

Before I overwhelm you with the AuthCtrl, I just want to point out that most of what you’re seeing are Bootstraped CSS classes so that you’re all super impressed with how beautifully this renders. Ignore all of the class attributes, and everything else should be pretty familiar, such as ng-submit, ng-model, and ui-sref, which takes the places of our usual href anchor tag attribute. Now for the AuthCtrl … are you ready?

在我用AuthCtrl让您不知所措之前,我只想指出,您所看到的大部分都是Bootstraped CSS类,因此您对这些渲染的精美程度都印象深刻。 忽略所有的类属性,其他所有内容都应该非常熟悉,例如ng-submitng-modelui-sref ,它们ui-sref了我们通常的href锚标记属性。 现在使用AuthCtrl…准备好了吗?

angular
.module('myApp')
.controller('AuthCtrl', function($scope, $rootScope, Auth, $state){
var config = {headers: {'X-HTTP-Method-Override': 'POST'}}
$scope.register = function(){
Auth.register($scope.user, config).then(function(user){
$rootScope.user = user
alert("Thanks for signing up, " + user.username);
$state.go('home');
}, function(response){
alert(response.data.error)
});
};
$scope.login = function(){
Auth.login($scope.user, config).then(function(user){
$rootScope.user = user
alert("You're all signed in, " + user.username);
$state.go('home');
}, function(response){
alert(response.data.error)
});
}
})

Most of this code is derived from the Angular Devise documentation, so I won’t go into too much detail. What you need to know now is that Auth is the service created by angular-device, and it comes with some pretty awesome functions, such as Auth.login(userParameters, config) and Auth.register(userParameters, config). These create a promise, which returns the logged in user once resolved.

这些代码大部分来自Angular Devise文档 ,因此我不会赘述。 您现在需要知道的是Auth是由angular-device创建的服务,它具有一些非常出色的功能,例如Auth.login(userParameters, config)Auth.register(userParameters, config) 。 这些创建承诺,一旦解决,将返回登录的用户。

I’ll admit that I’ve cheated a bit here and assigned that user to the $rootScope. However, a better performing, more scalable approach would be to create a UserService, store the user there, and then inject UserService into any of your controllers that need the user. For the sake of brevity, I also used a simple alert() function in lieu of integrating ngMessages or another service like ngFlash to make announcements about errors or successful login events.

我承认我在这里已经作弊,并将该用户分配给$rootScope 。 但是,一种性能更好,可扩展性更好的方法是创建一个UserService,在其中存储用户,然后将UserService注入需要该用户的任何控制器中。 为了简洁起见,我还使用了一个简单的alert()函数来代替集成ngMessages或其他服务(例如ngFlash来发布有关错误或成功登录事件的公告。

The rest should be pretty self explanatory. The ng-submit forms are attached to these $scope functions, $scope.user is pulling the information from the ng-models on the form inputs, and $state.go() is a nifty function for redirecting to another state.

其余的应该是很自我解释的。 ng-submit表单附加到这些$scope函数上, $scope.user正在从表单输入上的ng-model提取信息,而$state.go()是一个用于重定向到另一个状态的漂亮函数。

If you go back to routes.js now, all of that onEnter logic should make a lot more sense.

如果您现在返回routes.js ,那么所有的onEnter逻辑都应该更有意义。

汇集全部 (Bringing It All Together)

I saved the best for last, so let’s build a fancy little NavDirective.js and nav.html to bring everything together:

我把最好的nav.html到了最后,所以让我们构建一个漂亮的NavDirective.jsnav.html来将所有内容组合在一起:

angular
.module('myApp')
.directive('navBar', function NavBar(){
return {
templateUrl: 'views/nav.html',
controller: 'NavCtrl'
}
})
<div class="col-lg-8 col-lg-offset-2">
<ul class="nav navbar-nav" >
<li><a ui-sref="home">Home</a></li>
<li ng-hide="signedIn()"><a ui-sref="login">Login</a></li>
<li ng-hide="signedIn()"><a ui-sref="register">Register</a></li>
<li ng-show="signedIn()"><a ng-click="logout()">Log Out</a></li>
</ul>
</div>

And the more robust NavCtrl.js:

还有更强大的NavCtrl.js

angular
.module('myApp')
.controller('NavCtrl', function($scope, Auth, $rootScope){
$scope.signedIn = Auth.isAuthenticated;
$scope.logout = Auth.logout;
Auth.currentUser().then(function (user){
$rootScope.user = user
});
$scope.$on('devise:new-registration', function (e, user){
$rootScope.user = user
});
$scope.$on('devise:login', function (e, user){
$rootScope.user = user
});
$scope.$on('devise:logout', function (e, user){
alert("You have been logged out.")
$rootScope.user = undefined
});
})

All we’re doing here is setting up the functions to use in the navigation links such as ng-hide="signedIn()" and ng-click="logout()" and adding listeners to the $scope so that we can trigger actions when certain devise specific events occur. We’re also calling Auth.currentuser() so that when this controller is instantiated, we can double check our $rootScope.user object and display the proper nav links.

我们在这里所做的就是设置要在导航链接中使用的函数,例如ng-hide="signedIn()"ng-click="logout()" ,并将侦听器添加到$scope以便我们可以触发当某些特定devise事件发生时的动作。 我们还调用Auth.currentuser()以便在实例化此控制器时,我们可以Auth.currentuser()检查$rootScope.user对象并显示正确的导航链接。

Let’s find app/views/application/index.html again and add <nav-bar></nav-bar> on the line above <ui-view>. Since this isn’t tied to any of the routes, it will always render above our main content.

让我们再次找到app/views/application/index.html ,并在<ui-view>上方的行上添加<nav-bar></nav-bar> <ui-view> 。 由于这与任何路线无关,因此它将始终在我们的主要内容之上呈现。

Go ahead and refresh your page now. Don’t you love it when things just work? Hopefully you don’t have any weird issues with an out of date bundle, version of Ruby, or something funky like that. Just remember, Google is your best friend.

继续并立即刷新页面。 当事情正常时,您不喜欢它吗? 希望您不会对过时的捆绑包,Ruby版本或类似的时髦东西没有任何奇怪的问题。 请记住,Google是您最好的朋友。

Anyhoo, I hope this has helped! Please leave any questions, comments, or suggestions below!

Anyhoo,希望对您有所帮助! 请在下面留下任何问题,评论或建议!

翻译自: https://www.sitepoint.com/setting-up-an-angular-spa-on-rails-with-devise-and-bootstrap/

devise tree使用

查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. Angular和.NET Core Web API入门应用程序

    下载源160.2 KB 您可以在此处查看此项目的源代码和最新更新 这是Angular/.NET Core Web API入门应用程序&#xff0c;具有添加、编辑和删除客户的基本功能&#xff0c;因此您可以将其用作构建应用程序的起点。它使用以下框架&#xff1a; Angular MaterialBootstrap.NET Core…...

    2024/4/23 20:26:03
  2. Spring Boot(九)Spring Boot中使用Bootstrap和AngularJS

    你好&#xff0c;【程序职场】专注于&#xff1a;Spring Boot &#xff0c;微服务 和 前端APP开发&#xff0c;闲暇之余一起聊聊职场规划&#xff0c;个人成长&#xff0c;还能带你一起探索 副业赚钱渠道&#xff0c;在提升技术的同时我们一起交流 敏捷流程 提高工作效率&#…...

    2024/5/5 13:35:51
  3. angular学习之路18-ngmodule

    1,NgModule简介 NgModules 用于配置注入器和编译器&#xff0c;并帮你把那些相关的东西组织在一起。 NgModule 是一个带有 NgModule 装饰器的类。 NgModule 的参数是一个元数据对象&#xff0c;用于描述如何编译组件的模板&#xff0c;以及如何在运行时创建注入器。 它会标出…...

    2024/4/23 5:39:17
  4. 后台管理UI的选择

    最近要做一个企业的OA系统&#xff0c;以前一直使用EasyUI&#xff0c;一切都好&#xff0c;但感觉有点土了&#xff0c;想换成现在流行的Bootstrap为基础的后台UI风格&#xff0c;想满足的条件应该达到如下几个&#xff1a;1、美观、大方、简洁 2、兼容IE8、不考虑兼容IE6/IE7…...

    2024/4/24 0:21:10
  5. Angular 7 和 .Net Core 2.2——全球天气(第1部分)

    目录 介绍 设置Angular CLI环境 先决条件 npm包管理器 从Visual Studio 2017创建Asp.Net核心Web项目 使用Angular CLI创建天气客户端 天气信息REST API 天气组件 Angular 路由 反应表单(Reactive Form) 在Angular App中使用Bootstrap 4样式 Angular 服务 Angular …...

    2024/4/30 18:06:41
  6. InputStreamWrite:字符流

    两种读取方法如下所示:package cn.zll.demo;import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader;public class WriteDemo {public static void main(String[] args) throws IOException {…...

    2024/4/26 21:23:55
  7. angular学习之路3-架构

    1&#xff0c; 架构概览 Angular 的基本构造块是 NgModule&#xff0c;它为组件提供了编译的上下文环境。 NgModule 会把相关的代码收集到一些功能集中。Angular 应用就是由一组 NgModule 定义出的。 应用至少会有一个用于引导应用的根模块&#xff0c;通常还会有很多特性模块…...

    2024/5/7 7:55:53
  8. angular学习记录

    1 angular项目文件解析 创建一个angular项目ng new demo&#xff0c;会比较慢&#xff0c;等等 组件可以理解为一段带有业务逻辑和数据的html 2 组件文件的解析 组件控制屏幕上被称为视图的一小片区域。组件通过一些由属性和方法组成 //从angular核心库导入Component装饰…...

    2024/4/23 6:14:35
  9. Angular学习笔记(第四天)

    一、Ionic的使用 1.概述&#xff1a; Ionic是基于angular的移动端的ui组件库&#xff1a; &#xff08;在后续的升级版本中&#xff0c;也在支持以cdn的方式&#xff0c;支持vue、react、js&#xff0c;但是这个新版本手册不够友好&#xff0c;还有些问题&#xff09; ionic…...

    2024/4/26 10:54:49
  10. angular2--下拉更新和上拉加载更多

    效果如下&#xff1a; &#xff08;1&#xff09;页面往下拉做刷新页面操作 &#xff08;2&#xff09;页面往上滑到底部时&#xff0c;加载更多数据## 标题 html <ons-page><ons-toolbar><div class"left"></div><div class"cen…...

    2024/4/26 10:50:52
  11. 【Angular 6】滚动列表组件的封装

    前言 学习应为input和output相结合之过程&#xff0c;这就是写这篇文章的原因。在大屏幕展示web APP中&#xff0c;经常会用到滚动列表。经过几次尝试&#xff0c;确定了一个还不错的思路。 需求 列表表头thead部分静止&#xff0c;而tbody部分向上滚动。tbody部分滚动结束之后…...

    2024/5/7 3:23:51
  12. 微服务的脚手架Jhipster集成angular和vue的使用

    JHipster简介 JHipster或者称Java Hipster&#xff0c;是一个应用代码产生器&#xff0c;能够创建Spring Boot AngularJS的应用。开源项目地址&#xff1a;JHipster/Github。  JHipster使用Node.js和Yeoman产生Java应用代码&#xff0c;使用Maven(Gradle)运行产生的代码&…...

    2024/4/21 3:13:21
  13. Angular-3种创建动态内容的方式

    写在最前&#xff0c;本文提到的“模板”都是ng-template&#xff1b;假设的模态组件也只是实现模态内容&#xff1b;为了缩减文章的篇幅&#xff0c;只保留了重要的部分。完整的例子在线上。在开发过程中&#xff0c;难免会遇到公共组件需要Input模板或input组件的时候&#x…...

    2024/4/21 3:13:21
  14. Angular:nz-table中显示横向滚动条

    首先&#xff0c;可以参考一下ant-design官方文档中对于横向滚动条的用法&#xff08;这里参考1.8.1版本的固定列方法&#xff09;&#xff1a; import { Component } from angular/core;Component({selector: nz-demo-table-fixed-columns,template: <nz-table #nzTable […...

    2024/5/6 19:36:36
  15. 原生、混合、react-native应用对比分析

    原生开发、纯网页开发&#xff08;H5开发&#xff09;/混合开发&#xff08;H5原生&#xff09;、React-Native开发 原生开发是系统自带的app开发方式&#xff0c;也是大部分人最熟悉app开发的技术&#xff0c;如android、ios、wp。H5开发是Html5开发的app&#xff0c;本质上运…...

    2024/5/3 8:21:18
  16. Angular2中echarts的使用(饼图)

    ECharts (以饼图为例) ECharts&#xff0c;一个使用 JavaScript 实现的开源可视化库&#xff0c;可以流畅的运行在 PC 和移动设备上&#xff0c;兼容当前绝大部分浏览&#xff08;IE8/9/10/11&#xff0c;Chrome&#xff0c;Firefox&#xff0c;Safari等&#xff09;&#xff…...

    2024/5/9 0:08:07
  17. Angular 8 从基础到项目实战 完整的Angular学习路径

    安装npm依赖包 推荐使用http npm i --registryhttp://registry.npmjs.org/ 关于跨域可以使用nginx代理,关于package.json可以执行npm start,npm build… "scripts": {"ng": "ng","start": "ng serve","start.prod&q…...

    2024/4/21 3:13:16
  18. angular锚点和返回顶部功能设计。

    angular锚点和返回顶部功能设计。 返回顶部代码 typescrtipt代码 // 返回到顶部按钮HostListener(window:scroll)checkScroll(): void{const scrollPosition window.pageYOffset ||document.documentElement.scrollTop || document.body.scrollTop || 0if (scrollPosition &…...

    2024/4/20 20:10:48
  19. Angular 实现Bootstrap ScrollSpy控件

    Bootstap是基于JQuery开发&#xff0c;Angular中不支持Bootstrap相关事件逻辑。本文基于Typecript开发了一个Angular可用的ScrollSpy控件。Scrollspy控件主要实现了左侧导航以及右侧正文之间的联动和切换。所以&#xff0c; 此组件主要解决两个问题&#xff1a; &#xff08;1&…...

    2024/5/9 18:17:33
  20. angular技巧_提升Angular技能的5个技巧

    angular技巧This summer me and Roman started a series of tweets with helpful tips and tricks about Angular. It was met well by the community so I decided to write an article follow-up. Here are 5 generalized advises I want to give to Angular developers acro…...

    2024/4/20 20:10:46

最新文章

  1. 大文件分块上传

    断点续传 断点续传需要为每个分块加md5值&#xff0c;如果用户取消上传&#xff0c;可以知道那些分块已经上传了 切块上传 只要校验整个文件的完整性就好 前端代码示例 <!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8&qu…...

    2024/5/10 5:14:48
  2. 梯度消失和梯度爆炸的一些处理方法

    在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言&#xff0c;在此感激不尽。 权重和梯度的更新公式如下&#xff1a; w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...

    2024/5/9 21:23:04
  3. cocos 数字滚动、数字过渡动画

    代码&#xff1a; //数字滚动 let sdk: any { a: start_score, } tween(sdk).to(1, { a: this.score }, { progress: (start, end, current, time) > { // this.lab.string Math.round(start (end - start) * time) ;//修改页面上的值 // console.log(修改ing, start (…...

    2024/5/4 6:23:29
  4. 【LeetCode热题100】【二叉树】二叉树的中序遍历

    题目链接&#xff1a;94. 二叉树的中序遍历 - 力扣&#xff08;LeetCode&#xff09; 中序遍历就是先遍历左子树再遍历根最后遍历右子树 class Solution { public:void traverse(TreeNode *root) {if (!root)return;traverse(root->left);ans.push_back(root->val);tra…...

    2024/5/5 8:39:08
  5. LeetCode-46. 全排列【数组 回溯】

    LeetCode-46. 全排列【数组 回溯】 题目描述&#xff1a;解题思路一&#xff1a;回溯。回溯三部曲解题思路二&#xff1a;0解题思路三&#xff1a;0 题目描述&#xff1a; 给定一个不含重复数字的数组 nums &#xff0c;返回其 所有可能的全排列 。你可以 按任意顺序 返回答案…...

    2024/5/9 17:36:54
  6. 【外汇早评】美通胀数据走低,美元调整

    原标题:【外汇早评】美通胀数据走低,美元调整昨日美国方面公布了新一期的核心PCE物价指数数据,同比增长1.6%,低于前值和预期值的1.7%,距离美联储的通胀目标2%继续走低,通胀压力较低,且此前美国一季度GDP初值中的消费部分下滑明显,因此市场对美联储后续更可能降息的政策…...

    2024/5/8 6:01:22
  7. 【原油贵金属周评】原油多头拥挤,价格调整

    原标题:【原油贵金属周评】原油多头拥挤,价格调整本周国际劳动节,我们喜迎四天假期,但是整个金融市场确实流动性充沛,大事频发,各个商品波动剧烈。美国方面,在本周四凌晨公布5月份的利率决议和新闻发布会,维持联邦基金利率在2.25%-2.50%不变,符合市场预期。同时美联储…...

    2024/5/9 15:10:32
  8. 【外汇周评】靓丽非农不及疲软通胀影响

    原标题:【外汇周评】靓丽非农不及疲软通胀影响在刚结束的周五,美国方面公布了新一期的非农就业数据,大幅好于前值和预期,新增就业重新回到20万以上。具体数据: 美国4月非农就业人口变动 26.3万人,预期 19万人,前值 19.6万人。 美国4月失业率 3.6%,预期 3.8%,前值 3…...

    2024/5/4 23:54:56
  9. 【原油贵金属早评】库存继续增加,油价收跌

    原标题:【原油贵金属早评】库存继续增加,油价收跌周三清晨公布美国当周API原油库存数据,上周原油库存增加281万桶至4.692亿桶,增幅超过预期的74.4万桶。且有消息人士称,沙特阿美据悉将于6月向亚洲炼油厂额外出售更多原油,印度炼油商预计将每日获得至多20万桶的额外原油供…...

    2024/5/9 4:20:59
  10. 【外汇早评】日本央行会议纪要不改日元强势

    原标题:【外汇早评】日本央行会议纪要不改日元强势近两日日元大幅走强与近期市场风险情绪上升,避险资金回流日元有关,也与前一段时间的美日贸易谈判给日本缓冲期,日本方面对汇率问题也避免继续贬值有关。虽然今日早间日本央行公布的利率会议纪要仍然是支持宽松政策,但这符…...

    2024/5/4 23:54:56
  11. 【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响

    原标题:【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响近日伊朗局势升温,导致市场担忧影响原油供给,油价试图反弹。此时OPEC表态稳定市场。据消息人士透露,沙特6月石油出口料将低于700万桶/日,沙特已经收到石油消费国提出的6月份扩大出口的“适度要求”,沙特将满…...

    2024/5/4 23:55:05
  12. 【外汇早评】美欲与伊朗重谈协议

    原标题:【外汇早评】美欲与伊朗重谈协议美国对伊朗的制裁遭到伊朗的抗议,昨日伊朗方面提出将部分退出伊核协议。而此行为又遭到欧洲方面对伊朗的谴责和警告,伊朗外长昨日回应称,欧洲国家履行它们的义务,伊核协议就能保证存续。据传闻伊朗的导弹已经对准了以色列和美国的航…...

    2024/5/4 23:54:56
  13. 【原油贵金属早评】波动率飙升,市场情绪动荡

    原标题:【原油贵金属早评】波动率飙升,市场情绪动荡因中美贸易谈判不安情绪影响,金融市场各资产品种出现明显的波动。随着美国与中方开启第十一轮谈判之际,美国按照既定计划向中国2000亿商品征收25%的关税,市场情绪有所平复,已经开始接受这一事实。虽然波动率-恐慌指数VI…...

    2024/5/7 11:36:39
  14. 【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试

    原标题:【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试美国和伊朗的局势继续升温,市场风险情绪上升,避险黄金有向上突破阻力的迹象。原油方面稍显平稳,近期美国和OPEC加大供给及市场需求回落的影响,伊朗局势并未推升油价走强。近期中美贸易谈判摩擦再度升级,美国对中…...

    2024/5/4 23:54:56
  15. 【原油贵金属早评】市场情绪继续恶化,黄金上破

    原标题:【原油贵金属早评】市场情绪继续恶化,黄金上破周初中国针对于美国加征关税的进行的反制措施引发市场情绪的大幅波动,人民币汇率出现大幅的贬值动能,金融市场受到非常明显的冲击。尤其是波动率起来之后,对于股市的表现尤其不安。隔夜美国股市出现明显的下行走势,这…...

    2024/5/6 1:40:42
  16. 【外汇早评】美伊僵持,风险情绪继续升温

    原标题:【外汇早评】美伊僵持,风险情绪继续升温昨日沙特两艘油轮再次发生爆炸事件,导致波斯湾局势进一步恶化,市场担忧美伊可能会出现摩擦生火,避险品种获得支撑,黄金和日元大幅走强。美指受中美贸易问题影响而在低位震荡。继5月12日,四艘商船在阿联酋领海附近的阿曼湾、…...

    2024/5/4 23:54:56
  17. 【原油贵金属早评】贸易冲突导致需求低迷,油价弱势

    原标题:【原油贵金属早评】贸易冲突导致需求低迷,油价弱势近日虽然伊朗局势升温,中东地区几起油船被袭击事件影响,但油价并未走高,而是出于调整结构中。由于市场预期局势失控的可能性较低,而中美贸易问题导致的全球经济衰退风险更大,需求会持续低迷,因此油价调整压力较…...

    2024/5/8 20:48:49
  18. 氧生福地 玩美北湖(上)——为时光守候两千年

    原标题:氧生福地 玩美北湖(上)——为时光守候两千年一次说走就走的旅行,只有一张高铁票的距离~ 所以,湖南郴州,我来了~ 从广州南站出发,一个半小时就到达郴州西站了。在动车上,同时改票的南风兄和我居然被分到了一个车厢,所以一路非常愉快地聊了过来。 挺好,最起…...

    2024/5/7 9:26:26
  19. 氧生福地 玩美北湖(中)——永春梯田里的美与鲜

    原标题:氧生福地 玩美北湖(中)——永春梯田里的美与鲜一觉醒来,因为大家太爱“美”照,在柳毅山庄去寻找龙女而错过了早餐时间。近十点,向导坏坏还是带着饥肠辘辘的我们去吃郴州最富有盛名的“鱼头粉”。说这是“十二分推荐”,到郴州必吃的美食之一。 哇塞!那个味美香甜…...

    2024/5/4 23:54:56
  20. 氧生福地 玩美北湖(下)——奔跑吧骚年!

    原标题:氧生福地 玩美北湖(下)——奔跑吧骚年!让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 啊……啊……啊 两…...

    2024/5/8 19:33:07
  21. 扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!

    原标题:扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!扒开伪装医用面膜,翻六倍价格宰客!当行业里的某一品项火爆了,就会有很多商家蹭热度,装逼忽悠,最近火爆朋友圈的医用面膜,被沾上了污点,到底怎么回事呢? “比普通面膜安全、效果好!痘痘、痘印、敏感肌都能用…...

    2024/5/5 8:13:33
  22. 「发现」铁皮石斛仙草之神奇功效用于医用面膜

    原标题:「发现」铁皮石斛仙草之神奇功效用于医用面膜丽彦妆铁皮石斛医用面膜|石斛多糖无菌修护补水贴19大优势: 1、铁皮石斛:自唐宋以来,一直被列为皇室贡品,铁皮石斛生于海拔1600米的悬崖峭壁之上,繁殖力差,产量极低,所以古代仅供皇室、贵族享用 2、铁皮石斛自古民间…...

    2024/5/8 20:38:49
  23. 丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者

    原标题:丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者【公司简介】 广州华彬企业隶属香港华彬集团有限公司,专注美业21年,其旗下品牌: 「圣茵美」私密荷尔蒙抗衰,产后修复 「圣仪轩」私密荷尔蒙抗衰,产后修复 「花茵莳」私密荷尔蒙抗衰,产后修复 「丽彦妆」专注医学护…...

    2024/5/4 23:54:58
  24. 广州械字号面膜生产厂家OEM/ODM4项须知!

    原标题:广州械字号面膜生产厂家OEM/ODM4项须知!广州械字号面膜生产厂家OEM/ODM流程及注意事项解读: 械字号医用面膜,其实在我国并没有严格的定义,通常我们说的医美面膜指的应该是一种「医用敷料」,也就是说,医用面膜其实算作「医疗器械」的一种,又称「医用冷敷贴」。 …...

    2024/5/9 7:32:17
  25. 械字号医用眼膜缓解用眼过度到底有无作用?

    原标题:械字号医用眼膜缓解用眼过度到底有无作用?医用眼膜/械字号眼膜/医用冷敷眼贴 凝胶层为亲水高分子材料,含70%以上的水分。体表皮肤温度传导到本产品的凝胶层,热量被凝胶内水分子吸收,通过水分的蒸发带走大量的热量,可迅速地降低体表皮肤局部温度,减轻局部皮肤的灼…...

    2024/5/9 17:11:10
  26. 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...

    解析如下&#xff1a;1、长按电脑电源键直至关机&#xff0c;然后再按一次电源健重启电脑&#xff0c;按F8健进入安全模式2、安全模式下进入Windows系统桌面后&#xff0c;按住“winR”打开运行窗口&#xff0c;输入“services.msc”打开服务设置3、在服务界面&#xff0c;选中…...

    2022/11/19 21:17:18
  27. 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。

    %读入6幅图像&#xff08;每一幅图像的大小是564*564&#xff09; f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...

    2022/11/19 21:17:16
  28. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

    win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面&#xff0c;在等待界面中我们需要等待操作结束才能关机&#xff0c;虽然这比较麻烦&#xff0c;但是对系统进行配置和升级…...

    2022/11/19 21:17:15
  29. 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...

    有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows&#xff0c;请勿关闭计算机”的提示&#xff0c;要过很久才能进入系统&#xff0c;有的用户甚至几个小时也无法进入&#xff0c;下面就教大家这个问题的解决方法。第一种方法&#xff1a;我们首先在左下角的“开始…...

    2022/11/19 21:17:14
  30. win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...

    置信有很多用户都跟小编一样遇到过这样的问题&#xff0c;电脑时发现开机屏幕显现“正在配置Windows Update&#xff0c;请勿关机”(如下图所示)&#xff0c;而且还需求等大约5分钟才干进入系统。这是怎样回事呢&#xff1f;一切都是正常操作的&#xff0c;为什么开时机呈现“正…...

    2022/11/19 21:17:13
  31. 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...

    Win7系统开机启动时总是出现“配置Windows请勿关机”的提示&#xff0c;没过几秒后电脑自动重启&#xff0c;每次开机都这样无法进入系统&#xff0c;此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一&#xff1a;开机按下F8&#xff0c;在出现的Windows高级启动选…...

    2022/11/19 21:17:12
  32. 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...

    有不少windows10系统用户反映说碰到这样一个情况&#xff0c;就是电脑提示正在准备windows请勿关闭计算机&#xff0c;碰到这样的问题该怎么解决呢&#xff0c;现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法&#xff1a;1、2、依次…...

    2022/11/19 21:17:11
  33. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...

    今天和大家分享一下win7系统重装了Win7旗舰版系统后&#xff0c;每次关机的时候桌面上都会显示一个“配置Windows Update的界面&#xff0c;提示请勿关闭计算机”&#xff0c;每次停留好几分钟才能正常关机&#xff0c;导致什么情况引起的呢&#xff1f;出现配置Windows Update…...

    2022/11/19 21:17:10
  34. 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...

    只能是等着&#xff0c;别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚&#xff0c;只能是考虑备份数据后重装系统了。解决来方案一&#xff1a;管理员运行cmd&#xff1a;net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...

    2022/11/19 21:17:09
  35. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

    原标题&#xff1a;电脑提示“配置Windows Update请勿关闭计算机”怎么办&#xff1f;win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢&#xff1f;一般的方…...

    2022/11/19 21:17:08
  36. 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...

    关机提示 windows7 正在配置windows 请勿关闭计算机 &#xff0c;然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;关机提示 windows7 正在配…...

    2022/11/19 21:17:05
  37. 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...

    钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...

    2022/11/19 21:17:05
  38. 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...

    前几天班里有位学生电脑(windows 7系统)出问题了&#xff0c;具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面&#xff0c;长时间没反应&#xff0c;无法进入系统。这个问题原来帮其他同学也解决过&#xff0c;网上搜了不少资料&#x…...

    2022/11/19 21:17:04
  39. 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...

    本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法&#xff0c;并在最后教给你1种保护系统安全的好方法&#xff0c;一起来看看&#xff01;电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中&#xff0c;添加了1个新功能在“磁…...

    2022/11/19 21:17:03
  40. 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...

    许多用户在长期不使用电脑的时候&#xff0c;开启电脑发现电脑显示&#xff1a;配置windows更新失败&#xff0c;正在还原更改&#xff0c;请勿关闭计算机。。.这要怎么办呢&#xff1f;下面小编就带着大家一起看看吧&#xff01;如果能够正常进入系统&#xff0c;建议您暂时移…...

    2022/11/19 21:17:02
  41. 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...

    配置windows update失败 还原更改 请勿关闭计算机&#xff0c;电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;配置windows update失败 还原更改 请勿关闭计算机&#x…...

    2022/11/19 21:17:01
  42. 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...

    不知道大家有没有遇到过这样的一个问题&#xff0c;就是我们的win7系统在关机的时候&#xff0c;总是喜欢显示“准备配置windows&#xff0c;请勿关机”这样的一个页面&#xff0c;没有什么大碍&#xff0c;但是如果一直等着的话就要两个小时甚至更久都关不了机&#xff0c;非常…...

    2022/11/19 21:17:00
  43. 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...

    当电脑出现正在准备配置windows请勿关闭计算机时&#xff0c;一般是您正对windows进行升级&#xff0c;但是这个要是长时间没有反应&#xff0c;我们不能再傻等下去了。可能是电脑出了别的问题了&#xff0c;来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...

    2022/11/19 21:16:59
  44. 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...

    我们使用电脑的过程中有时会遇到这种情况&#xff0c;当我们打开电脑之后&#xff0c;发现一直停留在一个界面&#xff1a;“配置Windows Update失败&#xff0c;还原更改请勿关闭计算机”&#xff0c;等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢&#xff0…...

    2022/11/19 21:16:58
  45. 如何在iPhone上关闭“请勿打扰”

    Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...

    2022/11/19 21:16:57