在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答
傲寒 回答

1.你說的權(quán)限認(rèn)證是登錄驗(yàn)證吧?api用jwt方案,簡(jiǎn)單的說就是對(duì)uid加密或者建立一個(gè)映射關(guān)系
2.單點(diǎn)登錄,簡(jiǎn)單的去看ucenter,復(fù)雜的看cas,或者自行實(shí)現(xiàn)
3.沒有想到你api和網(wǎng)站同時(shí)登錄的場(chǎng)景
4.OAuth2.0和單點(diǎn)登錄沒關(guān)系

柒喵 回答

在你的提問中完全不需要

只有需要讀取struct私有成員的時(shí)候才需要指針,否則不需要

薄荷綠 回答

在keepAlive的actived生命周期調(diào)用接口就可以了

冷眸 回答

個(gè)人認(rèn)為:

  • vue 適合簡(jiǎn)單的
  • React 適合中型的
  • ng 適合大型復(fù)雜的

還是要看系統(tǒng)邏輯的綜合復(fù)雜程度

乖乖瀦 回答

你build之后怎么還是用localhost訪問的

小眼睛 回答

需要保證所有的數(shù)據(jù)都同時(shí)操作成功,或者同時(shí)操作失敗。 是指如果a10操作失敗了,全部數(shù)據(jù)回滾到a1操作前嗎?如果是這樣的話,當(dāng)然是吧事務(wù)放在循環(huán)外層最合適。

如果只是 “a1插入后得到的主鍵ID更新到b1的一個(gè)字段” 是一個(gè)事務(wù),其中任意一組操作失敗不影響其他組操作的話,還是應(yīng)該將事務(wù)放在循環(huán)內(nèi)。

// 用于記錄失敗的操作的key
$error = [];

foreach($arr_a AS $key => $a){
    $transaction = Yii::$app->getDb()->beginTransaction();

    try {
        //插入 a1 得到 id1
        //將ID更新到 b1
        
        $transaction->commit();
    } catch (\Exception $e) {

        // 回滾
        $transaction->rollBack();
        // 記錄失敗的操作的key
        $error[] = $key;

        // 這里不拋異常
        continue;
    }
}

// 對(duì)記錄的 $error 進(jìn)行其他操作
執(zhí)念 回答

首先,你的 $config 數(shù)組中一定包含以下元素:

$config = [
    //others
    'modules' => [
        'debug' => [
            'class' => 'yii\debug\Module',
        ], 
        'gii'   => [
            'class' => 'yii\gii\Module',
        ];
    ],
    //others
]

這里說明一下繼承關(guān)系:

class yii\base\Application extends yii\base\Module

class yii\base\Module extends yii\di\ServiceLocator

class yii\di\ServiceLocator extends yii\base\Component

class yii\base\Component extends yii\base\Object

  • yiibaseApplication::__construct() 方法注解
public function __construct($config = [])
{
    Yii::$app = $this;
    //將\yii\base\Application中的所有的屬性和方法交給Yii::$app->loadedModules數(shù)組中
    static::setInstance($this);

    $this->state = self::STATE_BEGIN;

    //加載配置文件的框架信息 如:設(shè)置別名,設(shè)置框架路徑等等最為重要的是給加載默認(rèn)組件
    $this->preInit($config);

    //加載配置文件中的異常組件
    $this->registerErrorHandler($config);

    // 調(diào)用父類的 __construct。
    // 由于Component類并沒有__construct函數(shù)
    // 這里實(shí)際調(diào)用的是 `yii\base\Object__construct($config)`
    Component::__construct($config);
}

上面方法中 Component::__construct($config) 會(huì)調(diào)用 yii\base\Object::__construct() 方法

  • yiibaseObject::__construct() 方法注解
public function __construct($config = [])
{
    if (!empty($config)) {
        // 將配置文件里面的所有配置信息賦值給Object。
        // 由于Object是大部分類的基類,
        // 實(shí)際上也就是有配置信息賦值給了yii\web\Application的對(duì)象
        Yii::configure($this, $config);
    }
    $this->init();
}

一、下面只是為了說明 'components' => [ 'log' => [...]] 從哪來(lái),若不關(guān)心可以直接看 第二步。

  • 先看 $this->preInit($config);,即 yii\base\Application::preInit(&$config)
