Summary of gin-vue-admin problems encountered

Using the gin-vue-admin framework, summarize the problems encountered:

1. Get the passed parameters, get with ShouldBindQuery, DELETE, POST, PUT with ShouldBindJSON

2. The background can get the parameters of the foreground, and an empty list is returned, it may not be an interface problem, it may be a data problem.

3. Add a new field: In server\model, the corresponding file, add a field, and then run, a new field will be added to the database

4. Change get to post where you need to modify:

     1. web\api, the corresponding js file

     2. server\api\v1  , ShouldBindQuery改成 ShouldBindJSON

    3. Interface, api management module under super administrator, changed to post

    4. server\router, the corresponding file

5. 400 error, there may be no correspondence between post and get, such as Router.GET in the background router file, and method:'post' in the foreground.

6. The date queried by the SQL statement in the database is normal. When it arrives at the front desk, it will be displayed as 0001-01-01T00:00:00Z. That is because the date does not exist. It may be a case of capitalization. For example, rectime in the SQL statement, RecTime time.Time in the code `json:"recTime" gorm:"column:recTime"`

7. The page is blank: The calling interface is normal, and the list can also be returned to the front desk. The page is blank. It may be that the binding data of the front page is wrong. Comment out the wrong place and you can access it normally.

8. The page is blank: The calling interface is normal, and the list can also be returned to the foreground. The page is blank. It may be that the method in the public module called by the page is missing. For example, add a date method to web\src\utils\data.js. For some reason, this method is no longer available, so the page that calls this method will be blank. It will also cause a series of errors, such as:

1、Error in render: "TypeError: Cannot read property 'toFixed' of undefined"  

2、 Error in render: "TypeError: Cannot read property 'toFixed' of undefined"  

3.、vue.runtime.esm.js:619 [Vue warn]: Error in render: "TypeError: Cannot read property 'toFixed' of undefined"

9. Access to XMLHttpRequest at 'http://localhost:8080/sockjs-node/info?t=1595401479724' from origin 'http://localhost:8082' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

For this error, delete the api and recreate it. There may be spaces in the path.

 

 

 

Guess you like

Origin blog.csdn.net/orangapple/article/details/106814587