缺⑴份安定

文章 评论 浏览 28

缺⑴份安定 2025-02-20 11:41:23

您需要处理此操作,而无需属于许多关系,并且必须创建一个中间或枢轴模型。

class OrderProduct extends Model {
    // optional belongs to order and product method
    protected $fillable = [
        'product_id',
        'order_id',
        'color',
        'quantity'
    ];
}

更改订单和产品模型(如果您不使用的产品模型可选)

class Order extends Model {
    public function order_products()
    {
        return $this->hasMany(OrderProduct::class);
    }
}

并且需要在控制器更新方法中

//假设您的请求结构是

[
    'id' => 1, // Order id,
    'order_attribute_1', // Any of your order model attribute
    'order_attribute_2', // Any of your order model attributes
    'products' => [
        [
            'id' => null, // id of the order_product table so, null cause is a new added product
            'order_id' => 1, // id of order
            'product_id' => 1// id of product
            'color' => 'blue',
            'quantity' => 12
        ],
        [
            'id' => 1, // id of the order_product table so, has id cause are you updating an existent product in the order
            'order_id' => 1, // id of order
            'product_id' => 1// id of product
            'color' => 'blue',
            'quantity' => 5
        ]
    ]
]

您需要创建自己的同步方法,

public function update(AdminUpdateOrderRequest $request, $id)
{
    $orderValidated = $request->validated();

    $order = Order::findOrFail($id);

    $order->update($orderValidated);
    
    // start simulation of sync method
    $new_order_products = [];
    // id of order_product to preserve
    $order_products_to_keep = [];

    // I hope you have the corresponding products validation on your request class
    foreach ($request['products'] as $request_product) {
        // need to create new product in order
        if (empty($request_product['id'])) {
            $new_order_products[] = [
                'product_id' => $request_product['product_id'],
                'order_id' => $request_product['order_id'],
                'color' => $request_product['color'],
                'quantity' => $request_product['quantity']
            ]
        } else {
            // find the order_order product register
            $order_product = OrderProduct::find(request_product['id']);
            // update all except the order id
            $order_product->update([
                'product_id' => $request_product['product_id'],
                'color' => $request_product['color'],
                'quantity' => $request_product['quantity']
            ]);
            // as exists this order_product will be preserved
            $order_products_to_keep[] = $order_product->id;
        }
    }

    // calculate the order_products to delete (if not present means that needs to be deleted)
    foreach ($order->order_products as $order_product) {
        if (!in_array($order_products_to_keep, $order_product->id)) {
            $order_product->delete();
        }
    }

    // mass insertion of new order_products
    $order->order_products()->createMany($new_order_products);

    DB::table
    return OrderResource::make($order)->additional([
        'success' => true,
    ]);
}

那么我希望这对您有帮助,并且可能需要您使用交易预防错误,并添加相应的验证

You need to handle this without belongs to many relation, and you must have to create an intermediate or pivot model.

class OrderProduct extends Model {
    // optional belongs to order and product method
    protected $fillable = [
        'product_id',
        'order_id',
        'color',
        'quantity'
    ];
}

And need to change the order and product model (product model optional if you dont use)

class Order extends Model {
    public function order_products()
    {
        return $this->hasMany(OrderProduct::class);
    }
}

In your controller update method

// Assuming that your request structure is

[
    'id' => 1, // Order id,
    'order_attribute_1', // Any of your order model attribute
    'order_attribute_2', // Any of your order model attributes
    'products' => [
        [
            'id' => null, // id of the order_product table so, null cause is a new added product
            'order_id' => 1, // id of order
            'product_id' => 1// id of product
            'color' => 'blue',
            'quantity' => 12
        ],
        [
            'id' => 1, // id of the order_product table so, has id cause are you updating an existent product in the order
            'order_id' => 1, // id of order
            'product_id' => 1// id of product
            'color' => 'blue',
            'quantity' => 5
        ]
    ]
]

You need to create your own sync method

public function update(AdminUpdateOrderRequest $request, $id)
{
    $orderValidated = $request->validated();

    $order = Order::findOrFail($id);

    $order->update($orderValidated);
    
    // start simulation of sync method
    $new_order_products = [];
    // id of order_product to preserve
    $order_products_to_keep = [];

    // I hope you have the corresponding products validation on your request class
    foreach ($request['products'] as $request_product) {
        // need to create new product in order
        if (empty($request_product['id'])) {
            $new_order_products[] = [
                'product_id' => $request_product['product_id'],
                'order_id' => $request_product['order_id'],
                'color' => $request_product['color'],
                'quantity' => $request_product['quantity']
            ]
        } else {
            // find the order_order product register
            $order_product = OrderProduct::find(request_product['id']);
            // update all except the order id
            $order_product->update([
                'product_id' => $request_product['product_id'],
                'color' => $request_product['color'],
                'quantity' => $request_product['quantity']
            ]);
            // as exists this order_product will be preserved
            $order_products_to_keep[] = $order_product->id;
        }
    }

    // calculate the order_products to delete (if not present means that needs to be deleted)
    foreach ($order->order_products as $order_product) {
        if (!in_array($order_products_to_keep, $order_product->id)) {
            $order_product->delete();
        }
    }

    // mass insertion of new order_products
    $order->order_products()->createMany($new_order_products);

    DB::table
    return OrderResource::make($order)->additional([
        'success' => true,
    ]);
}

I hope this helps you, and probably you need to use a transaction for preventing errors, and, add the respective validations

通过枢轴表ID而不是模型ID同步

缺⑴份安定 2025-02-19 11:53:50

大多数情况下(包括此),返回将立即退出。但是,如果返回是在中尝试带有随附的最后 block block中的最后始终执行并可以“覆盖” 中返回尝试。

function foo() {
    try {
        for (var i = 0; i < 10; i++) {
            if (i % 3 == 0) {
                return i; // This executes once
            }
        }
    } finally {
        return 42; // But this still executes
    }
}

console.log(foo()); // Prints 42

In most cases (including this one), return will exit immediately. However, if the return is in a try block with an accompanying finally block, the finally always executes and can "override" the return in the try.

function foo() {
    try {
        for (var i = 0; i < 10; i++) {
            if (i % 3 == 0) {
                return i; // This executes once
            }
        }
    } finally {
        return 42; // But this still executes
    }
}

console.log(foo()); // Prints 42

返回停止循环吗?

缺⑴份安定 2025-02-19 11:37:53

尽管零值是浮动的,而不是问题所暗示的,但这似乎给出了所需的输出。

I5 = [[(0.5, -0.5), (1.5, -0.5)], [(0.5, -0.5), (0.5, -1.5)], [(1.5, -0.5), (1.5, -1.5)], [(0.5, -1.5), (1.5, -1.5)]]
I6 = []

for e1, e2 in I5:
    I6.append([e1, (e2[0]-e1[0], e2[1]-e1[1])])

print(I6)

输出:

[[(0.5, -0.5), (1.0, 0.0)], [(0.5, -0.5), (0.0, -1.0)], [(1.5, -0.5), (0.0, -1.0)], [(0.5, -1.5), (1.0, 0.0)]]

This seems to give the desired output although the zero values are float rather than int as implied in the question.

I5 = [[(0.5, -0.5), (1.5, -0.5)], [(0.5, -0.5), (0.5, -1.5)], [(1.5, -0.5), (1.5, -1.5)], [(0.5, -1.5), (1.5, -1.5)]]
I6 = []

for e1, e2 in I5:
    I6.append([e1, (e2[0]-e1[0], e2[1]-e1[1])])

print(I6)

Output:

[[(0.5, -0.5), (1.0, 0.0)], [(0.5, -0.5), (0.0, -1.0)], [(1.5, -0.5), (0.0, -1.0)], [(0.5, -1.5), (1.0, 0.0)]]

在Python中执行指数操作

缺⑴份安定 2025-02-19 07:36:20

使用 is()类选择器

:is(.parent1, .parent2, ...) > child {
    ...
}

Use the :is() pseudo-class selector

:is(.parent1, .parent2, ...) > child {
    ...
}

CSS:选择多个类&#x27;孩子

缺⑴份安定 2025-02-18 17:27:38

这种方法没有错。这里可能的问题是
您正在使用对称键。通过这种方法,您正在使用相同的键来签名令牌和验证其签名。这意味着您需要与身份验证过程中所涉及的所有应用程序共享用于签名令牌的密钥,而这些应用程序并非总是可能的,并且资源服务器具有太多的功率。

为了保留授权服务的关键,资源服务器中有一个选项使用授权服务曝光的特殊端点来验证令牌。

另一种方法是使用不对称的钥匙对签名和验证令牌。在这种情况下,专用密钥将仅分配给授权服务,并且可以与身份验证过程中涉及的所有应用程序共享公共密钥。

@Bean
public ReactiveJwtDecoder jwtDecoder() throws GeneralSecurityException {
    RSAPublicKey key = (RSAPublicKey) KeyFactory.getInstance("RSA")
            .generatePublic(new X509EncodedKeySpec(getKeySpec(properties.getPublicKey())));
    return NimbusReactiveJwtDecoder.withPublicKey(key)
            .signatureAlgorithm(SignatureAlgorithm.from(properties.getSignatureAlgorithm()))
            .build();
}

There is nothing wrong with such approach. The possible issue here is that
you are using symmetric key. With this approach you are using the same key for both signing a token and validating its signature. It means you need to share the key used to sign tokens with all the applications involved in the authentication process that is not always possible and resource server has too much power.

To keep key on authorization service only, there is an option in the resources server to use special endpoint, exposed by authorization service, to validate the token.

Another approach would be to use asymmetric key pair to sign and validate tokens. In this case private key will be assigned to authorization service only and public key could be shared with all the applications involved in the authentication process.

@Bean
public ReactiveJwtDecoder jwtDecoder() throws GeneralSecurityException {
    RSAPublicKey key = (RSAPublicKey) KeyFactory.getInstance("RSA")
            .generatePublic(new X509EncodedKeySpec(getKeySpec(properties.getPublicKey())));
    return NimbusReactiveJwtDecoder.withPublicKey(key)
            .signatureAlgorithm(SignatureAlgorithm.from(properties.getSignatureAlgorithm()))
            .build();
}

春季安全OATUH2:如何在没有授权服务器的情况下验证

缺⑴份安定 2025-02-18 17:25:25

否。我们无法做到这一点,同时仍在程序中使用相同名称定义变量。但是,您可以将变量重新定义为参数:

define variable myVariable as integer no-undo.

procedure myProcedure1:
  message "myProcedure1:" myVariable.
end.

procedure myProcedure2:
  define variable myVariable as integer no-undo.
  message "myProcedure2:" myVariable.
end.

procedure myProcedure3:
  define input parameter p1 as integer no-undo.
  define variable myVariable as integer no-undo.
  message "myProcedure3:" myVariable p1.
end.

procedure myProcedure4:
  define input parameter myVariable as integer no-undo.
  message "myProcedure4:" myVariable.
end.


myVariable = 123.

run myProcedure1.
run myProcedure2.
run myProcedure3 ( myVariable ).
run myProcedure4 ( myVariable ).

No. There us no way to do that while still defining a variable with the same name in the procedure. However, you could redefine the variable as a parameter:

define variable myVariable as integer no-undo.

procedure myProcedure1:
  message "myProcedure1:" myVariable.
end.

procedure myProcedure2:
  define variable myVariable as integer no-undo.
  message "myProcedure2:" myVariable.
end.