public function preInit(&$config)
{
    //others...
    
    // merge core components with custom components
    // 合并核心組件和自定義組件
    foreach ($this->coreComponents() as $id => $component) {
        if (!isset($config['components'][$id])) {
            // 若自定義組件中沒有設(shè)置該核心組件配置信息,直接使用核心組件默認(rèn)配置
            $config['components'][$id] = $component;
        } elseif (is_array($config['components'][$id]) && !isset($config['components'][$id]['class'])) {
            // 若自定義組件有設(shè)置該核心組件配置信息,但是沒有設(shè)置 'class'屬性,則添加該class屬性
            $config['components'][$id]['class'] = $component['class'];
        }
    }
}

/**
 * Returns the configuration of core application components.
 * 返回核心應(yīng)用組件的配置
 * @see set()
 */
public function coreComponents()
{
    return [
        // 日志分配器組件
        'log' => ['class' => 'yii\log\Dispatcher'],
        
        //others...
    ];
}
  • 經(jīng)過 $this->preInit($config);, 我們得到的 $config
$config = [
    'modules' => [
        'debug' => [
            'class' => 'yii\debug\Module',
        ], 
        'gii'   => [
            'class' => 'yii\gii\Module',
        ];
    ],
    'components' => [
        'log'   => [
            'class' => 'yii\\log\\Dispatcher',
        ],
        
        //others...
    ]
    //others...
]


上面只是為了說明 'components' => [ 'log' => [...]] 從哪來(lái)

二、重點(diǎn)在這里

  • yii\base\Object::__construct($config = []) 中的 Yii::configure($this, $config);
public static function configure($object, $properties)
{
    // 只是遍歷配置信息,賦值給當(dāng)前對(duì)象
    foreach ($properties as $name => $value) {
        $object->$name = $value;
    }
    return $object;
}
  • 這里我們要配合 yii\base\Object::__set($name, $value)
/**
 * 為實(shí)例不存在的屬性賦值時(shí)調(diào)用
 *
 * Do not call this method directly as it is a PHP magic method that
 * will be implicitly called when executing `$object->property = $value;`.
 * 這個(gè)是PHP的魔術(shù)方法,會(huì)在執(zhí)行 `$object->property = $value;` 的時(shí)候自動(dòng)調(diào)用。
 */
public function __set($name, $value)
{
    // setter函數(shù)的函數(shù)名
    // 由于php中方法名稱不區(qū)分大小寫,所以setproperty() 等價(jià)于 setProperty()
    $setter = 'set' . $name;
    if (method_exists($this, $setter)) {
        // 調(diào)用setter函數(shù)
        $this->$setter($value);
    } elseif (method_exists($this, 'get' . $name)) {
        // 如果只有g(shù)etter沒有setter 則為只讀屬性
        throw new InvalidCallException('Setting read-only property: ' . get_class($this) . '::' . $name);
    } else {
        throw new UnknownPropertyException('Setting unknown property: ' . get_class($this) . '::' . $name);
    }
}

當(dāng)前情景下的 $object 我們可以認(rèn)為是 yii\base\Application 的對(duì)象 $app

  • 當(dāng)遍歷到:
$app->modules =  [
    'debug' => [
        'class' => 'yii\debug\Module',
    ], 
    'gii'   => [
        'class' => 'yii\gii\Module',
    ];
]

這里會(huì)調(diào)用 yii\base\Module::setModules($modules) 方法

public function setModules($modules)
{
    foreach ($modules as $id => $module) {
        $this->_modules[$id] = $module;
    }
}

這樣便有了問題中的

["_modules":"yii\base\Module":private]=>
    array(3) {
        ["debug"]=> object(yii\debug\Module)#33 (28) {
            ......
        }
        ["gii"]=> object(yii\gii\Module)#113 (21) {
            ......
        }
        ...
    }
  • 同樣的道理,當(dāng)遍歷到:
$app->components =  [
    'log'   => [
        'class' => 'yii\\log\\Dispatcher',
    ],
]
  • 這里會(huì)調(diào)用 yii\di\ServiceLocator::setComponents($components) 方法
public function setComponents($components)
{
    foreach ($components as $id => $component) {
        $this->set($id, $component);
    }
}

