angular 服务器渲染

Server-side rendering is a headache and if you ever worked with Angular 1, you should be worried about how Angular 2 plans to handle it. Server-side rendering in Angular 2 is often-times also called Universal.

服务器端渲染令人头疼,如果您曾经使用过Angular 1,则应该担心Angular 2计划如何处理它。 Angular 2中的服务器端渲染通常也称为Universal

You might often hear people say stuff like: "I am building an app that will be universal". What does that even mean?

您可能经常听到人们说诸如此类的话:“我正在构建一个通用的应用程序”。 那有什么意思?

什么是通用? ( What is Universal? )

When we build apps, we consider the following elements:

在构建应用程序时,我们考虑以下要素:

  1. Content

    内容
  2. Style

    样式
  3. State

By default, front end frameworks have virtual DOM so when a hard request is made to an app built with such frameworks (like Angular), the expected behavior is weird. The request is served with a response of just the HTML content found at the entry point of the app while the main app content is lost.

默认情况下,前端框架具有虚拟DOM,因此当对使用此类框架(例如Angular)构建的应用发出硬性请求时,预期的行为很奇怪。 该请求仅包含在应用程序入口点找到HTML 内容的响应,而主要应用程序内容丢失。

This is not a problem to your users because your app virtually has content, styles, and state. Where the problem kicks in is with web crawlers that index your site for SEO sake. They get served with the incomplete HTML content which is very useless to them. This behavior even gets more painful when you expect people to share your app's link and you see an image like the one below when they do:

这对您的用户来说不是问题,因为您的应用程序实际上具有内容样式状态 。 问题出在哪里是Web搜寻器,这些搜索器为SEO索引了您的网站。 他们得到了不完整HTML 内容 ,这对他们来说是毫无用处的。 当您期望人们共享应用程序的链接并且当他们看到以下图像时,这种行为会变得更加痛苦:

Angular 2 Server-Side Rendering Preview

In Angular 1, if you tried to bind the app's title and description values using $rootScope you end up disappointed at how crawlers and social media robots see your site.

在Angular 1中,如果您尝试使用$rootScope绑定应用程序的标题和描述值,您最终会对爬虫和社交媒体机器人看到您的网站感到失望。

To replicate this challenge in Angular 2, I built an Angular 2 app with three routes (home, about and contact):

为了在Angular 2中重现这一挑战,我构建了一个Angular 2应用,其中包含以下三种路线(家庭,关于和联系):

Angular 2 Server-Side Rendering Preview

Preview

预习

Angular 2 Server-Side Rendering Source

Source

资源

<!-- 
This all you get as content 
without server rendering
-->
<app-root>Loading...</app-root>

The conventional server rendering solution has saved us for years with Angular 1 by provisioning web crawlers with our actual content. That seemed to keep us happy but we were missing one thing -- state.

常规的服务器渲染解决方案通过为Web爬网程序提供实际内容为Angular 1节省了我们很多年。 那似乎使我们快乐,但是我们却错过了一件事- 状态

The Universal idea is to build an app that does not just render to server but also runs on the server. Running in the sense that our state, content and styles are intact on the client and the server as well. In Angular 2, this is achieved with the help of Angular Universal which loads our app on the server first, and then drops it to the browser once ready.

通用想法是构建一个不仅可以呈现到服务器而且可以在服务器上运行的应用程序。 从某种意义上说,我们的状态,内容和样式在客户端和服务器上都是完整的。 在Angular 2中,这是通过Angular Universal的帮助实现的,它将首先将我们的应用程序加载到服务器上,然后在准备好后将其放到浏览器中。

什么是Angular Universal? ( What is Angular Universal? )

Angular 2 Universal

Angular Universal is the library the awesome Angular team is working on to make building universal apps a smooth experience. The library fixes a lot of nightmare we had working with Angular 1. As a matter of fact, our worst nightmare in Angular 1 is what Angular Universal takes away in Angular 2:

