Tag Archives: record

[Solved] Postcss Error: Invalid options object. PostCSS Loader has been initialized using an options object that does not match the API schema.

This error occurs when packaging with postcss:   Invalid options object. PostCSS Loader has been initialized using an options object that does not match the API schema.

I’ve been searching for information for a long time because the versions are incompatible,

Solution: create a new postcss.config.js file under the root directory

The file configuration is as follows

module.exports={
    plugins:[
        require("postcss-preset-env")
    ]
}

Then delete the options in webpack.config.js and package again.

Sending ‘const NSString *__strong‘ to parameter of type ‘NSString *‘ discards qualifiers

String value encountered a warning message, record it

Sending 'const NSString *__strong' to parameter of type 'NSString *' discards qualifiers

The code is written like this

UIKIT_EXTERN const NSString * kNetworkType;

This warning will be issued when using it, and it will be changed to:

UIKIT_EXTERN NSString * const kNetworkType;

If const is placed after nsstring *, there will be no warning.

ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked.

  Time: May 8, 2021 14:22:35

ERROR Error: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'true'. Current value: 'false'.. Find more at https://angular.io/errors/NG0100
    at throwErrorIfNoChangesMode (core.js:6792)
    at bindingUpdated (core.js:12940)
    at Module.ɵɵproperty (core.js:14740)
    at InvoiceManagementComponent_Template (invoice-management.component.html:55)
    at executeTemplate (core.js:9600)
    at refreshView (core.js:9466)
    at refreshComponent (core.js:10637)
    at refreshChildComponents (core.js:9263)
    at refreshView (core.js:9516)
    at refreshEmbeddedViews (core.js:10591)

The meaning of the problem is that once the page is rendered, don’t change it. If you change it again, I will report you an error. And that’s it.

Solution: add a line of code to the ngafterviewinit() method

  ngAfterViewInit(): void {
    this.changeDetectorRef.detectChanges();
  }

This only needs to be declared in the constructor

  constructor(
    public changeDetectorRef: ChangeDetectorRef
  ) { }

 

Idea always reports errors when using “SVN” to associate projects Error:Cannot run Program “SVN” (in directory “path XXXXXX”): CreateProcess error = 2,

 

Using the new project tool idea interface to import SVN project, an error is reported

Error:Cannot run Program “SVN” (in directory “path XXXXXX”): CreateProcess error = 2 the system cannot find the specified file.

Error performing cleanup for cannot run program CreateProcess error = 2, cleanup/history/update all report errors.

The main reason for the error is that I didn’t install the command command when installing SVN. Just re install it.

1. Open SVN installation tool


Just go to the next step to install.

2. Re open idea to automatically match svn.exe Orders.

Click checkout to complete

Spring security failed to log in, error: there is no passwordencoder mapped for the ID “null”

After writing the websecurityconfig class that inherits the websecurityconfigureradapter class, we need to define authentication in the configure (authentication manager builder auth) method, which is used to obtain information sources and password verification rules. (the name of the configure function doesn’t matter. The official name seems to be configureglobal (…) )It is important to configure the authenticationmanagerbuilder in the class annotated by @ enablewebsecurity or @ enableglobalmethodsecurity or @ enableglobalauthentication).

The source of authentication information I used at the beginning was in memory authentication. The code is as follows

 
    protected void configure (authentication manager auth) throws exception { // inmemoryauthentication gets from memory auth.inMemoryAuthentication ().withUser("user1").password("123456").roles("USER"); }

The login page of spring security is used. As a result, when logging in, the user name and password are correct, and the resource cannot be opened, so it still stays on the login page. There is no passwordencoder mapped for the ID "null".

Baidu found that this is because spring security 5.0 added a variety of encryption methods, but also changed the password format.

Let's take a look at the official documents. Here are the original words of the official documents:

 

-------------------------------------------------------------------------------------------------------------------

The general format for a password is:

{id}encodedPassword

Such that id is an identifier used to look up which PasswordEncoder should be used and encodedPassword is the original encoded password for the selected PasswordEncoder. The id must be at the beginning of the password, start with { and end with }. If the id cannot be found, the id will be null. For example, the following might be a list of passwords encoded using different id. All of the original passwords are "password".

{bcrypt}$2a$10$dXJ3SW6G7P50lGmMkkmwe.20cQQubK3.HZWzG3YB1tlRy.fqvM/BG 
{noop}password 
{pbkdf2}5d923b44a6d129f3ddf3e3c8d29412723dcbde72445e8ef6bf3b508fbf17fa4ed4d6b99ca763d8dc 
{scrypt}$e0801$8bWJaSu2IKSn9Z9kM+TPXfOc/9bdYSrN1oD9qfVThWEwdRTnO7re7Ei+fUZRJ68k9lTyuTeUp4of4g24hHnazw==$OAOec05+bXxvuu/1qZ6NUR+xQYvYv7BeL1QxwRpY5Pc=  
{sha256}97cde38028ad898ebc02e690819fa220e88c62e0699403e94fff291cfffaf8410849f27605abcbc0

-------------------------------------------------------------------------------------------------------------------

 

The storage format of passwords in spring security is "{ID}.....". The front ID is the encryption method, the ID can be bcrypt, sha256, etc., followed by the encrypted password. In other words, when the program gets the passed password, it will first find the ID included by "{" and "}" to determine how the subsequent password is encrypted. If it cannot be found, it will be considered that the ID is null. This is why our program will report an error: there is no passwordencoder mapped for the ID "null". In the example of official documents, various encryption methods are used to encrypt the same password. The original password is "password".

 

If we want our project to log in normally, we need to modify the code in configure. We need to encrypt the password from the front end in some way. Spring security officially recommends using bcrypt encryption. So how to encrypt the password?Just specify it in the configure method.

After modification, it looks like this:

 
    protected void configure (authentication manager auth) throws exception { // inmemoryauthentication gets from memory auth.inMemoryAuthentication ().passwordEncoder(new BCryptPasswordEncoder()).withUser("user1").password(new BCryptPasswordEncoder().encode("123456")).roles("USER"); }

After inmemoryauthentication(), there is ". Passwordencoder (New bcryptpasswordencoder())", which is equivalent to using bcrypt encryption to process the user password when logging in. The previous ". Password (" 123456 ")" is changed to ". Password (New bcryptpasswordencoder(). Encode (" 123456 ")", which is equivalent to bcrypt encoding and encryption of the password in memory. The comparison is consistent, which indicates that the password is correct and login is allowed.

If you are also using the password from the memory, then according to the above modification should be successful login, no problem.

If you use to store the user name and password in the database, you usually use bcrypt code to encrypt the user password and store it in the database. And modify the configure() method, add ". Passwordencoder (New bcryptpasswordencoder())" to ensure that users use bcrypt to process the password when they log in, and then compare it with the password in the database. As follows:

 
    // inject the implementation class of userdetailsservice auth.userDetailsService (userService).passwordEncoder(new BCryptPasswordEncoder());
     

reprint https://blog.csdn.net/canon_ in_ d_ major/article/details/79675033

[problem record] objc_ Too many arguments to function call

Objc_msgSend can be used with arguments before Xcode 6. Too many arguments to function call after Xcode 6. ;
The solution

Build Settings -> Enable Strict Checking of objc_msgSend Calls to NO.
br>
<>nt>

this method fails in Xcode 12.
2, Through type casting

((void (*)(id, SEL, id))objc_msgSend)(target, sel, value);

The number of parameters to be passed is self-defined