Author Archives: Robins

[Solved] axios Configurate baseURL Error: Uncaught TypeError: Cannot set properties of undefined (setting ‘baseURL’)

Problem: the Axios configuration baseurl reported an error

Solution:

Reinstall the old version of Axios

npm i [email protected] -S

OVER~

After checking, it is determined that there is no problem with the writing method, and clearing the cache is invalid.

I thought of upgrading my browser two days ago, so I changed my browser, but I still reported an error.

Uninstallation reinstallation is invalid.

npm i axios -S

NPM I Axios installs the latest version by default

So back to the previous version

I searched the information for a long time and didn’t find why I reported an error. Let’s continue the development first~

[Solved] Err:12 http://security.ubuntu.com/ubuntu focal-updates/main amd64 openjdk-11-jre-headless amd64 11.0.11+9-0ubuntu2~20.04 404 Not Found [IP: 91.189.88.152 80]

Err:12 http://security.ubuntu.com/ubuntu Focal-updates/main amd64 openjdk-11-jre-headless amd64 11.0.11+9-0ubuntu2~20.04
404 Not Found [IP: 91.189.88.152 80]

apt install openjdk-11-jre-headless  ## The following error is reported when installing the java environment

2. Solution

apt update

3. Testing

apt install openjdk-11-jre-headless -y
root@DESKTOP-1N42TVH:/home/software/frontend# java --version
openjdk 11.0.13 2021-10-19
OpenJDK Runtime Environment (build 11.0.13+8-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.13+8-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)

[Solved] Sping controller Receives list entity parameter Error: nested exception is java.lang.IndexOutOfBoundsException: Index: 256, Size: 256

When the controller in spin receives entity parameters
if there is a list attribute in the entity, an error will be reported when the list value is too large

public class Model{
    private List<String> strings;
}

Error Messages: “Invalid property ‘rynrlist[256]’ of bean class [com.ac.intellsecurity.model.exam.records.ExamTrainingRecordsModel]: Index of out of bounds in property path ‘rynrlist[256]’; nested exception is java.lang.IndexOutOfBoundsException: Index: 256, Size: 256”

Reason:

Solution:
1. modified into jsonobject to receive parameters and then converted into an entity (recommended)

@RestController
@RequestMapping("/controller")
public class Controller {

    //Before Modified
    @PostMapping("/addModel")
        public AjaxResult addModel(Model model){
        //.........
    }

    //Modified
    @PostMapping("/addModel")
    public AjaxResult addModel(JSONObject json){
        //.........
        Model model = JSONObject.parseObject(json.toJSONString(),Model.class);
    }
}    

2. Add method in controller

@InitBinder
protected void initBinder(WebDataBinder binder) {
    binder.setAutoGrowNestedPaths(true);
    binder.setAutoGrowCollectionLimit(1024);
}

 

Quartz Error: qrtz_locks doesn’t exist [How to Solve]

Problem Description: qrtz_locks doesn’t exist

Quartz supports data persistence, so if autowire is assembled automatically, create org springframework. scheduling. quartz. The schedulerfactorybean will automatically inject the database datasource into the database, so that quartz will report an error because it thinks it will persist the data.

Solution: whether spring’s default autowire is set to “autodetect” or “byname”, a * QRTZ_LOCKS’ doesn’t exist

Method 1: do not use the default autowire attribute;

Method 2: set autowire = “no” to schedulerfactorybean without changing the spring default autowire attribute.

<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean" autowire="no">
    <property name="triggers">
        <list>
            <ref bean="simpleTriggerBean" />
        </list>
    </property>
</bean>

Normally, it will display org quartz.core.Quartzscheduler runs locally, uses memory, and does not support persistence.

[Solved] TypeError: Property value expected type of string but got null

Problem Description: the unapp compilation applet reports an error, but there is no problem on the H5 and app side

15:57:47.609 TypeError: Property value expected type of string but got null
15:57:47.609     at Object.validate (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\@babel\types\lib\definitions\utils.js:160:13)
15:57:47.615     at validateField (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\@babel\types\lib\validators\validate.js:24:9)
15:57:47.621     at validate (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\@babel\types\lib\validators\validate.js:17:3)
15:57:47.621     at builder (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\@babel\types\lib\builders\builder.js:38:27)
15:57:47.629     at Object.StringLiteral (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\@babel\types\lib\builders\generated\index.js:350:31)
15:57:47.629     at parseEventByCallExpression (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\event.js:177:30)
15:57:47.642     at D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\event.js:318:15
15:57:47.643     at Array.forEach (<anonymous>)
15:57:47.651     at D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\event.js:317:28
15:57:47.651     at Array.forEach (<anonymous>)
15:57:47.662     at parseEvent (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\event.js:258:15)
15:57:47.662     at _processEvent (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\event.js:436:9)
15:57:47.670     at processEvent (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\event.js:497:5)
15:57:47.671     at D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\index.js:34:5
15:57:47.678     at Array.forEach (<anonymous>)
15:57:47.686     at traverseData (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\index.js:33:13)
15:57:48.873 Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js):

The reason is that I used uview’s anti shake in the code and passed the parameters

<view @tap="$u.throttle(goGoodsDetai(item.id, item.supplierId),500)">

If parameters are not transmitted, it is normal

<view @tap="$u.throttle(goGoodsDetai,500)">

CentOS Error: Failed to set locale, defaulting to C

-bash: local: can only be used in a function
[root@VM-24-5-centos ~]# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE=UTF-8
LC_NUMERIC=”en_US.UTF-8″
LC_TIME=”en_US.UTF-8″
LC_COLLATE=”en_US.UTF-8″
LC_MONETARY=”en_US.UTF-8″
LC_MESSAGES=”en_US.UTF-8″
LC_PAPER=”en_US.UTF-8″
LC_NAME=”en_US.UTF-8″
LC_ADDRESS=”en_US.UTF-8″
LC_TELEPHONE=”en_US.UTF-8″
LC_MEASUREMENT=”en_US.UTF-8″
LC_IDENTIFICATION=”en_US.UTF-8″
LC_ALL=
[root@VM-24-5-centos ~]# echo “export LC_ALL=en_US.UTF-8” >> /etc/profile
[root@VM-24-5-centos ~]# source /etc/profile
[root@VM-24-5-centos ~]#

Task :app:lintVitalRelease FAILED [How to Solve]

Task :app:lintVitalRelease FAILED

Error message:
task: app: lintvitalrelease failed

Cause of problem:
dl google. Com can’t connect, or there is a problem with the code. I can’t go to this to see the log myself

Solution:

1. Modify hosts (recommended)
find the ip of dl.google.com through the ip-check-online website

2. Add in gradle Android

android{
  lintOptions{
     checkReleaseBuilds false
     abortOnError false
  }
}

Vue: How to use Vue-router in Axios

background

When writing the home page of the test platform, I want to implement the route jump function in the click event of the histogram of echarts, and directly use this.$router.Push() an error will be reported: uncaught typeerror: cannot read property 'push' of undefined

Solve the pit encountered

First of all, I think about whether I can import the routing instance directly to see if it is OK:

import Router from 'vue-router';

Then jump like this:

Router.push(`/projects_list`)

Results:

Uncaught TypeError: vue_router__WEBPACK_IMPORTED_MODULE_2__.default.push is not a function

It is found that the imported route is empty:

Successfully solved

If you can’t use it directly, can you import the previous routing instances in Src/router/index ?Because this routing instance is the route passed in to the Vue instance in main, so:

import Router from '../../router/index.js'

Results:

Successful jump