Category: Web Application Development
-
Post Views: 11 1. Based onhttps://github.com/Filsh/yii2-oauth2-server实现; Run: php composer.phar require –prefer-dist filsh/yii2-oauth2-server “*” 2. Configure in the application: E:\wwwroot\api.hmwis.com\passport\config\main.php Modules=>[ oauth2=> [ class=>FILSH\Yii2\OAuth2Server\Module, tokenparamname=>accessToken, TokenAccessLifeTime=> 3600 * 24, StorageMap=> [ user_credentials=>common\models\user, ]#ATFP_CLOSE_Translate_span#, GrantTypes=>[ user_credentials=> [ class=>oauth2\grantType\usercredentials, ]#ATFP_CLOSE_Translate_span#, refresh_token=>[ class=>oauth2\grantType\refreshtoken, Always_issue_new_refresh_token=> true ]#ATFP_CLOSE_Translate_span# ] ], v1=>[ class=>passport\modules\v1\module, ]#ATFP_CLOSE_Translate_span#, ], 3. Edit the user model class User.php: E:\wwwroot\api.hmwis.com\common\models\user.php Implement the interface\OAuth2\Storage\UserCredentialsInterface Class…
-
Post Views: 12 1. The address of the REST API application with OAuth2 Server on Yii2:https://github.com/ikaras/yii2-oauth2-rest-template 2. Run the command: php application/api/yiic migrate –migrationpath=@vendor/filsh/yii2-oauth2-server/migrations –interactive=0 \ Error: 3. Modify the file: \yii2-oauth2-rest-template\vendor\filsh\yii2-oaut h2-server\migrations\m140501_075311_add_oauth2_server.php 4. Run the command again: php application/api/yiic migrate –migrationpath=@vendor/filsh/yii2-oauth2-server/migrations –interactive=0\ , normal operation:
-
Post Views: 5 1. Open the URL,http://www.yiiframework.com/download/,根据提示执行升级: 2. Execute the command: php composer.phar require yiisoft/yii2 2.0.6, report an error: [UnexpectedValueException] Could not parse version Constraint <=2.*: Invalid version string “2.*” 3. Execute commands one after another: composer self-update, composer global update; 4. Execute the command again: composer global update; 5. Execute the command again: php composer.phar require yiisoft/yii2 2.0.6, the…
-
Post Views: 13 1. The $QUERY code implements screenshots: 2. Error: sqlstate[HY093]: Invalid parameter number: number of bound variables not match number of tokens\nthe sql being executed was 3. After the $query is modified, the screenshot is realized, and the $query->addParams is cancelled: 4. $Query is successfully implemented
-
Post Views: 11 1. Screenshot of the code that can be verified successfully under Windows 8.1: 2. When the RESTClient test under FIFEFOX of CentOS, the verification fails: 3. Analyze the code and find that the loading intl extension failed: 4. Run the command on CentOS: yum install php-intl to install the intl extension: 5. The intl installation is successful,…
-
Post Views: 14 1. Create a token on github; 2. The prompt creation is successful (all check boxes are selected), you need to save it to the local, and use it during installation; 3. During the installation command, you need to enter the token just generated; 4, :
-
Post Views: 12 Because passport.xxx.com and soft.xxx.com are two secondary subdomains of xxx.com, in the case of both processing exit status, the Send a synchronization login notification through ucenter to realize login, but in many cases, passport.xxx.com and soft.xxx.com may One is the login status, the other is the logout state; at this time, you need to realize the synchronization…
-
Post Views: 14 Solution process: Add the following method to phpsso_server/api/uc.php class uc_note: //update client cache function updateClient($get, $post) { if(!api_updateClient) { return api_return_forbidden; } $cacheFile = dirname(__file__)./uc_client/data/cache/settings.php; $fp = fopen($cachefile,w); $s = “<?php\r\n”; $s .=$_cache[\’settings\’]=.var_export($post, true).”;\r\n”; fwrite($fp, $s); fclose($fp); return api_return_succeed; } Check the PHPSSO_SERVER\API\UC_Client\Data\Cache\Settings.php file and find that the update has been successful:
-
Post Views: 10 The screenshot of the avatar cannot be displayed, on the active user page,http://zhidao.hmwis.com/user/activelist.html: Solution: lib/global.func.php function get_avatar_dir //return $setting[‘ucenter_url’]./avatar.php?uid=. $UID .&size=middle; @Include TiPask_root ./data/ucconfig.inc.php; return UC_API ./avatar.php?uid=. $UID .&size=middle; The reason is: $setting[‘ucenter_url’]Empty! After solving, the screenshot is as follows: