国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

? PHP ????? ThinkPHP thinkphp?? ??? ? ??? ???? ??

thinkphp?? ??? ? ??? ???? ??

Apr 12, 2023 am 09:04 AM

?????? ??? ?? ??? ??? ??? ??? ? ??? ?? ? ???? ?? ??? ?????. thinkphp ?????? ???? ??? ? ??? ? ?? ????? ???? ???? ???? ??? ?????? ? ????? ??? ? ??? ???? ?? thinkphp ?????? ?? ???? Header ??? ? ?? ?????? ???? ??? ?????.

1. ?? ???

thinkphp ???????? ?? ???? ???? ??? ? ?? ??? ???? ?? ??? ??? ? ????. ???? ??? ???? ???? ?? ??? ???? ????.

header("Access-Control-Allow-Origin:?*");
header("Access-Control-Allow-Headers:?Origin,?X-Requested-With,?Content-Type,?Accept");

? ? ? ?? ?? ?? ?? ??? ??? ? ??? ???? ???? ? ???? ?? ?? ??? ??? ?? ????. ??? ?? ??? ??? ?? ???? ??? ???? ?????. ?? ??? ??? ???? ?? ??? ??? ??? ? ????.

2. ?? ?????

Header ???? ???? ??? ? ??? ???? ? ??? ?? ?????? ???? ? ????? ???? ?? ????. ??? ?? CORS(Cross-Origin Resource Sharing) ????? cors ??? ?? ?? ?? ?????? ???? ??? ? ??? ???? ??? ?????.

  1. cors ?? ??

??? ?? ?? ?? ??? ?????.

composer?require?topthink/think-cors
  1. cors ?? ??

????? config ???? cors.php ??? ??? ?? ??? ?????.

<?php

return [
    // 允許的請(qǐng)求域名
    &#39;allow_origin&#39;      =>?['*'],
????//?允許的請(qǐng)求頭信息
????'allow_headers'?????=>?'Origin,?X-Requested-With,?Content-Type,?Accept',
????//?允許的請(qǐng)求方法
????'allow_methods'?????=>?'GET,?POST,?PUT,?DELETE,?PATCH',
????//?是否允許發(fā)送cookie
????'allow_credentials'?=>?true,
????//?跨域請(qǐng)求緩存時(shí)間
????'max_age'???????????=>?3600,
];

? ? $allow_origin? ??? ?? ??? ??? ????, ?? ?? ??? ???? ????? ????? ?? "*"? ??? ? ????. $allow_headers? ???? ?? ?? ??? ????, $allow_methods? ???? ?? ??? ?????. $allow_credentials? ?? ??? ????? ??? ????, $max_age? ??? ? ?? ?? ??? ?????.

  1. ?? ?? ??

????? config ???? app.php ??? ??? ??? ??? ????.

return?[
????//?...
????'middleware'?=>?[
????????//?...
????????\think\middleware\Cors::class,
????],
];
  1. Call cors ??

??? ???? ??? ???? ????? ??? ?? ??? ? ????. ??? ? ?? ??? ???? cors ??? ???:

use?think\facade\Cors;

public?function?index()?{
????Cors::allowAllOrigin();
????return?json(['code'?=>?200,?'msg'?=>?'success']);
}

?? ???? ??? ? ??? ? ??? ??? ? ????.

?????, thinkphp ?????? ??? ? ?? ????? ???? ???? ????? Header ???? ?? ?????? ??? ? ????. Header ???? ???? ?? ?? ??? ???? ???? ?? ?????? ???? ?? ????? ??????. ???? ?? ??? ??? ??? ?? ??? ? ????.

? ??? thinkphp?? ??? ? ??? ???? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

??? ????
1601
29
PHP ????
1502
276
???