procedure myProcedure3:
  define input parameter p1 as integer no-undo.
  define variable myVariable as integer no-undo.
  message "myProcedure3:" myVariable p1.
end.

procedure myProcedure4:
  define input parameter myVariable as integer no-undo.
  message "myProcedure4:" myVariable.
end.


myVariable = 123.

run myProcedure1.
run myProcedure2.
run myProcedure3 ( myVariable ).
run myProcedure4 ( myVariable ).

从进度的主要块访问变量4GL

缺⑴份安定 2025-02-18 11:08:55

正如我之前提到的那样,我得到了解决方案,也说在否则中犯了一些错误的部分,因此进行了一些更改,现在正在

更新逻辑:

        if (nestedObj?.[parentEle]?.[index]) {
          nestedObj[parentEle][index] = Object.assign(
            {},
            nestedObj[parentEle][index],
            eachValue[index]
          );
        } else {
          nestedObj[parentEle] = nestedObj[parentEle]
            ? nestedObj[parentEle]
            : [];
          eachValue = { [fieldName]: e.target.value };
          nestedObj[parentEle][index] = eachValue;
        } 

如果有人甚至可以建议一些更好的东西或者,如果可以简化,请更新

I got the solution, as I have mentioned earlier as well saying making some mistake in the else part of the condition, so made some changes and it is working now

updated logic:

        if (nestedObj?.[parentEle]?.[index]) {
          nestedObj[parentEle][index] = Object.assign(
            {},
            nestedObj[parentEle][index],
            eachValue[index]
          );
        } else {
          nestedObj[parentEle] = nestedObj[parentEle]
            ? nestedObj[parentEle]
            : [];
          eachValue = { [fieldName]: e.target.value };
          nestedObj[parentEle][index] = eachValue;
        } 

if anyone can even suggest something better or if any simplification is possible then please update

如何合并嵌套动态对象

缺⑴份安定 2025-02-18 03:20:27

为了了解 import 语句中使用卷曲括号的使用,首先,您必须了解 破坏 es6

  1. 中引入的

      var Bodybuilder = {
      firstName:'kai',
      最后一个名称:“ greene”,
      昵称:“捕食者”
    };
    
    var {firstName,lastName} = ModyBuilder;
    console.log(firstName,lastName); // Kai Greene
    
    firstName ='Morgan';
    lastname ='aste';
    
    console.log(firstName,lastName); //摩根·阿斯特
     
  2. 数组破坏

      var [firstgame] = ['gran turismo','burnout','gta'];
    
    console.log(firstgame); // Gran Turismo
     

    使用列表匹配

      var [,secondgame] = ['gran turismo','burnout','gta'];
      console.log(第二游戏); //倦怠
     

    使用传播操作员

      var [firstgame,... reth] = ['gran turismo','burnout','gta'];
    console.log(firstgame); // gran turismo
    console.log(rets); // ['Burnout','gta'];
     

,因为我们已经解决了这一点,在 es6 中,您可以导出多个模块。然后,您可以使用以下毁灭对象进行破坏。

假设您有一个名为 module.js 的模块,

    export const printFirstname(firstname) => console.log(firstname);
    export const printLastname(lastname) => console.log(lastname);

您想将导出的功能导入到 index.js ;

    import {printFirstname, printLastname} from './module.js'

    printFirstname('Taylor');
    printLastname('Swift');

您也可以使用不同的变量名称

    import {printFirstname as pFname, printLastname as pLname} from './module.js'

    pFname('Taylor');
    pLanme('Swift');