Angular Universal是令人敬畏的Angular团队正在努力的图书馆,旨在使构建通用应用程序具有流畅的体验。 该库解决了我们使用Angular 1时遇到的许多噩梦。事实上,我们在Angular 1中最糟糕的噩梦是Angular Universal在Angular 2中所消除的。

SEO友好 (SEO Friendly)

Angular Universal helps you to serve your app content to the server just as you did on the browser. When a web crawlers visit, they will be able to index you website's full content that can be used on search engines. This thereby solves one of the most popular front end challenges when working with JavaScript frameworks that create virtual DOM.

Angular Universal可以像在浏览器中一样帮助您将应用程序内容提供给服务器。 当网络爬虫访问时,他们将能够索引您网站上可在搜索引擎上使用的全部内容。 因此,这可以解决使用创建虚拟DOMJavaScript框架时最受欢迎的前端挑战之一。

社交媒体友好 (Social Media Friendly)

With Angular Universal serving your sever with browser content, social media platforms that display brief information about your website when a link is added can get access to the needed details.

Angular Universal通过浏览器内容为您的服务器提供服务,添加链接后显示有关您的网站的简要信息的社交媒体平台可以访问所需的详细信息。

预渲染 (Pre-rendering)

This is the most bind-blowing feature offered by Angular Universal. Angular Universal renders both your content and state as well as registering events on the server. The implication is that when your app boots, the server would serve the server-rendered content and a user can make use of the app at that stage.

这是Angular Universal提供的最具约束力的功能。 Angular Universal可以渲染您的内容和状态,以及在服务器上注册事件。 含义是,当您的应用启动时,服务器将提供服务器渲染的内容,并且用户可以在该阶段使用该应用。

The user's activities are recorded (with Preboot.js) at this stage and after couple of seconds when Angular is ready with the real thing, the user is automatically switched and those events replayed. The user won't even catch a glimpse of what is happening under the hood.

在此阶段(使用Preboot.js )记录用户的活动,并在Angular准备好真实事物后几秒钟后,将自动切换用户并重播这些事件。 用户甚至不会瞥见引擎盖下正在发生的事情。

入门 ( Getting Started )

Now that we have seen what Universal and Angular Universal are, how do we join the party? Angular Universal is coming to Angular CLI real soon but before that we have projects to build now.

现在我们已经了解了什么是Universal和Angular Universal,我们如何加入该党? Angular Universal即将正式投入Angular CLI的使用,但是在此之前,我们现在要构建项目。

通用入门项目 (Universal Starter Project)

Patrick built an awesome starter for Angular Universal apps which we are going to clone so as to test out these awesome tool.

Patrick为Angular Universal应用程序构建了一个很棒的启动器 ,我们将对其进行克隆,以测试这些出色的工具。

# Clone repo
git clone https://github.com/angular/universal-starter scotchiversal#Install modules
cd scotchiversal & npm i

If you have been building Angular 2 app lately, you will see that the directory looks much alike to what we are used to. The key difference is the bootstrapping process. Bootstrapping Universal apps are done with a different library and in two different files (client.ts & server.ts).

如果您最近一直在构建Angular 2应用程序,则将看到该目录与我们以前使用的目录非常相似。 关键区别在于引导过程。 引导通用应用程序是通过不同的库和两个不同的文件( client.tsserver.ts )完成的。

Furthermore, we usually make use of platformBrowserDynamic to bootstrap but for Universal, we use platformUniversalLibrary from the Angular Universal library:

此外,我们通常使用platformBrowserDynamic进行引导,但对于Universal,我们使用Angular Universal库中的platformUniversalLibrary

// ./src/client.ts
// the polyfills must be the first thing imported
import 'angular2-universal-polyfills';// Angular 2
import { enableProdMode } from '@angular/core';
import { platformUniversalDynamic } from 'angular2-universal/browser';
import { bootloader } from '@angularclass/bootloader';import { MainModule } from './browser.module';export const platformRef = platformUniversalDynamic();export function main() {return platformRef.bootstrapModule(MainModule);
}
// Bootstrap
bootloader(main);

The bootloader function just checks that the DOM is ready before bootstrapping Angular 2.

bootloader功能仅在引导Angular 2之前检查DOM是否准备就绪。

The above logic is what we are used to but this time we are making use if platformUniversalDynamic to bootstrap. The module we are bootstrapping is imported from ./src/browser.module.ts:

上面的逻辑是我们习惯的,但是这次我们要使用如果platformUniversalDynamic进行引导。 我们正在引导的模块是从./src/browser.module.ts导入的:

// ./src/browser.module.ts
import { NgModule } from '@angular/core';
import { UniversalModule } from 'angular2-universal/browser';@NgModule({...imports: [// Import this firstUniversalModule,...]
})
export class MainModule {}

Same old module that we are comfortable with. We also import the UniversalModule which must be imported before every other imports.

我们满意的旧模块。 我们还导入了UniversalModule ,必须在其他所有导入之前先将其导入。

The two files we just looked at handles browser rendering, so let's look at server.ts and it's accompanying module for server rendering:

我们刚刚看过的两个文件处理浏览器渲染,因此让我们看一下server.ts及其随附的服务器渲染模块:

// ./src/server.ts
import 'angular2-universal-polyfills';import * as path from 'path';
import * as express from 'express';
import * as bodyParser from 'body-parser';
import * as cookieParser from 'cookie-parser';
import * as morgan from 'morgan';
import * as compression from 'compression';// Angular 2
import { enableProdMode } from '@angular/core';
// Angular 2 Universal
import { createEngine } from 'angular2-express-engine';// App
import { MainModule } from './node.module';// enable prod for faster renders
enableProdMode();const app = express();
const ROOT = path.join(path.resolve(__dirname, '..'));// Express View
app.engine('.html', createEngine({ngModule: MainModule,providers: [// You can include static providers like the Title service here]
}));
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname);
app.set('view engine', 'html');
app.set('json spaces', 2);app.use(cookieParser('Angular 2 Universal'));
app.use(bodyParser.json());
app.use(compression());app.use(morgan('dev'));function cacheControl(req, res, next) {// instruct browser to revalidate in 60 secondsres.header('Cache-Control', 'max-age=60');next();
}
// Serve static files
app.use('/assets', cacheControl, express.static(path.join(__dirname, 'assets'), {maxAge: 30}));
app.use(cacheControl, express.static(path.join(ROOT, 'dist/client'), {index: false}));function ngApp(req, res) {res.render('index', {req,res,preboot: false, // turn on if using prebootbaseUrl: '/',requestUrl: req.originalUrl,originUrl: `http://localhost:${ app.get('port') }`});
}
// Our page routes
export const routes: string[] = ['about','home','contact'
];
app.get('/', ngApp);
routes.forEach(route => {app.get(`/${route}`, ngApp);// Route patternapp.get(`/${route}/*`, ngApp);
});app.get('*', function(req, res) {res.setHeader('Content-Type', 'application/json');var pojo = { status: 404, message: 'No Content' };var json = JSON.stringify(pojo, null, 2);res.status(404).send(json);
});// Server
let server = app.listen(app.get('port'), () => {console.log(`Listening on: http://localhost:${server.address().port}`);
});

Universal is supported in Node and ASP.Net but coming to other backend platforms soon. We are using Node and to be precise to express server. The server uses the createEngine method to create a view engine that will deliver our Angular app content. The routes for each of the pages we need to render are handled as well. The rest of the code preps the express server.

Node和ASP.Net支持Universal,但很快将用于其他后端平台。 我们正在使用Node并精确地express服务器。 服务器使用createEngine方法创建一个视图引擎,该引擎将交付我们的Angular应用程序内容。 我们也需要处理每个页面的路由。 其余代码为express服务器做准备。

MainModule is imported here too and used to render our views:

MainModule这里导入,并用于呈现我们的视图:

// ./src/node.module.ts
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { UniversalModule } from 'angular2-universal/node';@NgModule({imports: [UniversalModule,FormsModule,RouterModule,...],...
})
export class MainModule {}

定制组件 (Custom Components)

Every other thing in the app anatomy can now be all about your custom logic. Let's create our page components:

现在,应用程序剖析中的所有其他内容都可以与您的自定义逻辑有关。 让我们创建页面组件:

Home Component

家庭组件

// ./src/app/home/home.component.ts
import { Component } from '@angular/core';@Component({selector: 'app-home',templateUrl: './home.component.html',styleUrls: ['./home.component.css']
})
export class HomeComponent {}

Home Template

主页模板

<!-- ./src/app/home/home.component.html -->
<div class="jumbotron"><h2 class="text-center">Home</h2>
</div>
<div class="container"><p>. . . </p><p>. . . </p><div class="panel panel-default"><div class="panel-heading">Panel heading without title</div><div class="panel-body">Panel content</div></div>
</div>

Same idea applies to about and contact component so you can have fun by creating those ones yourself.

aboutcontact组件也有相同的想法,因此您可以自己创建一个组件,从而获得乐趣。

路由 (Routing)

We can now create the 3 routes we specified in the server file:

现在,我们可以创建在服务器文件中指定的3条路由:

// ./src/app/app-routing.module.ts
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';import { HomeComponent } from './home/home.component';
import { AboutComponent } from './about/about.component';
import { ContactComponent } from './contact/contact.component';@NgModule({imports: [RouterModule.forChild([{ path: '', redirectTo: '/home', pathMatch: 'full' },{ path: 'home', component: HomeComponent },{ path: 'about', component: AboutComponent },{ path: 'contact', component: ContactComponent }])],
})
export class AppRoutingModule { }

The routes should be imported into our app module before it can work:

路线应先导入到我们的应用模块中,然后才能起作用:

// ./src/app/app.module.ts
import { NgModule } from '@angular/core';import { HomeComponent } from './home/home.component';
import { AboutComponent } from './about/about.component';
import { ContactComponent } from './contact/contact.component';import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';@NgModule({declarations: [ AppComponent, HomeComponent,AboutComponent,ContactComponent ],imports: [SharedModule,AppRoutingModule]
})
export class AppModule {}

Remember to specify the outlet for the route as well (it is easy to forget):

记住还要指定路线的出口(很容易忘记):

<!-- ./src/app/app.component.html -->
<nav class="navbar navbar-default"><div class="container-fluid"><div class="navbar-header"><a class="navbar-brand" href="#">Scotchiversal</a></div><div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"><ul class="nav navbar-nav"><!-- Links --><li><a [routerLink]="['home']">Home</a></li><li><a [routerLink]="['about']">About</a></li><li><a [routerLink]="['contact']">Contact</a></li></ul></div></div>
</nav>
<div><!-- Outlet --><router-outlet></router-outlet>
</div>

You can run the app with:

您可以通过以下方式运行该应用程序:

npm start

Angular 2 Server-side Rendering Progress

Preview

预习

Angular 2 Server-side Rendering Progress

Source

资源

You can see the difference in the server-served content. It clearly represents the Contact page with the form and button.

您可以看到服务器提供的内容的差异。 它使用表单和按钮清楚地表示“联系人”页面。

远离DOM ( Stay Away From The DOM )

The power of Universal comes from the fact that Angular abstracts DOM rendering. This is what makes Angular support for multi-platform possible. If you want Universal to keep working as expected, the you have to stay away from the DOM.

Universal的功能来自Angular抽象DOM渲染的事实。 这就是使Angular支持多平台成为可能的原因。 如果要让Universal保持预期的工作状态,则必须远离DOM。

This does not mean that you cannot perform DOM operations but do not do that with the native solutions (document.domMethod() or $('dom-element')).

这并不意味着您不能执行DOM操作,但不能使用本机解决方案( document.domMethod()$('dom-element') )来执行。

Angular provides us a better way to perform DOM operations safely. See ElementRef, Renderer and ViewContainer APIs for more details.

Angular为我们提供了更好的安全执行DOM操作的方法。 有关更多详细信息,请参见ElementRef , Renderer和ViewContainer API。

Thank you!

谢谢!

翻译自: https://scotch.io/tutorials/server-side-rendering-in-angular-2-with-angular-universal

angular 服务器渲染

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

相关文章

  1. Angular2-关闭占用的4200端口

    1.打开cmd 》 cd c:\Windows\System32 》c:\Windows\System32>netstat -ano | findstr :4200 TCP 127.0.0.1:4200 0.0.0.0:0 LISTENING 10188 》c:\Windows\System32>TaskKill.exe /F /PID 10188 关闭10188进程&#xff0c;相当于已经停用…...

    2024/4/28 4:00:29
  2. angular常用功能

    1、angular的强大的表单验证 &#xff08;1&#xff09;、表单必须有form标签&#xff0c;并且form标签上必须有一个name属性 &#xff08;2&#xff09;、form中不能有action属性。提交交由ng-submit处理 &#xff08;3&#xff09;、input标签一定要有ng-model以及name属性…...

    2024/4/21 4:14:59
  3. Angular8 ☆ 常用的Angular-Cli命令

    一、常用的angular-cli命令 Angular前端开发的时候&#xff0c;首先安装node.js&#xff0c;安装好之后就可以使用npm命令安装Angular-cli&#xff0c;这是一个用于操作angular框架快速生成项目&#xff0c;模块&#xff0c;组件等的便捷的客户端。 安装命令&#xff1a;npm …...

    2024/4/21 4:14:58
  4. angular常用命令

    创建项目 ng new angular-tour-of-heroes 创建服务 ng g service services/menus按照惯例&#xff0c;这个模块类的名字叫做 APPRoutingModule&#xff0c;并且位于 src/app 下的 app-routing.module.ts 文件中 ng generate module app-routing --flat --moduleapp --flat 把这…...

    2024/4/28 16:11:57
  5. angular2+ 常用链接

    Angular4 路由守卫 https://www.cnblogs.com/leijing0607/p/8075324.html使用Angular CLI生成路由 https://www.cnblogs.com/cgzl/p/8611532.htmlangular2 学习笔记 ( Router 路由 )https://www.cnblogs.com/keatkeat/p/5810987.html...

    2024/4/20 15:52:30
  6. angular中常用知识点整理

    1、angular.forEach循环 angular.forEach循环中常常会遇到一个问题&#xff1a;循环过程中如何跳出该循环&#xff1f;在JavaScript的for循环中&#xff0c;我们常常会用break或者用return结束循环&#xff0c;但是&#xff0c;在angular.forEach中&#xff0c;break和return根…...

    2024/4/20 19:52:36
  7. Angular 常用概念

    1.模块与装饰器 Angular设计目标就是适应大型应用的开发&#xff0c;模块的概念就是来组织不同的组件及服务。一个大型应用的最终形态就是各种不同的模块的组合 import { NgModule } from angular/core; import { BrowserModule } from angular/platform-browser; import …...

    2024/4/20 19:52:34
  8. Angular 创建常用命令

    ng generate component example 生成组件带有模版 ng generate component example -it 生成内联模版&#xff08;不会单独生成html文件&#xff09; ng generate directive my-directive - 生成一个新指令 ng generate pipe my-pipe - 生成一个新管道 ng generate service …...

    2024/4/20 19:52:33
  9. Angular常用的一些资源

    2019独角兽企业重金招聘Python工程师标准>>> github上有很多新手项目&#xff0c;angular团队自己也编写了很多入门级的东西。但是这些项目里面&#xff0c;有很多配置文件不太正确&#xff0c;导致很多人下来之后跑不起来&#xff0c;我整理了一些&#xff0c;代码…...

    2024/4/20 19:52:33
  10. angular router常用配置

    Angular’s Routeconst routes: Routes [{// 来源管理 一览path: sourceList,component: SourceListComponent},{// 推广二维码 一览path: qrcodeList,component: QrcodeListComponent,},{// 推广二维码 新建/编辑path: qrcodeEdit,component: QrcodeEditComponent,},{// 推广…...

    2024/4/20 19:52:32
  11. Angular 常用命令行

    1. ng -v 查看angular-cli是否安装成功、angular-cli的版本号 2. ng new 项目名称 新建angular项目 3. ng g class 类名 动态生成类文件&#xff1b; 4. ng g i 接口名 动态生成接口文件&#xff1b; 5. ng g c 组件名 动态生成组件&#xff0c;并把这个组件导入module中&#…...

    2024/4/20 19:52:32
  12. angular常用内置指令

    angular常用指令 指令名称描述ng-app用来定义模块的作用范围ng-controller用来定义控制器的作用范围ng-repeat循环遍历数组ng-bind绑定数据 同{{}}ng-show用来显示或隐藏元素 值为true / false &#xff0c;原理是设置元素的displayng-hide用来显示或隐藏元素 值为true / fals…...

    2024/4/27 20:30:28
  13. angular项目常用工具总结

    服务端渲染 https://angular.cn/guide/universalhttps://www.cnblogs.com/sgciviolence/p/6961287.htmlhttps://www.jianshu.com/p/40be228a5ec6https://segmentfault.com/a/1190000019411795 插件 富文本编辑器 http://www.html580.com/12414动画库&#xff1a;animate.css…...

    2024/4/21 4:14:57
  14. Angular中常用内置管道

    自定义管道详见官方文档 Angular官方文档&#xff08;管道使用详细说明&#xff09; Angular官方API参考手册 1. DatePipe&#xff1a;根据本地环境中的规则格式化日期值。2. UpperCasePipe&#xff1a;把文本全部转换成大写。3. LowerCasePipe &#xff1a;把文本全部转换成小…...

    2024/4/21 4:14:55
  15. angular一些常用的方法:

    angular.copy(); 用法&#xff1a;对Object对象的深度拷贝$scope.data {name:yanjinyun,age:11};$scope.origData angular.copy($scope.data); angular.fromJson() var json {"name":"liSi", "password":"321"}; var jsonArr [{&…...

    2024/4/21 4:14:54
  16. angular环境搭建及常用命令

    angular环境搭建 一、angular程序架构 1.组件&#xff08;angular应用基本构建块&#xff09;组件之间可以互相嵌套。 2.指令&#xff08;允许向html元素添加自定义行为&#xff09;。 3.模块&#xff08;将应用中不同部分组织成angular框架可以理解的单元&#xff09;。 4.服…...

    2024/4/24 13:05:13
  17. angular4 常用代码

    父组件给子组件传值 首先 在子组件中引入 Input() childVaule&#xff08;子组件使用的数据&#xff09;然后 在父组件中引入组件 <app-somthing [childValue]“fatherValue”></app-something> fatherValue&#xff08;父组件要给子组件传的值&#xff09;&#…...

    2024/4/21 4:14:53
  18. Angular 常用拦截器

    Http拦截器就是拦截发出的请求&#xff0c;对其进行统一添加额外处理&#xff0c;然后放行&#xff1b;对响应进行拦截并作出业务上的判断&#xff0c;决定是否给与返回。常见拦截器 AuthInterceptor 自定义请求头&#xff0c;如 token 之类...

    2024/4/21 4:14:51
  19. angular-cli常用命令

    ng 8 add 将对外部库的支持添加到项目中。 build在给定的输出路径上将Angular应用程序编译到名为dist/的输出目录中。必须从工作区目录中执行。 generate g 根据原理图生成和/或修改文件。 new n 创建新工作区和初始Angular应用程序。 serve s 构建并提供应用程序&#xf…...

    2024/4/21 4:14:50
  20. angular--$watch监视用法

    $watch()函数&#xff0c;用于监视模型数据的变化。$watch(参数1,参数2,参数3)参数1&#xff1a;监视的对象参数2&#xff1a;监视数据改变执行的函数参数3&#xff1a;[可选]&#xff0c;布尔值-默认为fasle&#xff1a;不监视对象深沉属性&#xff0c;true&#xff1a;监视对…...

    2024/4/21 4:14:49

最新文章

  1. 怎么解决需要在国外网站上传文件打开和上传速度慢的问题。

    随着全球化的深入发展&#xff0c;企业面临的挑战之一是在国际环境中保持高效的数据传输和通信。上传文件至国外网站时&#xff0c;传统的互联网连接方式往往无法满足企业对于速度和稳定性的需求&#xff0c;这不仅拖慢了工作进度&#xff0c;还可能影响企业间的即时沟通&#…...

    2024/4/28 17:48:08
  2. 梯度消失和梯度爆炸的一些处理方法

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

    2024/3/20 10:50:27
  3. Git 自定义命令

    前言 在使用 hexo 搭建个人博客时&#xff0c;共两种部署的方法。分别为&#xff1a; 本地利用 hexo 的插件 hexo-deployer-git 来实现部署&#xff0c;缺点是需要多敲几个命令行且不方便对源码进行云端备份使用 Github Action 的 workflow 自动化部署&#xff0c;优势就是可…...

    2024/4/27 8:45:21
  4. 开启 Keep-Alive 可能会导致http 请求偶发失败

    大家好&#xff0c;我是蓝胖子&#xff0c;说起提高http的传输效率&#xff0c;很多人会开启http的Keep-Alive选项&#xff0c;这会http请求能够复用tcp连接&#xff0c;节省了握手的开销。但开启Keep-Alive真的没有问题吗&#xff1f;我们来细细分析下。 最大空闲时间造成请求…...

    2024/4/23 4:15:19
  5. 权限提升-Linux系统权限提升篇VulnhubRbash绕过DockerLXD容器History泄漏shell交互

    知识点 1、普通用户到Linux-泄漏-History 2、普通用户到Linux-限制-Rbash绕过 3、普通用户到Linux-容器-LXD&Docker 4.Linux系统提权-web/普通用户-docker逃逸&提权&shell交互 章节点&#xff1a; 1、Web权限提升及转移 2、系统权限提升及转移 3、宿主权限提升及…...

    2024/4/26 12:45:26
  6. 【外汇早评】美通胀数据走低,美元调整

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

    2024/4/28 13:52:11
  7. 【原油贵金属周评】原油多头拥挤,价格调整

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

    2024/4/28 3:28:32
  8. 【外汇周评】靓丽非农不及疲软通胀影响

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

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

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

    2024/4/28 13:51:37
  10. 【外汇早评】日本央行会议纪要不改日元强势

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

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

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

    2024/4/27 14:22:49
  12. 【外汇早评】美欲与伊朗重谈协议

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

    2024/4/28 1:28:33
  13. 【原油贵金属早评】波动率飙升,市场情绪动荡

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

    2024/4/28 15:57:13
  14. 【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试

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

    2024/4/27 17:59:30
  15. 【原油贵金属早评】市场情绪继续恶化,黄金上破

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

    2024/4/25 18:39:16
  16. 【外汇早评】美伊僵持,风险情绪继续升温

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

    2024/4/28 1:34:08
  17. 【原油贵金属早评】贸易冲突导致需求低迷,油价弱势

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

    2024/4/26 19:03:37
  18. 氧生福地 玩美北湖(上)——为时光守候两千年

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

    2024/4/28 1:22:35
  19. 氧生福地 玩美北湖(中)——永春梯田里的美与鲜

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

    2024/4/25 18:39:14
  20. 氧生福地 玩美北湖(下)——奔跑吧骚年!

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

    2024/4/26 23:04:58
  21. 扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!

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

    2024/4/27 23:24:42
  22. 「发现」铁皮石斛仙草之神奇功效用于医用面膜

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

    2024/4/28 5:48:52
  23. 丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者

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

    2024/4/26 19:46:12
  24. 广州械字号面膜生产厂家OEM/ODM4项须知!

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

    2024/4/27 11:43:08
  25. 械字号医用眼膜缓解用眼过度到底有无作用?

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

    2024/4/27 8:32:30
  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