Node.js VM模块

举报
福州司马懿 发表于 2021/11/19 04:56:36 2021/11/19
【摘要】 Executing JavaScript Class: vm.Script new vm.Script(code, options)script.runInContext(contex...
  • Executing JavaScript
    • Class: vm.Script
      • new vm.Script(code, options)
      • script.runInContext(contextifiedSandbox[, options])
      • script.runInNewContext([sandbox][, options])
      • script.runInThisContext([options])
    • vm.createContext([sandbox])
    • vm.isContext(sandbox)
    • vm.runInContext(code, contextifiedSandbox[, options])
    • vm.runInDebugContext(code)
    • vm.runInNewContext(code[, sandbox][, options])
    • vm.runInThisContext(code[, options])
    • Example: Running an HTTP Server within a VM
    • What does it mean to “contextify” an object?

Executing JavaScript

执行JavaScript

The vm module provides APIs for compiling and running code within V8 Virtual Machine contexts. It can be accessed using:
vm模块在V8虚拟机上下文中提供了编译和运行代码的API。它可以通过如下方式访问:

const vm = require('vm')
  
 
  • 1

JavaScript code can be compiled and run immediately or compiled, saved, and run later.

JavaScript代码可以被编译然后立即运行,或者编译,保存,并且之后运行。

Class: vm.Script

Added in:
Instances of the vm.Script class contain precompiled scripts that can be executed in specific sandboxes (or “contexts”).

vm.Script类的实例包含的预编译脚本可以在沙箱中被执行(或者上下文环境中)。

new vm.Script(code, options)

Added in: v0.3.1

  • code <string> The JavaScript code to compile.
  • options
    • filename <string> Specifies the filename used in stack traces produced by this script.
    • lineOffset <number> Specifies the line number offset that is displayed in stack traces produced by this script.
    • columnOffset <number> Specifies the column number offset that is displayed in stack traces produced by this script.
    • displayErrors <boolean> When true, if an Error error occurs while compiling the code, the line of code causing the error is attached to the stack trace.
    • timeout <number> Specifies the number of milliseconds to execute code before terminating execution. If execution is terminated, an Error will be thrown.
    • cachedData <Buffer> Provides an optional Buffer with V8’s code cache data for the supplied source. When supplied, the cachedDataRejected value will be set to either true or false depending on acceptance of the data by V8.
    • produceCachedData <boolean> When true and no cachedData is present, V8 will attempt to produce code cache data for code. Upon success, a Buffer with V8’s code cache data will be produced and stored in the cachedData property of the returned vm.Script instance. The cachedDataProduced value will be set to either true or false depending on whether code cache data is produced successfully.
  • code <string> 待编译的JavaScript代码
  • options 选项
    • filename <string> 指定这个脚本产生的堆栈跟踪信息所使用的文件名
    • lineOffset <number> 指定这个脚本产生的堆栈跟踪信息的行号偏移量
    • columnOffset <number> 指定这个脚本产生的堆栈跟踪信息的列号偏移量
    • displayErrors <boolean> 当被设置为真的时候,如果在编译代码时发生了错误,造成错误的行号会被附加到堆栈跟踪信息中。
    • timeout <number> 指定中断执行前代码执行的最长时间,如果执行被中断,就会抛出一个错误。
    • cachedData <Buffer> 提供一个可选的V8代码缓冲数据给提供的源使用。当提供该值的时候,cachedDataRejected值将会被设置,要么为真要么为假,取决于V8接受的数据。
    • produceCachedData <boolean> 当设置为真,且没有cachedData的时候,V8将会尝试产生代码来缓存原代码的数据。执行成功后,V8代码缓存数据的字节数组就会被生产并存储在返回的vm.Script实例的cachedData属性中。cachedDataProduced 要么设置为真要么设置为假,取决于是否代码还从数据被成功生成。

Creating a new vm.Script object compiles code but does not run it. The compiled vm.Script can be run later multiple times. It is important to note that the code is not bound to any global object; rather, it is bound before each run, just for that run.

创建一个新的vm.Script对象编译代码但是并不运行。编译的vm.Script之后可以被多次运行。必须注意的是该代码并没有绑定到任何的全局对象;相反的它们只在每次运行前被绑定到那次的运行环境上。

script.runInContext(contextifiedSandbox[, options])

Added in: v0.3.1

  • contextifiedSandbox <Object> A contextified object as returned by the vm.createContext() method.
  • options <Object>
    • filename <string> Specifies the filename used in stack traces produced by this script.
    • lineOffset <number> Specifies the line number offset that is displayed in stack traces produced by this script.
    • columnOffset <number> Specifies the column number offset that is displayed in stack traces produced by this script.
    • displayErrors <boolean> When true, if an Error error occurs while compiling the code, the line of code causing the error is attached to the stack trace.
    • timeout <number> Specifies the number of milliseconds to execute code before terminating execution. If execution is terminated, an Error will be thrown.
    • breakOnSigint: if true, the execution will be terminated when SIGINT (Ctrl+C) is received. Existing handlers for the event that have been attached via process.on(“SIGINT”) will be disabled during script execution, but will continue to work after that. If execution is terminated, an Error will be thrown.
  • contextifiedSandbox <Object> 一个由vm.createContext()函数返回的上下文对象。
  • options <Object>
    • filename <string> 指定这个脚本产生的堆栈跟踪信息所使用的文件名
    • lineOffset <number> 指定这个脚本产生的堆栈跟踪信息的行号偏移量
    • columnOffset <number> 指定这个脚本产生的堆栈跟踪信息的列号偏移量
    • displayErrors <boolean>当被设置为真的时候,如果在编译代码时发生了错误,造成错误的行号会被附加到堆栈跟踪信息中。
    • timeout <number> 指定中断执行前代码执行的最长时间,如果执行被中断,就会抛出一个错误。
    • breakOnSigint: 如果为真,当接收到(Ctrl+C)时,执行会被中断。在脚本执行期间,连接到process.on(“SIGINT”)上存在的事件处理程序将会被禁用,但是在这之后脚本会继续工作。如果执行被中断了,就会抛出一个错误。

Runs the compiled code contained by the vm.Script object within the given contextifiedSandbox and returns the result. Running code does not have access to local scope.

The following example compiles code that increments a global variable, sets the value of another global variable, then execute the code multiple times. The globals are contained in the sandbox object.

运行编译后的在给定的沙箱上下文中被vm.Script对象包含的代码,然后返回其结果。运行的代码无法获取本地变量。

下面的例子编译代码,增加一个全局变量,设置其它全局变量的值,然后多次执行该代码。全局变量被包含在一个沙盒对象中。

const util = require('util');
const vm = require('vm');

const sandbox = {
    animal: 'cat',
    count: 2
};

const script = new vm.Script('count += 1; name= "kitty"');

const context = new vm.createContext(sandbox);
for(var i = 0; i < 10; i++) {
    script.runInContext(context);
}

console.log(util.inspect(sandbox));
//输出 { animal: 'cat', count: 12, name: 'kitty' }
  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

script.runInNewContext([sandbox][, options])

Added in: v0.3.1

  • sandbox <Object> An object that will be contextified. If undefined, a new object will be created.
  • options <Object>
    • filename <string> Specifies the filename used in stack traces produced by this script.
    • lineOffset <number> Specifies the line number offset that is displayed in stack traces produced by this script.
    • columnOffset <number> Specifies the column number offset that is displayed in stack traces produced by this script.
    • displayErrors <boolean> When true, if an Error error occurs while compiling the code, the line of code causing the error is attached to the stack trace.
    • timeout <number> Specifies the number of milliseconds to execute code before terminating execution. If execution is terminated, an Error will be thrown.
  • sandbox <Object> 一个将会变成上下文的对象。如果未定义,就会创建一个新的对象。
  • options <Object>
    • filename <string> 指定这个脚本产生的堆栈跟踪信息所使用的文件名
    • lineOffset <number> 指定这个脚本产生的堆栈跟踪信息的行号偏移量
    • columnOffset <number> 指定这个脚本产生的堆栈跟踪信息的列号偏移量
    • displayErrors <boolean>当被设置为真的时候,如果在编译代码时发生了错误,造成错误的行号会被附加到堆栈跟踪信息中。
    • timeout <number> 指定中断执行前代码执行的最长时间,如果执行被中断,就会抛出一个错误。

First contextifies the given sandbox, runs the compiled code contained by the vm.Script object within the created sandbox, and returns the result. Running code does not have access to local scope.

The following example compiles code that sets a global variable, then executes the code multiple times in different contexts. The globals are set on and contained within each individual sandbox.

首先将给定的沙盘上下文化,在创建的沙盘中运行被vm.Script对象编译好的代码,然后返回其结果。运行的代码无法访问本地范围的对象。

下面的例子编译代码,然后设置一个全局变量,然后在不同的上下文中多次执行该代码。全局变量被设置并包含在每一个单独的沙盘中。

const util = require('util');
const vm = require('vm');

const script = new vm.Script('globalVar = "set"');

const sandboxes = [{}, {}, {}];
sandboxes.forEach((sandbox) => {
    script.runInNewContext(sandbox);
});

console.log(util.inspect(sandboxes));
//输出 [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }]
  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

script.runInThisContext([options])

Added in: v0.3.1
- options <Object>
- filename <string> Specifies the filename used in stack traces produced by this script.
- lineOffset <number> Specifies the line number offset that is displayed in stack traces produced by this script.
- columnOffset <number> Specifies the column number offset that is displayed in stack traces produced by this script.
- displayErrors <boolean> When true, if an Error error occurs while compiling the code, the line of code causing the error is attached to the stack trace.
- timeout <number> Specifies the number of milliseconds to execute code before terminating execution. If execution is terminated, an Error will be thrown.

  • options <Object>
    • filename <string> 指定这个脚本产生的堆栈跟踪信息所使用的文件名
    • lineOffset <number> 指定这个脚本产生的堆栈跟踪信息的行号偏移量
    • columnOffset <number> 指定这个脚本产生的堆栈跟踪信息的列号偏移量
    • displayErrors <boolean>当被设置为真的时候,如果在编译代码时发生了错误,造成错误的行号会被附加到堆栈跟踪信息中。
    • timeout <number> 指定中断执行前代码执行的最长时间,如果执行被中断,就会抛出一个错误。

Runs the compiled code contained by the vm.Script within the context of the current global object. Running code does not have access to local scope, but does have access to the current global object.

The following example compiles code that increments a global variable then executes that code multiple times:

运行被vm.Script包含的含有当前全局对象上下文的编译好的代码。运行的代码不能访问本地变量,但是可以访问当前的全局对象。

下面的例子编译增加一个全局变量的代码,然后多次执行那个代码。

const vm = require('vm');

//是否有加global都是全局变量
global.globalVar = 0;
myVar = 0;

const script = new vm.Script('globalVar += 1; myVar += 1', {filename: 'myfile.vm'});

for(var i = 0; i < 1000; i++) {
    script.runInThisContext();
}

console.log(globalVar);
// 1000
console.log(myVar);
// 1000
  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

vm.createContext([sandbox])

Added in: v0.3.1

  • sandbox <Object>

If given a sandbox object, the vm.createContext() method will prepare that sandbox so that it can be used in calls to vm.runInContext() or script.runInContext(). Inside such scripts, the sandbox object will be the global object, retaining all of its existing properties but also having the built-in objects and functions any standard global object has. Outside of scripts run by the vm module, sandbox will remain unchanged.

If sandbox is omitted (or passed explicitly as undefined), a new, empty contextified sandbox object will be returned.

The vm.createContext() method is primarily useful for creating a single sandbox that can be used to run multiple scripts. For instance, if emulating a web browser, the method can be used to create a single sandbox representing a window’s global object, then run all <script> tags together within the context of that sandbox.

如果给定一个沙盘对象,vm.createContext()函数将会准备那个沙盘以使得它可以被vm.runInContext()或script.runInContext()函数调用。在这样的脚本中,沙盘对象会成为一个全局对象,持有所有存在的属性,并且也有所有全局对象都有的内置的对象和函数。在由vm模块执行的脚本外部,沙盘将会保持不变。

如果沙盘参数被省略了(或者明确地传输未定义),一个新的,空的上下文沙盘对象就会被返回。

vm.createContext()函数主要用于创建一个单独的沙盘。并且它可以被多个脚本运行。举个例子,如果模拟一个网页浏览器,该方法可以被用来创建一个单独的沙盘,代表了一个window的全局对象,然后在该沙盘的当前上下文中一起运行所有的脚本标签。

vm.isContext(sandbox)

Added in: v0.11.7

  • sandbox <Object>

Returns true if the given sandbox object has been contextified using vm.createContext().

如果给定的sandbox对象已经被vm.createContext()上下文化。

vm.runInContext(code, contextifiedSandbox[, options])

  • code <string> The JavaScript code to compile and run.
  • contextifiedSandbox <Object> The contextified object that will be used as the global when the code is compiled and run.
  • options <Object>
    • filename <string> Specifies the filename used in stack traces produced by this script.
    • lineOffset <number> Specifies the line number offset that is displayed in stack traces produced by this script.
    • columnOffset <number> Specifies the column number offset that is displayed in stack traces produced by this script.
    • displayErrors <boolean> When true, if an Error error occurs while compiling the code, the line of code causing the error is attached to the stack trace.
    • timeout <number> Specifies the number of milliseconds to execute code before terminating execution. If execution is terminated, an Error will be thrown.
  • code <string> 待编译和执行的JavaScript代码。
  • contextifiedSandbox <Object> 当代码编译和执行时,该上下文对象会被当做全局对象。
  • options <Object>
    • filename <string> 指定这个脚本产生的堆栈跟踪信息所使用的文件名
    • lineOffset <number> 指定这个脚本产生的堆栈跟踪信息的行号偏移量
    • columnOffset <number> 指定这个脚本产生的堆栈跟踪信息的列号偏移量
    • displayErrors <boolean>当被设置为真的时候,如果在编译代码时发生了错误,造成错误的行号会被附加到堆栈跟踪信息中。
    • timeout <number> 指定中断执行前代码执行的最长时间,如果执行被中断,就会抛出一个错误。

The vm.runInContext() method compiles code, runs it within the context of the contextifiedSandbox, then returns the result. Running code does not have access to the local scope. The contextifiedSandbox object must have been previously contextified using the vm.createContext() method.

The following example compiles and executes different scripts using a single contextified object:

vm.runInContext()函数编译代码,然后在该上下文沙盘中执行它,然后返回结果。执行中的代码无法访问本地范围的对象。上下文沙盘对象必须先使用vm.createContext()函数上下文化。

下面的例子使用单一的上下文对象编译和执行不同的脚本。

const util = require('util');
const vm = require('vm');

const sandbox = { globalVar: 1 };
vm.createContext(sandbox);

for (var i = 0; i < 10; ++i) {
  vm.runInContext('globalVar *= 2;', sandbox);
}
console.log(util.inspect(sandbox));

// { globalVar: 1024 }
  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

vm.runInDebugContext(code)

Added in: v0.11.14

  • code <string> The JavaScript code to compile and run.

The vm.runInDebugContext() method compiles and executes code inside the V8 debug context. The primary use case is to gain access to the V8 Debug object:

-code <string> 待编译和执行的JavaScript代码

vm.runInDebugContext()方法在V8的调试环境中编译和执行代码。其主要的使用场景就是获取V8调试对象的访问权限。

const vm = require('vm');
const Debug = vm.runInDebugContext('Debug');
console.log(Debug.findScript(process.emit).name);  // 'events.js'
console.log(Debug.findScript(process.exit).name);  // 'internal/process.js'
  
 
  • 1
  • 2
  • 3
  • 4

Note: The debug context and object are intrinsically tied to V8’s debugger implementation and may change (or even be removed) without prior warning.

The Debug object can also be made available using the V8-specific --expose_debug_as= [command line option][cli.md].

注意: 调试上下文和对象本质上和V8的调试器的实现相关联,并且可能在没有预先警告的前提下发生改变(或者甚至被移除)。

这个调试对象也可以使用V8-specific使其可见 --expose_debug_as= [command line option][cli.md].

vm.runInNewContext(code[, sandbox][, options])

Added in: v0.3.1

  • code <string> The JavaScript code to compile and run.
  • sandbox <Object> An object that will be contextified. If undefined, a new object will be created.
  • options
    • filename <string> Specifies the filename used in stack traces produced by this script.
      -lineOffset <number> Specifies the line number offset that is displayed in stack traces produced by this script.
    • columnOffset <number> Specifies the column number offset that is displayed in stack traces produced by this script.
    • displayErrors <boolean> When true, if an Error error occurs while compiling the code, the line of code causing the error is attached to the stack trace.
    • timeout <number> Specifies the number of milliseconds to execute code before terminating execution. If execution is terminated, an Error will be thrown.
  • code <string> 待编译和执行的JavaScript代码。
  • sandbox <Object> 一个即将会被上下文化的对象。如果未定义,就会创建一个新的对象。
  • options <Object>
    • filename <string> 指定这个脚本产生的堆栈跟踪信息所使用的文件名
    • lineOffset <number> 指定这个脚本产生的堆栈跟踪信息的行号偏移量
    • columnOffset <number> 指定这个脚本产生的堆栈跟踪信息的列号偏移量
    • displayErrors <boolean>当被设置为真的时候,如果在编译代码时发生了错误,造成错误的行号会被附加到堆栈跟踪信息中。
    • timeout <number> 指定中断执行前代码执行的最长时间,如果执行被中断,就会抛出一个错误。

The vm.runInNewContext() first contextifies the given sandbox object (or creates a new sandbox if passed as undefined), compiles the code, runs it within the context of the created context, then returns the result. Running code does not have access to the local scope.

The following example compiles and executes code that increments a global variable and sets a new one. These globals are contained in the sandbox.

vm.runInNewContext()首先上下文化给定的沙盘对象(或者创建一个新的沙盘,如果传递的是未定义参数),然后编译并在创建的上下文环境中运行代码,然后返回其结果。运行中的代码无法访问本地对象。

下面的例子编译并执行增加一个全局变量并设置一个新的变量的代码。这些全部都包含在一个沙盘中。

const util = require('util');
const vm = require('vm');

const sandbox = {
    animal: 'cat',
    count: 2
};

vm.runInNewContext('cont+=1;name="kitty"', sandbox);
console.log(util.inspect(sandbox));
//{ animal: 'cat', count: 3, name: 'kitty' }
  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

vm.runInThisContext(code[, options])

Added in: v0.3.1

  • code <string> The JavaScript code to compile and run.
  • options
    • filename <string> Specifies the filename used in stack traces produced by this script.
    • lineOffset <number> Specifies the line number offset that is displayed in stack traces produced by this script.
    • columnOffset <number> Specifies the column number offset that is displayed in stack traces produced by this script.
    • displayErrors <boolean> When true, if an Error error occurs while compiling the code, the line of code causing the error is attached to the stack trace.
    • timeout <number> Specifies the number of milliseconds to execute code before terminating execution. If execution is terminated, an Error will be thrown.
  • code <string> 待编译和执行的JavaScript代码。
  • options <Object>
    • filename <string> 指定这个脚本产生的堆栈跟踪信息所使用的文件名
    • lineOffset <number> 指定这个脚本产生的堆栈跟踪信息的行号偏移量
    • columnOffset <number> 指定这个脚本产生的堆栈跟踪信息的列号偏移量
    • displayErrors <boolean>当被设置为真的时候,如果在编译代码时发生了错误,造成错误的行号会被附加到堆栈跟踪信息中。
    • timeout <number> 指定中断执行前代码执行的最长时间,如果执行被中断,就会抛出一个错误。

vm.runInThisContext() compiles code, runs it within the context of the current global and returns the result. Running code does not have access to local scope, but does have access to the current global object.

The following example illustrates using both vm.runInThisContext() and the JavaScript eval() function to run the same code:

vm.runInThisContext()编译代码,在当前全局变量的上下文中执行代码然后返回其结果。执行的代码不能访问本地变量,但是可以访问当前的全局对象。

下面的例子展示了用vm.runInThisContext()和JavaScript的eval()函数来执行相同的代码

const vm = require('vm');
var localVar = 'initial value';

const vmResult = vm.runInThisContext('localVar = "vm";');
console.log('vmResult:', vmResult);
console.log('localVar:', localVar);

const evalResult = eval('localVar = "eval";');
console.log('evalResult:', evalResult);
console.log('localVar:', localVar);

//vmResult: 'vm', localvar: 'initial value'
//evalResult: 'eval', localVar: 'eval'
  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

Because vm.runInThisContext() does not have access to the local scope, localVar is unchanged. In contrast, eval() does have access to the local scope, so the value localVar is changed. In this way vm.runInThisContext() is much like an indirect eval() call, e.g. (0,eval)(‘code’).

因为vm.runInThisContext()不能访问本地变量,localVar就不会改变。相比之下,eval()可以访问本地变量,因此localVar变量就改变了。这样,vm.runInThisContext()就非常像间接地调用eval(),例如 (0,eval)(‘code’).

Example: Running an HTTP Server within a VM

When using either script.runInThisContext() or vm.runInThisContext(), the code is executed within the current V8 global context. The code passed to this VM context will have its own isolated scope.

In order to run a simple web server using the http module the code passed to the context must either call require(‘http’) on its own, or have a reference to the http module passed to it. For instance:

当使用script.runInThisContext()或vm.runInThisContext()函数的时候,代码会被执行在当前V8全局上下文中。传递给VM上下文的代码将会有它自己的隔离的范围。

为了使用http模块运行一个单一的web服务器,传递到那个上下文中的代码要么自己调用require(‘http’),要么使用传递给它的http模块。举个例子:

'use strict';
const vm = require('vm');

let code = 
`(function(require) {
    const http = require('http');
    http.createServer((request, response) => {
        response.writeHead(200, {'Content-Type':'text/plain'});
        response.end('hello world\\n');//这里必须用双斜杠,因为和字符串一样会先被转义一次
    }).listen(8080);
    console.log('Server running at http://127.0.0.1:8080');
})`;

vm.runInThisContext(code)(require);
  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

Note: The require() in the above case shares the state with context it is passed from. This may introduce risks when untrusted code is executed, e.g. altering objects from the calling thread’s context in unwanted ways.

注意:上面例子中的require()函数分享了传递给它的上下文状态。它也可能引入风险,当不可信任的代码被执行时,比如,从调用线程的上下文中以一个不期望的方式修改对象。

What does it mean to “contextify” an object?

All JavaScript executed within Node.js runs within the scope of a “context”. According to the V8 Embedder’s Guide:

  • In V8, a context is an execution environment that allows separate, unrelated, JavaScript applications to run in a single instance of V8. You must explicitly specify the context in which you want any JavaScript code to be run.

When the method vm.createContext() is called, the sandbox object that is passed in (or a newly created object if sandbox is undefined) is associated internally with a new instance of a V8 Context. This V8 Context provides the code run using the vm modules methods with an isolated global environment within which it can operate. The process of creating the V8 Context and associating it with the sandbox object is what this document refers to as “contextifying” the sandbox.

所有的JavaScript执行在Node.js运行范围内的上下文环境。根据V8嵌入式指导说明:

  • 在V8中,一个上下文是一个知心环境,它允许隔离,无关的,JavaScript应用程序执行在一个单独的V8实例上。你可以明确地指定你想要的任何JavaScript代码执行的上下文。

当vm.createContext()函数被调用时,会将被传递的沙盘对象(如果沙盘未定义会新建一个对象)内部关联到一个新的V8上下文实例中。V8上下文对象提供了包含vm模块方法的代码和一个只有它能操作的隔离的全局环境。创建V8上下文和使用沙盘对象隔离的操作正是本文档所指的上下文化的沙盘。

文章来源: blog.csdn.net,作者:福州-司马懿,版权归原作者所有,如需转载,请联系作者。

原文链接:blog.csdn.net/chy555chy/article/details/52703385

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。