public function set($id, $definition)
{
    // others ...

    if (is_object($definition) || is_callable($definition, true)) {
        // an object, a class name, or a PHP callable
        $this->_definitions[$id] = $definition;
    } elseif (is_array($definition)) {
        // 定義如果是個(gè)數(shù)組,要確保數(shù)組中具有 class 元素
        // a configuration array
        if (isset($definition['class'])) {
            // 定義的過程,只是寫入了 $_definitions 數(shù)組
            $this->_definitions[$id] = $definition;
        } else {
            throw new InvalidConfigException("The configuration for the \"$id\" component must contain a \"class\" element.");
        }
    } else {
        throw new InvalidConfigException("Unexpected configuration type for the \"$id\" component: " . gettype($definition));
    }
}

這樣便有了問題中的

["_definitions":"yii\di\ServiceLocator":private]=>
        array(24) {
            ["errorHandler"]=> .....
            ["request"]=> ......
            ["log"]=> ......
            ......
        }
怣人 回答

先讓p1=p2,再執(zhí)行a1,a2,$.when,如果p1要恢復(fù)默認(rèn),在when的回調(diào)中對(duì)p1重新賦值。

莫小染 回答

你這個(gè)問題解決了嗎?我也碰到問題,不過jenkins提示成功了,但是沒有生成文件

孤星 回答

使用fetch方法是可以將json數(shù)據(jù)傳入到后臺(tái)的,圖片也是可以的
可以參考這篇文章:https://blog.csdn.net/withing...

安于心 回答
  1. 打開遮罩的時(shí)候給 body設(shè)置 overflow;
  2. $('body').css("overflow","hidden")
礙你眼 回答

http://t.cn/RnoLSet 已經(jīng)有平臺(tái)實(shí)現(xiàn)了,可以在線生成,拿走不謝哦~

玩控 回答

因?yàn)?/p>

li:hover{
   ...
}

選擇器的優(yōu)先級(jí)是低于id選擇器的優(yōu)先級(jí)的,所以過渡動(dòng)畫就不會(huì)生效。
至于為什么位置是直接變化的,是因?yàn)閘i元素默認(rèn)是沒有相對(duì)定位的,只有hover的時(shí)候才變成了相對(duì)定位。所以應(yīng)該在默認(rèn)的時(shí)候就設(shè)置li元素為相對(duì)定位,在hover的時(shí)候改變它的left值。
綜合修改的代碼為:

li{
            width:100px;
            height:30px;
            transition:all 2s linear 0s;
            position: relative;
            left: 0;
        }
        
        #li1{
            background-color: red;
        }
        #li2{
            background-color: green;
        }
        #li3{
            background-color: blue;
        }
        #li4{
            background-color: orange;
        }
        #li1:hover,
        #li2:hover,
        #li3:hover,
        #li4:hover{
            background-color:gray;
            left:10px;
        }
玩控 回答

select出 17年 至 18年 每張表的數(shù)據(jù)總量,然后內(nèi)存中求出總和不就是 2017年到2018年的數(shù)據(jù)的總量 么?

夏夕 回答

寫個(gè)js 在各個(gè)頁(yè)面的公共引入地方引入這個(gè)js 這個(gè)js set get修改刪除獲取數(shù)據(jù)?
或者 localstorage?

安若晴 回答

del admin_list2[:]的時(shí)候僅刪除了列表里邊的值,并沒有刪除列表本身,admin_list2還存在
當(dāng)if判斷時(shí),由于是空列表,所以為False
沒有進(jìn)入下邊的遍歷

薄荷綠 回答

查一下是否安裝了emmet插件 工具>插件安裝 安裝后才能使用

說了這么多,重點(diǎn)沒有說出來(lái),只說了個(gè)cache,首先要確定是css樣式?jīng)]更新,還是js代碼沒生效,還是php代碼沒更新,還是數(shù)據(jù)沒更新?

如果是css和js造成的頁(yè)面沒更新,嘗試一下ctrl+f5強(qiáng)制刷新,或者在引用資源的鏈接后面加個(gè)字符,比如xxxx.css?v=1

如果是php代碼沒更新,檢查一下opcache是否開啟,如果數(shù)據(jù)沒更新,要先看一下程序中是否使用某些緩存技術(shù),redis,memcached的之類的。

實(shí)在區(qū)分不出來(lái)就一步一步測(cè)試,寫個(gè)php的測(cè)試頁(yè)面,隨便改動(dòng)一下。改動(dòng)一下css單獨(dú)訪問。改動(dòng)一下js,單獨(dú)訪問。