精华内容
下载资源
问答
  • jdk-8u211-windows-x64.exe

    热门讨论 2019-04-19 09:48:49
    jdk-8u211-windows-x64.exe 截至2019.04.19 最新版JDK for windows 64位 安装包 sha256: f46be98d14a2b2d0451a005624b28e6b86a56fa96f580c4963b5eded2ba09fc3 md5: c85aabf87700d59296eb5eb715d23ccc 请不要给我5星...
  • jdk-8u211-linux-x64.tar.gz

    热门讨论 2019-04-19 09:59:57
    jdk-8u211-linux-x64.tar.gz 截至2019.04.19 最新版JDK for linux 64位 .tar.gz 安装包 tar.gz文件的检验码: sha256: c0b7e45330c3f79750c89de6ee0d949ed4af946849592154874d22abc9c4668d md5: e8fc44a4be6d6b5c...
  • jdk-8u131-linux-x64.tar.gz

    热门讨论 2017-05-09 10:31:59
    jdk-8u131-linux-x64.tar.gz 截至2017.05.08 最新版JDK For Linux x64 gar.gz sha256: 62b215bdfb48bace523723cdbb2157c665e6a25429c73828a32f00e587301236 md5: 75b2cb2249710d822a60f83e28860053 大小:176.95 MB
  • JDK-1.6u45-Windows 32位

    万次下载 热门讨论 2014-05-05 14:23:23
    JDK 1.6U45最终版本,Windows版 32位,以备大家不时之需。 (这是我很久之前无意之中放上来的,现在编辑也改不了下载所需积分了,大家多包涵。)
  • jdk-8u91-windows-x64.exe

    千次下载 热门讨论 2016-04-20 10:42:44
    jdk-8u91-windows-x64.exe java jdk-8u91 windows x64 .exe 截至2016.04.20 最新版JDK For windows x64 .exe sha256: 3f34e5f2f142e4ad560539384d62fe0171bf05f62256976c4f9da60113f59849 md5: 61aecb9c7720f4db8c...
  • jdk-8u91-linux-x64.tar.gz

    千次下载 热门讨论 2016-04-20 12:35:37
    jdk-8u91-linux-x64.tar.gz java jdk-8u91 linux-x64 .tar.gz 截至2016.04.20 最新版JDK For Linux x64 gar.gz sha256: 6f9b516addfc22907787896517e400a62f35e0de4a7b4d864b26b61dbe1b7552 md5: 3f3d7d0cd70bfe0...
  • 用友U8视频教程全集(全模块)

    万人学习 2017-07-23 19:17:08
    以用友U8 12.0为题材,包含U8全部功能模块。不停留在U8软件操作,深入业务流程实现,融入企业管理之中。讲师具有20多年跨行业企业信息管理经历。实战辅导数十家企业。
  • java jdk-8u65-windows-x64.exe

    千次下载 热门讨论 2015-11-03 11:15:02
    jdk-8u65-windows-x64.exe java jdk 8u65 for windows x64 截至2015.11.03 最新版JDK For windows x64 sha256: 589633b8688ef7331a861a6d87487a82ed40bc6c287c4c567c4f91737c5011d5 md5: c497b2e943ab0c5486ec40becf...
  • 用友U8视频教程全集(采购管理)

    千人学习 2017-07-31 10:48:10
    用友u8采购管理,从软件操作到业务流程,到管理思路。
  • jdk-8u77-linux-x64.tar.gz

    热门讨论 2016-03-30 14:35:42
    jdk-8u77-linux-x64.tar.gz 截至2016.03.30 最新版JDK For Linux x64 gar.gz sha256: a47dc0962a57b27a0cc00b9f11a53dc3add40c98633ba49a2419b845e4dedf43 md5: ee501bef73ba7fac255f0593e595d8eb 大小:172.96 MB
  • jdk1.7 64位官方版 jdk-7u79-linux-x64.tar.gz

    万次下载 热门讨论 2015-10-14 11:18:19
    jdk1.7 64位官方正式版 jdk-7u79-linux-x64.tar.gz
  • java jdk-8u65-linux-x64.tar.gz

    千次下载 热门讨论 2015-11-06 10:21:07
    jdk-8u65-linux-x64.tar.gz java jdk 8u65 for Linux x64 tar.gz 截至2015.11.03 最新版JDK For Linux x64 tar.gz sha256: 88db2aacdc222c2add4d92822f528b7a2101552272db4487f33b38b0b47826e7 md5: 196880a42c45ec9...
  • M1卡破解工具集合(ACR122U读卡器)

    热门讨论 2016-01-27 13:27:58
    里面集合了ACR122U读卡器破解M1卡的全部工具,比论坛上一哥们的10分值。里面有他全部内容,还增加了“M1服务程序”等工具。
  • jdk-8u111-linux-x64.tar.gz

    千次下载 热门讨论 2016-11-10 10:14:39
    截至2016.11.08 最新版JDK For Linux x64 gar.gz sha256: 187eda2235f812ddb35c352b5f9aa6c5b184d611c2c9d0393afb8031d8198974 md5: 2d48badebe05c848cc3b4d6e0c53a457 大小:173.04 MB
  • jdk1.7 64位官方正式版 jdk-7u79-windows-x64

    千次下载 热门讨论 2015-06-02 17:57:28
    JDK7 稳定版 源官方下载地址: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
  • jdk1.7 32位官方正式版 jdk-7u79-windows-i586 下载

    千次下载 热门讨论 2015-06-02 17:46:00
    jdk-7u79-windows-i586.exe JDK7 稳定版 源官方下载地址: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
  • jdk-8u151-linux-x64.tar.gz 【官方jdk1.8、jdk8,linux版】。
  • java-jdk-8u51-windows-x64.exe.zip

    热门讨论 2015-07-20 10:08:11
    java jdk 8u51 for windows x64 截至2015.07.20最新版JDK For windows x64
  • jdk1.8 64位官方正式版 jdk-8u131-windows-x64.exe

    千次下载 热门讨论 2017-04-25 09:34:58
    jdk1.8 64位官方正式版 jdk-8u131-windows-x64.exe
  • jdk-8u45-windows-x64.exe

    热门讨论 2015-05-12 08:53:29
    jdk-8u45-windows-x64
  • 42U机柜CAD图纸

    热门讨论 2013-11-20 12:15:11
    42U机柜CAD图纸
  • JDK1.8u162以及JDK1.8所有历史版本官网下载地址

    万次阅读 多人点赞 2019-07-25 14:38:12
    很多网友想看JDK1.8里面所有的版本,今天我就给大家带来了所以JDK1.8版本的官方下载地址,其中包括Windows版本和Linux版本 JDK1.8所有版本官网下载链接 ... 比如这里以jdk1.8u162为例 ...

    很多网友想看JDK1.8里面所有的版本,今天我就给大家带来了所以JDK1.8版本的官方下载地址,其中包括Windows版本和Linux版本

    JDK1.8所有版本官网下载链接

    https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html

    比如这里以jdk1.8u162为例

    第一步:点击Accept License Agreement

    点击后会显示如下

    第二步:选择所需要的操作系统版本,这里以选择Linux64位操作系统为例,直接点击右边tar.gz链接

    第三步:这一步比较烦人,要注册oracle账号才能完成,请自行注册

    输入账号密码后自动会开始下载,这样就完成了jdk1.8u162的下载过程

    展开全文
  • jdk1.7 64位官方正式版 jdk-7u76-linux-x64.tar.gz

    千次下载 热门讨论 2015-02-07 08:57:54
    jdk-7u76-linux-x64.tar.gz,编译android5.0或以上需要
  • jdk1.8 64位官方正式版 jdk-8u91-windows

    万次下载 热门讨论 2016-06-02 21:42:33
    jdk1.8 64位官方正式版 jdk-8u91-windows
  • jdk-8u31-windows-x64

    千次下载 热门讨论 2015-02-04 10:44:45
    jdk-8u31-windows-x64
  • ACR122U写卡工具(RFID)

    热门讨论 2013-10-06 21:11:31
    ACR122U读卡写卡工具,RFID调试
  • jdk1.7 64位官方正式版 jdk-7u71-macosx-x64.dmg

    千次下载 热门讨论 2015-01-06 11:12:42
    jdk1.7 64位官方正式版 jdk-7u71-macosx-x64.dmg
  • \u57fa\u4e8e laravel \u9ed8\u8ba4\u7684 auth \u5b9e\u73b0 api \u8ba4\u8bc1\n\u73b0\u5728\u5fae\u670d\u52a1\u8d8a\u6765\u8d8a\u6d41\u884c\u4e86. \u5f88\u591a\u4e1c\u897f\u90fd\u62c6\u5206\u6210\u72ec\u...

    \u57fa\u4e8e laravel \u9ed8\u8ba4\u7684 auth<\/code> \u5b9e\u73b0 api \u8ba4\u8bc1<\/h2>\n

    \u73b0\u5728\u5fae\u670d\u52a1\u8d8a\u6765\u8d8a\u6d41\u884c\u4e86. \u5f88\u591a\u4e1c\u897f\u90fd\u62c6\u5206\u6210\u72ec\u7acb\u7684\u7cfb\u7edf,\u5404\u4e2a\u7cfb\u7edf\u4e4b\u95f4\u6ca1\u6709\u76f4\u63a5\u7684\u5173\u7cfb. \u8fd9\u6837\u6211\u4eec\u5982\u679c\u505a\u7528\u6237\u8ba4\u8bc1\u80af\u5b9a\u662f\u7edf\u4e00\u7684\u505a\u4e00\u4e2a\u72ec\u7acb\u7684 \u7528\u6237\u8ba4\u8bc1<\/code> \u7cfb\u7edf,\u800c\u4e0d\u662f\u6bcf\u4e2a\u4e1a\u52a1\u7cfb\u7edf\u90fd\u8981\u91cd\u65b0\u53bb\u5199\u4e00\u904d\u7528\u6237\u8ba4\u8bc1\u76f8\u5173\u7684\u4e1c\u897f. \u4f46\u662f\u53c8\u9047\u5230\u4e00\u4e2a\u95ee\u9898\u4e86. laravel<\/code> \u9ed8\u8ba4\u7684auth \u8ba4\u8bc1<\/code> \u662f\u57fa\u4e8e\u6570\u636e\u5e93\u505a\u7684,\u5982\u679c\u8981\u5fae\u670d\u52a1\u67b6\u6784\u53ef\u600e\u4e48\u505a\u5462?<\/p>\n

    \u5b9e\u73b0\u4ee3\u7801\u5982\u4e0b:<\/h2>\n

    UserProvider \u63a5\u53e3:<\/h3>\n

    \/\/ \u901a\u8fc7\u552f\u4e00\u6807\u793a\u7b26\u83b7\u53d6\u8ba4\u8bc1\u6a21\u578b\npublic function retrieveById($identifier);\n\/\/ \u901a\u8fc7\u552f\u4e00\u6807\u793a\u7b26\u548c remember token \u83b7\u53d6\u6a21\u578b\npublic function retrieveByToken($identifier, $token);\n\/\/ \u901a\u8fc7\u7ed9\u5b9a\u7684\u8ba4\u8bc1\u6a21\u578b\u66f4\u65b0 remember token\npublic function updateRememberToken(Authenticatable $user, $token);\n\/\/ \u901a\u8fc7\u7ed9\u5b9a\u7684\u51ed\u8bc1\u83b7\u53d6\u7528\u6237\uff0c\u6bd4\u5982 email \u6216\u7528\u6237\u540d\u7b49\u7b49\npublic function retrieveByCredentials(array $credentials);\n\/\/ \u8ba4\u8bc1\u7ed9\u5b9a\u7684\u7528\u6237\u548c\u7ed9\u5b9a\u7684\u51ed\u8bc1\u662f\u5426\u7b26\u5408\npublic function validateCredentials(Authenticatable $user, array $credentials);<\/code><\/pre>\n

    Laravel<\/code> \u4e2d\u9ed8\u8ba4\u6709\u4e24\u4e2a user provider<\/strong> : DatabaseUserProvider<\/code> & EloquentUserProvider<\/code>.
    DatabaseUserProvider<\/strong>
    Illuminate\\Auth\\DatabaseUserProvider<\/code><\/p>\n

    \u76f4\u63a5\u901a\u8fc7\u6570\u636e\u5e93\u8868\u6765\u83b7\u53d6\u8ba4\u8bc1\u6a21\u578b.<\/p>\n

    EloquentUserProvider<\/strong>
    Illuminate\\Auth\\EloquentUserProvider<\/code><\/p>\n

    \u901a\u8fc7 eloquent \u6a21\u578b\u6765\u83b7\u53d6\u8ba4\u8bc1\u6a21\u578b<\/p>\n

    \n\n

    \u6839\u636e\u4e0a\u9762\u7684\u77e5\u8bc6\uff0c\u53ef\u4ee5\u77e5\u9053\u8981\u81ea\u5b9a\u4e49\u4e00\u4e2a\u8ba4\u8bc1\u5f88\u7b80\u5355\u3002<\/p>\n

    \u81ea\u5b9a\u4e49 Provider<\/code><\/h2>\n

    \u521b\u5efa\u4e00\u4e2a\u81ea\u5b9a\u4e49\u7684\u8ba4\u8bc1\u6a21\u578b\uff0c\u5b9e\u73b0 Authenticatable \u63a5\u53e3\uff1b<\/p>\n

    App\\Auth\\UserProvider.php<\/code><\/p>\n

    <?php\n\nnamespace App\\Auth;\n\nuse App\\Models\\User;\nuse Illuminate\\Contracts\\Auth\\Authenticatable;\nuse Illuminate\\Contracts\\Auth\\UserProvider as Provider;\n\nclass UserProvider implements Provider\n{\n\n \/**\n * Retrieve a user by their unique identifier.\n * @param mixed $identifier\n * @return \\Illuminate\\Contracts\\Auth\\Authenticatable|null\n *\/\n public function retrieveById($identifier)\n {\n return app(User::class)::getUserByGuId($identifier);\n }\n\n \/**\n * Retrieve a user by their unique identifier and \"remember me\" token.\n * @param mixed $identifier\n * @param string $token\n * @return \\Illuminate\\Contracts\\Auth\\Authenticatable|null\n *\/\n public function retrieveByToken($identifier, $token)\n {\n return null;\n }\n\n \/**\n * Update the \"remember me\" token for the given user in storage.\n * @param \\Illuminate\\Contracts\\Auth\\Authenticatable $user\n * @param string $token\n * @return bool\n *\/\n public function updateRememberToken(Authenticatable $user, $token)\n {\n return true;\n }\n\n \/**\n * Retrieve a user by the given credentials.\n * @param array $credentials\n * @return \\Illuminate\\Contracts\\Auth\\Authenticatable|null\n *\/\n public function retrieveByCredentials(array $credentials)\n {\n if ( !isset($credentials['api_token'])) {\n return null;\n }\n\n return app(User::class)::getUserByToken($credentials['api_token']);\n }\n\n \/**\n * Rules a user against the given credentials.\n * @param \\Illuminate\\Contracts\\Auth\\Authenticatable $user\n * @param array $credentials\n * @return bool\n *\/\n public function validateCredentials(Authenticatable $user, array $credentials)\n {\n if ( !isset($credentials['api_token'])) {\n return false;\n }\n\n return true;\n }\n}\n<\/code><\/pre>\n

    Authenticatable \u63a5\u53e3:<\/h3>\n

    Illuminate\\Contracts\\Auth\\Authenticatable<\/code>
    \nAuthenticatable \u5b9a\u4e49\u4e86\u4e00\u4e2a\u53ef\u4ee5\u88ab\u7528\u6765\u8ba4\u8bc1\u7684\u6a21\u578b\u6216\u7c7b\u9700\u8981\u5b9e\u73b0\u7684\u63a5\u53e3\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u5982\u679c\u9700\u8981\u7528\u4e00\u4e2a\u81ea\u5b9a\u4e49\u7684\u7c7b\u6765\u505a\u8ba4\u8bc1\uff0c\u9700\u8981\u5b9e\u73b0\u8fd9\u4e2a\u63a5\u53e3\u5b9a\u4e49\u7684\u65b9\u6cd5\u3002<\/p>\n

    <?php\n.\n.\n.\n\/\/ \u83b7\u53d6\u552f\u4e00\u6807\u8bc6\u7684\uff0c\u53ef\u4ee5\u7528\u6765\u8ba4\u8bc1\u7684\u5b57\u6bb5\u540d\uff0c\u6bd4\u5982 id\uff0cuuid\npublic function getAuthIdentifierName();\n\/\/ \u83b7\u53d6\u8be5\u6807\u793a\u7b26\u5bf9\u5e94\u7684\u503c\npublic function getAuthIdentifier();\n\/\/ \u83b7\u53d6\u8ba4\u8bc1\u7684\u5bc6\u7801\npublic function getAuthPassword();\n\/\/ \u83b7\u53d6remember token\npublic function getRememberToken();\n\/\/ \u8bbe\u7f6e remember token\npublic function setRememberToken($value);\n\/\/ \u83b7\u53d6 remember token \u5bf9\u5e94\u7684\u5b57\u6bb5\u540d\uff0c\u6bd4\u5982\u9ed8\u8ba4\u7684 'remember_token'\npublic function getRememberTokenName();\n.\n.\n.<\/code><\/pre>\n

    Laravel \u4e2d\u5b9a\u4e49\u7684 Authenticatable trait<\/code>\uff0c\u4e5f\u662f Laravel auth \u9ed8\u8ba4\u7684 User<\/code> \u6a21\u578b\u4f7f\u7528\u7684 trait\uff0c\u8fd9\u4e2a trait \u5b9a\u4e49\u4e86 User<\/code> \u6a21\u578b\u9ed8\u8ba4\u8ba4\u8bc1\u6807\u793a\u7b26\u4e3a 'id'\uff0c\u5bc6\u7801\u5b57\u6bb5\u4e3apassword<\/code>\uff0cremember token<\/code> \u5bf9\u5e94\u7684\u5b57\u6bb5\u4e3a remember_token<\/code> \u7b49\u7b49\u3002
    \n\u200b
    \n\u901a\u8fc7\u91cd\u5199 User<\/code> \u6a21\u578b\u7684\u8fd9\u4e9b\u65b9\u6cd5\u53ef\u4ee5\u4fee\u6539\u4e00\u4e9b\u8bbe\u7f6e\u3002<\/p>\n

    \u5b9e\u73b0\u81ea\u5b9a\u4e49\u8ba4\u8bc1\u6a21\u578b<\/h3>\n

    App\\Models\\User.php<\/code><\/p>\n

    <?php\n\nnamespace App\\Models;\n\nuse App\\Exceptions\\RestApiException;\nuse App\\Models\\Abstracts\\RestApiModel;\nuse Illuminate\\Contracts\\Auth\\Authenticatable;\n\nclass User extends RestApiModel implements Authenticatable\n{\n\n protected $primaryKey = 'guid';\n\n public $incrementing = false;\n\n protected $keyType = 'string';\n\n \/**\n * \u83b7\u53d6\u552f\u4e00\u6807\u8bc6\u7684\uff0c\u53ef\u4ee5\u7528\u6765\u8ba4\u8bc1\u7684\u5b57\u6bb5\u540d\uff0c\u6bd4\u5982 id\uff0cguid\n * @return string\n *\/\n public function getAuthIdentifierName()\n {\n return $this->primaryKey;\n }\n\n \/**\n * \u83b7\u53d6\u4e3b\u952e\u7684\u503c\n * @return mixed\n *\/\n public function getAuthIdentifier()\n {\n $id = $this->{$this->getAuthIdentifierName()};\n return $id;\n }\n\n public function getAuthPassword()\n {\n return '';\n }\n\n public function getRememberToken()\n {\n return '';\n }\n\n public function setRememberToken($value)\n {\n return true;\n }\n\n public function getRememberTokenName()\n {\n return '';\n }\n\n protected static function getBaseUri()\n {\n return config('api-host.user');\n }\n\n public static $apiMap = [\n 'getUserByToken' => ['method' => 'GET', 'path' => 'login\/user\/token'],\n 'getUserByGuId' => ['method' => 'GET', 'path' => 'user\/guid\/:guid'],\n ];\n\n \/**\n * \u83b7\u53d6\u7528\u6237\u4fe1\u606f (by guid)\n * @param string $guid\n * @return User|null\n *\/\n public static function getUserByGuId(string $guid)\n {\n try {\n $response = self::getItem('getUserByGuId', [\n ':guid' => $guid\n ]);\n } catch (RestApiException $e) {\n return null;\n }\n\n return $response;\n }\n\n \/**\n * \u83b7\u53d6\u7528\u6237\u4fe1\u606f (by token)\n * @param string $token\n * @return User|null\n *\/\n public static function getUserByToken(string $token)\n {\n try {\n $response = self::getItem('getUserByToken', [\n 'Authorization' => $token\n ]);\n } catch (RestApiException $e) {\n return null;\n }\n\n return $response;\n }\n}\n<\/code><\/pre>\n

    \u4e0a\u9762 RestApiModel<\/code> \u662f\u6211\u4eec\u516c\u53f8\u5bf9 Guzzle<\/code> \u7684\u5c01\u88c5,\u7528\u4e8e php \u9879\u76ee\u5404\u4e2a\u7cfb\u7edf\u4e4b\u95f4 api<\/code> \u8c03\u7528. \u4ee3\u7801\u5c31\u4e0d\u65b9\u4fbf\u900f\u6f0f\u4e86.<\/p>\n

    Guard \u63a5\u53e3<\/h2>\n

    Illuminate\\Contracts\\Auth\\Guard<\/code><\/p>\n

    Guard<\/code> \u63a5\u53e3\u5b9a\u4e49\u4e86\u67d0\u4e2a\u5b9e\u73b0\u4e86 Authenticatable<\/code> (\u53ef\u8ba4\u8bc1\u7684) \u6a21\u578b\u6216\u7c7b\u7684\u8ba4\u8bc1\u65b9\u6cd5\u4ee5\u53ca\u4e00\u4e9b\u5e38\u7528\u7684\u63a5\u53e3\u3002<\/p>\n

    \/\/ \u5224\u65ad\u5f53\u524d\u7528\u6237\u662f\u5426\u767b\u5f55\npublic function check();\n\/\/ \u5224\u65ad\u5f53\u524d\u7528\u6237\u662f\u5426\u662f\u6e38\u5ba2\uff08\u672a\u767b\u5f55\uff09\npublic function guest();\n\/\/ \u83b7\u53d6\u5f53\u524d\u8ba4\u8bc1\u7684\u7528\u6237\npublic function user();\n\/\/ \u83b7\u53d6\u5f53\u524d\u8ba4\u8bc1\u7528\u6237\u7684 id\uff0c\u4e25\u683c\u6765\u8bf4\u4e0d\u4e00\u5b9a\u662f id\uff0c\u5e94\u8be5\u662f\u4e0a\u4e2a\u6a21\u578b\u4e2d\u5b9a\u4e49\u7684\u552f\u4e00\u7684\u5b57\u6bb5\u540d\npublic function id();\n\/\/ \u6839\u636e\u63d0\u4f9b\u7684\u6d88\u606f\u8ba4\u8bc1\u7528\u6237\npublic function validate(array $credentials = []);\n\/\/ \u8bbe\u7f6e\u5f53\u524d\u7528\u6237\npublic function setUser(Authenticatable $user);<\/code><\/pre>\n

    StatefulGuard \u63a5\u53e3<\/h3>\n

    Illuminate\\Contracts\\Auth\\StatefulGuard<\/code><\/p>\n

    StatefulGuard<\/code> \u63a5\u53e3\u7ee7\u627f\u81ea Guard<\/code> \u63a5\u53e3\uff0c\u9664\u4e86 Guard<\/code> \u91cc\u9762\u5b9a\u4e49\u7684\u4e00\u4e9b\u57fa\u672c\u63a5\u53e3\u5916\uff0c\u8fd8\u589e\u52a0\u4e86\u66f4\u8fdb\u4e00\u6b65\u3001\u6709\u72b6\u6001\u7684 Guard<\/code>.<\/p>\n

    \u65b0\u6dfb\u52a0\u7684\u63a5\u53e3\u6709\u8fd9\u4e9b\uff1a<\/p>\n

    \/\/ \u5c1d\u8bd5\u6839\u636e\u63d0\u4f9b\u7684\u51ed\u8bc1\u9a8c\u8bc1\u7528\u6237\u662f\u5426\u5408\u6cd5\npublic function attempt(array $credentials = [], $remember = false);\n\/\/ \u4e00\u6b21\u6027\u767b\u5f55\uff0c\u4e0d\u8bb0\u5f55session or cookie\npublic function once(array $credentials = []);\n\/\/ \u767b\u5f55\u7528\u6237\uff0c\u901a\u5e38\u5728\u9a8c\u8bc1\u6210\u529f\u540e\u8bb0\u5f55 session \u548c cookie \npublic function login(Authenticatable $user, $remember = false);\n\/\/ \u4f7f\u7528\u7528\u6237 id \u767b\u5f55\npublic function loginUsingId($id, $remember = false);\n\/\/ \u4f7f\u7528\u7528\u6237 ID \u767b\u5f55\uff0c\u4f46\u662f\u4e0d\u8bb0\u5f55 session \u548c cookie\npublic function onceUsingId($id);\n\/\/ \u901a\u8fc7 cookie \u4e2d\u7684 remember token \u81ea\u52a8\u767b\u5f55\npublic function viaRemember();\n\/\/ \u767b\u51fa\npublic function logout();<\/code><\/pre>\n

    Laravel<\/code> \u4e2d\u9ed8\u8ba4\u63d0\u4f9b\u4e86 3 \u4e2d guard<\/strong> \uff1aRequestGuard<\/code>\uff0cTokenGuard<\/code>\uff0cSessionGuard<\/code>.<\/p>\n

    RequestGuard<\/h3>\n

    Illuminate\\Auth\\RequestGuard<\/code><\/p>\n

    RequestGuard \u662f\u4e00\u4e2a\u975e\u5e38\u7b80\u5355\u7684 guard. RequestGuard \u662f\u901a\u8fc7\u4f20\u5165\u4e00\u4e2a\u95ed\u5305\u6765\u8ba4\u8bc1\u7684\u3002\u53ef\u4ee5\u901a\u8fc7\u8c03\u7528 Auth::viaRequest<\/code> \u6dfb\u52a0\u4e00\u4e2a\u81ea\u5b9a\u4e49\u7684 RequestGuard.<\/p>\n

    SessionGuard<\/h3>\n

    Illuminate\\Auth\\SessionGuard<\/code><\/p>\n

    SessionGuard \u662f Laravel web \u8ba4\u8bc1\u9ed8\u8ba4\u7684 guard.<\/p>\n

    TokenGuard<\/h3>\n

    Illuminate\\Auth\\TokenGuard<\/code><\/p>\n

    TokenGuard \u9002\u7528\u4e8e\u65e0\u72b6\u6001 api \u8ba4\u8bc1\uff0c\u901a\u8fc7 token \u8ba4\u8bc1.<\/p>\n

    \u5b9e\u73b0\u81ea\u5b9a\u4e49 Guard<\/code><\/h2>\n

    App\\Auth\\UserGuard.php<\/code><\/p>\n

    <?php\n\nnamespace App\\Auth;\n\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Auth\\GuardHelpers;\nuse Illuminate\\Contracts\\Auth\\Guard;\nuse Illuminate\\Contracts\\Auth\\UserProvider;\n\nclass UserGuard implements Guard\n\n{\n use GuardHelpers;\n\n protected $user = null;\n\n protected $request;\n\n protected $provider;\n\n \/**\n * The name of the query string item from the request containing the API token.\n *\n * @var string\n *\/\n protected $inputKey;\n\n \/**\n * The name of the token \"column\" in persistent storage.\n *\n * @var string\n *\/\n protected $storageKey;\n\n \/**\n * The user we last attempted to retrieve\n * @var\n *\/\n protected $lastAttempted;\n\n \/**\n * UserGuard constructor.\n * @param UserProvider $provider\n * @param Request $request\n * @return void\n *\/\n public function __construct(UserProvider $provider, Request $request = null)\n {\n $this->request = $request;\n $this->provider = $provider;\n $this->inputKey = 'Authorization';\n $this->storageKey = 'api_token';\n }\n\n \/**\n * Get the currently authenticated user.\n * @return \\Illuminate\\Contracts\\Auth\\Authenticatable|null\n *\/\n public function user()\n {\n if(!is_null($this->user)) {\n return $this->user;\n }\n\n $user = null;\n\n $token = $this->getTokenForRequest();\n\n if(!empty($token)) {\n $user = $this->provider->retrieveByCredentials(\n [$this->storageKey => $token]\n );\n }\n\n return $this->user = $user;\n }\n\n \/**\n * Rules a user's credentials.\n * @param array $credentials\n * @return bool\n *\/\n public function validate(array $credentials = [])\n {\n if (empty($credentials[$this->inputKey])) {\n return false;\n }\n\n $credentials = [$this->storageKey => $credentials[$this->inputKey]];\n\n $this->lastAttempted = $user = $this->provider->retrieveByCredentials($credentials);\n\n return $this->hasValidCredentials($user, $credentials);\n }\n\n \/**\n * Determine if the user matches the credentials.\n * @param mixed $user\n * @param array $credentials\n * @return bool\n *\/\n protected function hasValidCredentials($user, $credentials)\n {\n return !is_null($user) && $this->provider->validateCredentials($user, $credentials);\n }\n\n \/**\n * Get the token for the current request.\n * @return string\n *\/\n public function getTokenForRequest()\n {\n $token = $this->request->header($this->inputKey);\n\n return $token;\n }\n\n \/**\n * Set the current request instance.\n *\n * @param \\Illuminate\\Http\\Request $request\n * @return $this\n *\/\n public function setRequest(Request $request)\n {\n $this->request = $request;\n\n return $this;\n }\n}\n<\/code><\/pre>\n

    \u5728 AppServiceProvider \u7684 boot \u65b9\u6cd5\u6dfb\u52a0\u5982\u4e0b\u4ee3\u7801\uff1a
    App\\Providers\\AuthServiceProvider.php<\/code><\/p>\n

    <?php\n.\n.\n.\n\/\/ auth:api -> token provider.\nAuth::provider('token', function() {\n return app(UserProvider::class);\n});\n\n\/\/ auth:api -> token guard.\n\/\/ @throw \\Exception\nAuth::extend('token', function($app, $name, array $config) {\n if($name === 'api') {\n return app()->make(UserGuard::class, [\n 'provider' => Auth::createUserProvider($config['provider']),\n 'request' => $app->request,\n ]);\n }\n throw new \\Exception('This guard only serves \"auth:api\".');\n});\n.\n.\n.<\/code><\/pre>\n
    \n

    \u5728 config\\auth.php<\/code>\u7684 guards \u6570\u7ec4\u4e2d\u6dfb\u52a0\u81ea\u5b9a\u4e49 guard<\/code>\uff0c\u4e00\u4e2a\u81ea\u5b9a\u4e49 guard \u5305\u62ec\u4e24\u90e8\u5206\uff1a driver<\/code> \u548c provider<\/code>.<\/p>\n<\/li>\n\n

    \u8bbe\u7f6e config\\auth.php<\/code> \u7684 defaults.guard \u4e3a api<\/code>.<\/p>\n<\/li>\n<\/ul>\n\n

    <?php\n\nreturn [\n\n \/*\n |--------------------------------------------------------------------------\n | Authentication Defaults\n |--------------------------------------------------------------------------\n |\n | This option controls the default authentication \"guard\" and password\n | reset options for your application. You may change these defaults\n | as required, but they're a perfect start for most applications.\n |\n *\/\n\n 'defaults' => [\n 'guard' => 'api',\n 'passwords' => 'users',\n ],\n\n \/*\n |--------------------------------------------------------------------------\n | Authentication Guards\n |--------------------------------------------------------------------------\n |\n | Next, you may define every authentication guard for your application.\n | Of course, a great default configuration has been defined for you\n | here which uses session storage and the Eloquent user provider.\n |\n | All authentication drivers have a user provider. This defines how the\n | users are actually retrieved out of your database or other storage\n | mechanisms used by this application to persist your user's data.\n |\n | Supported: \"session\
    展开全文
  • jdk-8u45-linux-x64.rpm

    千次下载 热门讨论 2015-04-16 09:39:37
    jdk-8u45-linux-x64.rpm
  • jdk1.7 64位官方正式版 jdk-7u51-windows-x64

    千次下载 热门讨论 2014-10-21 17:40:17
    jdk1.7(7.0) 安装包 win7 64位 官方正式版

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 3,984,888
精华内容 1,593,955
关键字:

u