In order to understand the use of curly braces in import statements, first, you have to understand the concept of destructuring introduced in ES6

  1. Object destructuring

    var bodyBuilder = {
      firstname: 'Kai',
      lastname: 'Greene',
      nickname: 'The Predator'
    };
    
    var {firstname, lastname} = bodyBuilder;
    console.log(firstname, lastname); // Kai Greene
    
    firstname = 'Morgan';
    lastname = 'Aste';
    
    console.log(firstname, lastname); // Morgan Aste
    
  2. Array destructuring

    var [firstGame] = ['Gran Turismo', 'Burnout', 'GTA'];
    
    console.log(firstGame); // Gran Turismo
    

    Using list matching

      var [,secondGame] = ['Gran Turismo', 'Burnout', 'GTA'];
      console.log(secondGame); // Burnout
    

    Using the spread operator

    var [firstGame, ...rest] = ['Gran Turismo', 'Burnout', 'GTA'];
    console.log(firstGame);// Gran Turismo
    console.log(rest);// ['Burnout', 'GTA'];
    

Now that we've got that out of our way, in ES6 you can export multiple modules. You can then make use of object destructuring like below.

Let's assume you have a module called module.js

    export const printFirstname(firstname) => console.log(firstname);
    export const printLastname(lastname) => console.log(lastname);

You would like to import the exported functions into index.js;

    import {printFirstname, printLastname} from './module.js'

    printFirstname('Taylor');
    printLastname('Swift');

You can also use different variable names like so

    import {printFirstname as pFname, printLastname as pLname} from './module.js'

    pFname('Taylor');
    pLanme('Swift');

我什么时候应该将卷括号用于ES6导入?

缺⑴份安定 2025-02-18 02:02:00

调用函数时,该过程需要能够初始化该字符串。即使清除了存储在堆栈上的值,它仍将保留在加载的二进制中。您了解:

无论我们在代码中添加什么,都不足以阻止专业网络安全工程师在二进制中找到或生成的密码,而无需添加单独的密钥。

我们将密码的内存归零,因为该密码在程序开始之前不存在,因此我们可以最大程度地减少其保留在内存中的时间。没有安全的方法将密码存储在二进制中,但是我们可以做一些技巧来更难找到。我们可以通过存储密码的编码版本来假装具有安全性。但是,仍然很难以一种防止编译器将密码重新优化为纯文本表单的方式存储。

理想情况下,密码(或私钥)只能存储在受信任的系统上。该二进制文件将传递给不受信任的系统,这些系统必须将请求发送到受信任的系统。然后,受信任的系统代表他们采取行动,同时忽略了恶意或畸形的请求。

旁注:这个问题可能是 xy问题的结果。您为什么要存储密码?您实际想做什么?您的问题可能会有更简单的答案,不需要将密码存储在二进制中。

The process needs to be able to initialize that string when the function is called. Even if the value stored on the stack is cleared, it will still remain present in binary that was loaded. It is very important that you understand:

No matter what we add in the code, it won't be enough to stop a professional cybersecurity engineer from finding a password stored or generated within a binary without the addition of a separate key.

We zero the memory of a password because it did not exist prior to the start of the program so we can minimize the time it is held in memory. There is no safe way to store a password in the binary, but we can do some tricks to make it harder to find. We can pretend to have security by storing an encoded version of the password. However, it will still be difficult to store it in a way that prevents the compiler from optimizing the password back into its plain text form.

Ideally the password (or private key) would only be stored on a trusted system. This binary would be passed to untrusted systems which must send requests to the trusted system. The trusted system then acts on their behalf while ignoring malicious or malformed requests.

Side Note: This question may be the result of the XY problem. Why are you attempting to store the password? What do you actually want to do? There may be a simpler answer to your problem which does not require storing the password in a binary.

char阵列C&#x2b;&#x2b;无法删除|使用过程黑客仍然可以使用转储

缺⑴份安定 2025-02-18 01:54:40

”此处复制

