Category: Yii
-
Post Views: 14 1. In the domain name:http://editorweb.wjdev.chinamcloud.cnInterface in request:http://api.pcs.wjdev.chinamcloud.cn/v1/plan-tasks/274?login_id=2e368664c41b8bf511bcc9c65d86dbc3&login_tid=b26398238620e8cd15b0155cd7aee9b2, in response to 404 , the “Access-Control-Allow-Origin” header does not exist on the requested resource. as shown in Figure 1 Decide to implement a front-end AJAX request example in the local environment by yourself 3, POST request, response 200, but no response data. as shown in Figure 2 4. Refer to the cross-domain resource sharing CORS mechanism:https://www.yiiframework.com/doc/guide/2.0/zh-cn/structure-filters#cors, add the Cross-Origin Resource Sharing filter to the controller 5. POST request again, in response to 200, the console in the browser successfully outputs the code of the response data. Figure 3, Figure…
-
Post Views: 19 1. In Postman, the details of the specified resource of the GET request, the response is 200, as shown in Figure 1 2. Check the routing configuration, the code is as follows 3. Check the controller, the code is as follows 4. Details of the specified resource for the POST request in Postman, the response is 404, as shown in Figure 2 5. Adjust the routing configuration, get /plan-tasks/79 and post /plan-tasks/79: return the details of resource ID 79 6. POST requests the details of the specified resource in Postman, the response 405, the method that is…
-
Post Views: 13 1. When executing the Composer Update, the prompt: Package Codeception/Base is abandoned, you should avoid using it. No Replacement was Suggested., as shown in Figure 1 2. Since I am using the Yii 2 advanced project template, look at composer.json on github, and find that there are no dependencies: codeception/base, refer to:https://github.com/yiisoft/yii2-app-advanced/blob/2.0.35/composer.json, as shown in Figure 2 3. In the local environment, composer.json is still dependent: codeception/base, as shown in Figure 3 4. Change the composer.json file to match the composer.json on github 5. Execute the Composer Update again to update the development dependency to the latest…
-
Post Views: 14 1, CMCConsoleUser/ActionSync, existing implementation, reference:https://www.shuijingwanwq.com/2020/03/02/3964/, now need to add parameters: tenant ID 2. The parameter will be passed to the action method corresponding to the requested subcommand. Set the default value of the parameter $groupid to null 3. Determine whether the $groupId is empty, if it is not empty, and it does not exist in $HttpCMCAPiGroupIds, it successfully exits 4. Based on the chronological arrangement of the last synchronization, assign the value to: $sortcmCapiGroupIds, the array before and after printing the sorting 5. Now it is necessary to synchronize the users under this tenant based on the…
-
Post Views: 13 1. The request interface, the total number of resources in the response parameters is 30. Resources containing ids equal to 37918 are duplicates. A total of 2. as shown in Figure 1 2. Check the model class, /common/models/redis/cmc_console/user.php 3. Check /common/components/redis/activerecord.php , which defines the prefix and applies to all AR keys. 4. Open RedisDesktopManager, check the total number of users, and determine it to 29, as shown in Figure 2 5. Open RedisDesktopManager, and determine that the primary key value is 37918 to be 1, which is not repeated. as shown in Figure 3 6. Check…
-
Post Views: 11 1. When multiple database connection components have been added in Yii 2.0 2. The strategy to migrate multiple databases is to store the migration to different directories. A connection component corresponds to a directory. DB directory: /console/migrations/. Directory of statdb: /console/migrations/stat_db/. as shown in Figure 1 3. When generating the migration file under statdb, you need to specify: –migrationpath=@console/migrations/stat_db/ , as shown in Figure 2 4. Then you can migrate different databases through the following commands. The first command will submit the migration under the /console/migrations/ directory to the db database, and the second command will submit…
-
Post Views: 17 1. When multiple database connection components have been added in Yii 2.0 2. When statdb is selected for the database connection ID, only the data table under statdb will appear in the drop-down list of the table name, as shown in Figure 1 3. When the model file under statdb is generated, getdb() is additionally generated, as shown in Figure 2 4. When DB is selected for the database connection ID, the data table under dB does not appear in the drop-down list of the table name. Therefore, you need to fill in the corresponding information manually.…
-
Post Views: 15 1. Edit .gitignore and add /vendor to the git warehouse, as shown in Figure 1 2. Failed to build in Jenkins, check Console output. as shown in Figure 2 3. Docker deployment, delete the composer install. Edit Dockerfile. as shown in Figure 3 4. Build successfully in Jenkins. as shown in Figure 4 5. Failed to start in Rancher, check the log. as shown in Figure 5 6. Edit build/c_files/config/init/console_init.sh. Delete the related commands for $PCS_API_CFG_MIGrate == “true”. as shown in Figure 6 7. Start successfully in Rancher, check the log. as shown in Figure 7 8.…
-
Post Views: 14 1. In the previous release interface, only one channel is supported for a release. Therefore, the release of the three channels needs to call the interface (APP, Netease account, Weibo) 3 times respectively, as shown in Figure 1 2. On the current release interface, it is ready to publish at one time and can be published on multiple channels, as shown in Figure 2 3. In the channel publishing interface, the task (article) release of each channel is isolated, and it is not supported in one release, and is published to multiple channels, as shown in Figure…