(从a .cpp 文件中使用我的所有功能,无论它们是模板函数还是常规功能。并且有一种方法可以使用一些基本 #ifndef 魔术。这是您可以做的:

main.cpp

#include "myclass.hpp"

int main()
{
  // ...
}

myclass.hpp

#ifndef MYCLASS
#define MYCLASS

template<class T>
class MyClass
{
  T val;
public:
  MyClass(T val_);
}

#define MYCLASS_FUNCTIONS
#include "myclass.cpp"

#endif

myclass.cpp

#ifndef MYCLASS_FUNCTIONS
#include "myclass.hpp"

// regular functions:
// ...

#else
 
// template functions:
template<class T>
MyClass<T>::MyClass(T val_)
    :val(val_)
{}

// ...
#endif

这是预编译器如何看待它。我们有两个 .cpp 文件。

  1. 当我们编译main.cpp时,我们:
  2. include myClass.hpp
  3. 检查 myClass 不确定,它是
  4. 定义的,它
  5. 为编译器提供了生成类的定义(来自模板类)
  6. 包括 myClass.cpp
  7. 定义 myClass_functions
  8. 检查是否定义了 myClass_functions ,它是定义的,
  9. 给出了编译器的定义(从模板函数)
  10. 在我们时 compile myclass.cpp
  11. 检查是否定义了 myClass_functions ,它不
  12. 包括 myClass.hpp
  13. 检查 myclass not n defined n n
  14. dewindine
  15. 给编译器类的定义
  16. 包括 myClass.cpp
  17. include myClass.hpp ye Reme
  18. this Time myClass 定义了什么都不在内部做任何事情,请返回<<代码> myClass.cpp
  19. 检查是否定义了 myClass_functions ,它为
  20. 编译器提供了生成的函数的定义(来自模板函数)
  21. 退出包括两次
  22. 通过到编译器的所有常规函数

(copying here from a closed duplicate)

I prefer to have all of my functions in the .cpp file, regardless of whether they are template functions or regular functions. And there is a way to do that with some basic #ifndef magic. Here's what you can do:

main.cpp

#include "myclass.hpp"

int main()
{
  // ...
}

myclass.hpp

#ifndef MYCLASS
#define MYCLASS

template<class T>
class MyClass
{
  T val;
public:
  MyClass(T val_);
}

#define MYCLASS_FUNCTIONS
#include "myclass.cpp"

#endif

myclass.cpp

#ifndef MYCLASS_FUNCTIONS
#include "myclass.hpp"

// regular functions:
// ...

#else
 
// template functions:
template<class T>
MyClass<T>::MyClass(T val_)
    :val(val_)
{}

// ...
#endif

Here's how the precompiler sees it. We have two .cpp files.

  1. When we compile main.cpp we:
  2. include myclass.hpp
  3. check that MYCLASS is undefined, and it is
  4. define it
  5. give compiler the definitions of the generated class (from template class)
  6. include myclass.cpp
  7. define MYCLASS_FUNCTIONS
  8. check if MYCLASS_FUNCTIONS is defined, it is
  9. give compiler the definitions of the generated functions (from template functions)
  10. When we compile myclass.cpp
  11. check if MYCLASS_FUNCTIONS is defined, it isn't
  12. include myclass.hpp
  13. check that MYCLASS is undefined, and it is
  14. define it
  15. give compiler the definitions of the class
  16. include myclass.cpp
  17. include myclass.hpp again
  18. this time MYCLASS is defined so do nothing inside, return to myclass.cpp
  19. check if MYCLASS_FUNCTIONS is defined, it is
  20. give compiler the definition of the generated functions (from template functions)
  21. exit include twice
  22. pass to the compiler all the regular functions

为什么仅在标题文件中实现模板?

缺⑴份安定 2025-02-17 09:07:28

剪接返回一个数组,因此您需要从中实际检索值,因此 [0]

splice returns an array, so you need to actually retrieve the value from it, hence the [0].

https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Array/splice

有人知道含义和他的含义吗?

缺⑴份安定 2025-02-17 05:26:36

除了@martin prikryl提案外,我们还可以动态地覆盖标准 Storbinary()方法。

首先定义 new_storbinary()方法:

try:
    import ssl
except ImportError:
    _SSLSocket = None
else:
    _SSLSocket = ssl.SSLSocket

def new_storbinary(self, cmd, fp, blocksize=8192, callback=None, rest=None):

  self.voidcmd('TYPE I')
  with self.transfercmd(cmd, rest) as conn:
    while 1:
      buf = fp.read(blocksize)
      if not buf: break
      conn.sendall(buf)
      if callback: callback(buf)
    # shutdown ssl layer
    if _SSLSocket is not None and isinstance(conn, _SSLSocket):
      # HACK: Instead of attempting unwrap the connection, pass here
      pass
  return self.voidresp()

然后在实例级别替换该方法,使用 types 模块:

import types
ftps = ftplib.FTP_TLS()
ftps.storbinary = types.MethodType(new_storbinary, ftps)

请注意, retrbinary() retrines() storlines()方法也可能受到影响

In addition to @Martin Prikryl proposal, we can override the standard storbinary() method dynamically.

First define new_storbinary() method :

try:
    import ssl
except ImportError:
    _SSLSocket = None
else:
    _SSLSocket = ssl.SSLSocket

def new_storbinary(self, cmd, fp, blocksize=8192, callback=None, rest=None):

  self.voidcmd('TYPE I')
  with self.transfercmd(cmd, rest) as conn:
    while 1:
      buf = fp.read(blocksize)
      if not buf: break
      conn.sendall(buf)
      if callback: callback(buf)
    # shutdown ssl layer
    if _SSLSocket is not None and isinstance(conn, _SSLSocket):
      # HACK: Instead of attempting unwrap the connection, pass here
      pass
  return self.voidresp()

Then replace the method at the instance level, using types module :

import types
ftps = ftplib.FTP_TLS()
ftps.storbinary = types.MethodType(new_storbinary, ftps)

Please note that retrbinary(), retrlines() and storlines() methods may also be affected

ftplib ftps的ftplib Storbinary正在悬挂/永不完成

缺⑴份安定 2025-02-16 17:24:38

我发现我做错了什么,它是the the的CLI,而不是Solana CLI

spl-token wrap 1

I found what I was doing wrong, it is spl-token cli, not Solana cli

spl-token wrap 1

如何用Solana CLI包裹Sol?

缺⑴份安定 2025-02-16 11:36:03

简短答案:对您的两个问题是的。

答案稍长:.NET 4是一个就地的升级,这意味着每个升级都在同一文件位置覆盖以前的版本,因此只安装了一个版本。如果您在服务器上安装了.NET 4.7框架,则代码是否针对4.5或4.6.2或4.7。

注意:我将安装.NET 4.8,因为这是最后一个最新版本的最新版本。

Short answer: yes to both your questions.

Slightly longer answer: .NET 4 is an in-place upgrade which means that each upgrade overwrites the previous version in the same file location so that there is only ever one version installed. If you had .NET 4.7 framework installed on your server then your code will work regardless if it targets 4.5 or 4.6.2 or 4.7.

Note: I would install .NET 4.8 as that is the last, most up to date version.

.NET 4.6.2与.NET 4.7兼容吗?

缺⑴份安定 2025-02-15 07:46:42

我正在尝试实施类似的事情,但预测一个类似的问题,前端会变得凌乱。因此,在我的情况下,我将尝试在后端存储哈希图像。

如果您仅使用NextJ,则可以尝试在NextJS Backend中执行此操作。
我认为您可以从杰克·赫林顿(Jack Herrington) https://www.youtube.com/watch?v=ffhsiio4acu&amp; t = 803S

I am trying to implement a similar thing, but predict a similar issue and frontend will get messy. So, I will try to store the hash images in the backend, in my case, using my cms.

If you are using only nextjs, you can try to do that in nextjs backend.
I think you can get the inspiration on how to do that from the below video by Jack Herrington https://www.youtube.com/watch?v=FfHsIio4aCU&t=803s

当我使用plaiceholder插件在NextJ中模糊图像时,为什么有更多图像时会崩溃?

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文