鍍金池/ 問(wèn)答
尛憇藌 回答

已解決:
在面包屑組件里面通過(guò)watch來(lái)監(jiān)聽(tīng)路由更新組件

瘋子范 回答

AJAX 請(qǐng)求,參數(shù)值的編碼要使用 encodeURIComponent ,它只支持 UTF-8 的字節(jié)結(jié)果,無(wú)法產(chǎn)生 GBK 的字節(jié)結(jié)果。
form 提交,可以使用 accept-charset 屬性指定編碼的字節(jié)結(jié)果。(form 的話(huà)自己好像就會(huì)根據(jù)頁(yè)面的 charset 來(lái)默認(rèn)編碼了)

墨小羽 回答

問(wèn)問(wèn)題的藝術(shù):
Storage::disk('public')這里的 public 不是你改的 public,而是 disks['public'] 里的所有內(nèi)容;
打印返回值刪除后的返回值
請(qǐng)把你的磁盤(pán)的文件目錄結(jié)構(gòu)截圖,確定文件的位置;


你這個(gè)問(wèn)題就像是在說(shuō):知道為什么迪麗熱巴不喜歡我嗎?(壓根都沒(méi)見(jiàn)到本源,怎么能知道問(wèn)題所在?)


回復(fù)沒(méi)有 md,在這里更新:
你這百分之一百錯(cuò)誤呀,所以截圖很明確事實(shí)了,
laravel 默認(rèn)把上傳之類(lèi)的靜態(tài)資源放在 /storage/app/public下,而你卻放到/public下。
正確的做法是把靜態(tài)資源放到/storage/app/public
看你的想法是直接把/public/*下的文件刪除,
你配置 disk 的時(shí)候不要使用storage函數(shù),這個(gè)函數(shù)會(huì)自動(dòng)定位到/storage目錄,如果要操作不多的話(huà),我建議直接使用 PHP 或者其他方法刪除了.
獲取文件路徑:

$path = public_path('img/***.php');
unlink($path);
幼梔 回答

function fn(data,type){
let hash=[],arr=[];
data.map((item)=>{

if(hash[item[type]]){
   arr.push(item)
}

})
return arr;
}
console.log(fn(data,'year'))

孤毒 回答

如果對(duì)實(shí)時(shí)性比較高的話(huà),就用socket吧。
比如在后端在登錄的地方給需要彈窗的地方發(fā)一個(gè)socket通知,具體發(fā)送數(shù)據(jù)看具體需求了

尐懶貓 回答

Apache,項(xiàng)目文件下有.htaccess文件
內(nèi)容

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule  ^$ public/    [L]
    RewriteRule  (.*) public/$1 [L]
</IfModule>
枕頭人 回答

因?yàn)?this->mysql是null,調(diào)用null的prepare方法,會(huì)報(bào)致命錯(cuò)誤!需要查看它為什么是null,數(shù)據(jù)庫(kù)連接有沒(méi)有問(wèn)題。

瞄小懶 回答

不需要用refs獲取dom,給答對(duì)了和打錯(cuò)了設(shè)置不同的類(lèi),在渲染的時(shí)候判斷是答對(duì)還是打錯(cuò),來(lái)設(shè)置不同的類(lèi),也可以直接在html里設(shè)置style

<div  v-for="(list,index) of lists.options" @click="ans(index,lists)" ref="items" class=" H-text-list H-flexbox-horizontal  H-theme-background-color-white H-border-vertical-bottom-after H-vertical-middle H-touch-active" :style="color: ['A','B','C','D'].indexOf(list.an) > -1 ? 'limegreen' : 'red'">
        <div class=" H-flex-item H-padding-horizontal-both-10 H-font-size-16 H-padding-vertical-both-12 H-text-show-row-3" style="line-height: 29px;">
                {{list}}
        </div>
    </div>
凹凸曼 回答

當(dāng)前的服務(wù)器是堡壘機(jī)嗎?重新配置一下ssh免輸入登陸呢

空痕 回答

每個(gè)commit記錄了一個(gè)或多個(gè)代碼更改塊(稱(chēng)為hunk)。內(nèi)容是哪一行開(kāi)始,更改了什么內(nèi)容

如果這些變更塊(hunk)之間互相沒(méi)有重疊,那么就沒(méi)沖突

比如一個(gè)記錄了第1行到第10行的變更,一個(gè)記錄了第15行到到20行變更。合并就不會(huì)沖突
而一個(gè)記錄了第1行到第10行的變更,一個(gè)記錄了第5行到到13行變更。產(chǎn)生了第5-10行的重疊,就會(huì)產(chǎn)生沖突

注意:python3以后才支持yield from語(yǔ)法

import collections


def flatten(d, prefix="", sep="_"):
    def _take_prefix(k, v, p):
        if p:
            yield from flatten(v, "{}{}{}".format(p, sep, k))
        else:
            yield from flatten(v, str(k))

    if isinstance(d, dict):
        for k, v in d.items():
            if isinstance(v, str) or not isinstance(v, collections.Iterable):
                if prefix:
                    yield "{}{}{}".format(prefix, sep, k), v
                else:
                    yield k, v
            elif isinstance(v, dict):
                yield from _take_prefix(k, v, prefix)
            elif isinstance(v, list):
                for i in v:
                    yield from _take_prefix(k, i, prefix)
            else:
                pass
    else:
        pass

dic = {your dataset}
for key, value in flatten(dic):
    print("{}: {}".format(key, value))

結(jié)果如下,應(yīng)該能拍平了

status: changed
dataset_id: 5a4b463c855d783af4f5f695
dataset_name: AE_E
dataset_label: 1- ADVERSE EVENTS - Not Analyzed
details_variables_variable_id: 5a4b4647855d783b494f9d3f
details_variables_variable_name: CPEVENT
details_variables_variable_label: CPEVENT
details_variables_status: changed
details_variables_details_r_type_new_value: unary
details_variables_details_r_type_old_value: factor
details_variables_message: Variable with different R Type
details_variables_variable_id: 5a4b4647855d783b494f9d25
details_variables_variable_name: CPEVENT2
details_variables_variable_label: CPEVENT2
details_variables_status: changed
details_variables_details_r_type_new_value: unary
details_variables_details_r_type_old_value: binary
details_variables_message: Variable with different R Type
details_variables_variable_id: 5a4b4647855d783b494f9d26
details_variables_variable_name: CP_UNSCHEDULED
details_variables_variable_label: CP_UNSCHEDULED
details_variables_status: changed
details_variables_details_r_type_new_value: undefined
details_variables_details_r_type_old_value: unary
details_variables_message: Variable with different R Type
details_variables_variable_id: 5a4b4647855d783b494f9d02
details_variables_variable_name: VISIT_NUMBER
details_variables_variable_label: VISIT_NUMBER
details_variables_status: changed
details_variables_details_r_type_new_value: unary
details_variables_details_r_type_old_value: integer
details_variables_message: Variable with different R Type
details_variables_variable_id: 5a4b4647855d783b494f9ccf
details_variables_variable_name: VISIT_NUMBER2
details_variables_variable_label: VISIT_NUMBER2
details_variables_status: changed
details_variables_details_r_type_new_value: unary
details_variables_details_r_type_old_value: binary
details_variables_message: Variable with different R Type
details_many_visits: None

針對(duì)你修改后的問(wèn)題, 再加個(gè)函數(shù)就搞定:

# 這個(gè)fuck_all函數(shù)比較特例, 完全是針對(duì)你要區(qū)分的dataset下面的N個(gè)變量信息這種需求
def fuck_all(dic, prefix="details_variables"):
    lst = list(flatten(dic))  # flatten函數(shù)則比較通用,任何嵌套數(shù)據(jù)集都可以用它拍平
    lines = []
    top = {k: v for k, v in lst if not k.startswith(prefix)}
    index = 0
    for key, value in lst:
        if not key.startswith(prefix):
            continue
        else:
            if not lines:
                lines.append(top.copy())
        if key in lines[index].keys():
            index += 1
            lines.append(top.copy())
        lines[index][key] = value
    return lines

d = {your dataset}
for i in fuck_all(d):
    print(i)    

結(jié)果長(zhǎng)這樣,應(yīng)該是能滿(mǎn)足你需求了

{'status': 'changed', 'dataset_id': '5a4b463c855d783af4f5f695', 'dataset_name': 'AE_E', 'dataset_label': '1- ADVERSE EVENTS - Not Analyzed', 'details_many_visits': None, 'details_variables_variable_id': '5a4b4647855d783b494f9d3f', 'details_variables_variable_name': 'CPEVENT', 'details_variables_variable_label': 'CPEVENT', 'details_variables_status': 'changed', 'details_variables_details_r_type_new_value': 'unary', 'details_variables_details_r_type_old_value': 'factor', 'details_variables_message': 'Variable with different R Type'}
{'status': 'changed', 'dataset_id': '5a4b463c855d783af4f5f695', 'dataset_name': 'AE_E', 'dataset_label': '1- ADVERSE EVENTS - Not Analyzed', 'details_many_visits': None, 'details_variables_variable_id': '5a4b4647855d783b494f9d25', 'details_variables_variable_name': 'CPEVENT2', 'details_variables_variable_label': 'CPEVENT2', 'details_variables_status': 'changed', 'details_variables_details_r_type_new_value': 'unary', 'details_variables_details_r_type_old_value': 'binary', 'details_variables_message': 'Variable with different R Type'}
{'status': 'changed', 'dataset_id': '5a4b463c855d783af4f5f695', 'dataset_name': 'AE_E', 'dataset_label': '1- ADVERSE EVENTS - Not Analyzed', 'details_many_visits': None, 'details_variables_variable_id': '5a4b4647855d783b494f9d26', 'details_variables_variable_name': 'CP_UNSCHEDULED', 'details_variables_variable_label': 'CP_UNSCHEDULED', 'details_variables_status': 'changed', 'details_variables_details_r_type_new_value': 'undefined', 'details_variables_details_r_type_old_value': 'unary', 'details_variables_message': 'Variable with different R Type'}
{'status': 'changed', 'dataset_id': '5a4b463c855d783af4f5f695', 'dataset_name': 'AE_E', 'dataset_label': '1- ADVERSE EVENTS - Not Analyzed', 'details_many_visits': None, 'details_variables_variable_id': '5a4b4647855d783b494f9d02', 'details_variables_variable_name': 'VISIT_NUMBER', 'details_variables_variable_label': 'VISIT_NUMBER', 'details_variables_status': 'changed', 'details_variables_details_r_type_new_value': 'unary', 'details_variables_details_r_type_old_value': 'integer', 'details_variables_message': 'Variable with different R Type'}
{'status': 'changed', 'dataset_id': '5a4b463c855d783af4f5f695', 'dataset_name': 'AE_E', 'dataset_label': '1- ADVERSE EVENTS - Not Analyzed', 'details_many_visits': None, 'details_variables_variable_id': '5a4b4647855d783b494f9ccf', 'details_variables_variable_name': 'VISIT_NUMBER2', 'details_variables_variable_label': 'VISIT_NUMBER2', 'details_variables_status': 'changed', 'details_variables_details_r_type_new_value': 'unary', 'details_variables_details_r_type_old_value': 'binary', 'details_variables_message': 'Variable with different R Type'}

送佛送到西好了

from functools import reduce
import json

import pandas as pd


with open("your dataset file", "r") as fh:
    dic = json.load(fh)

df = pd.DataFrame(reduce(lambda x, y: x + y, (fuck_all(i) for i in dic)))
df.to_csv("out.csv", index=False)

成品

clipboard.png

墨小白 回答

Laravel的session機(jī)制是:在程序的運(yùn)行的過(guò)程中是把你的對(duì)session的操作用一個(gè)類(lèi)記錄在內(nèi)存中,然后在response發(fā)送給用戶(hù)以后執(zhí)行session中間中的terminate方法把session數(shù)據(jù)持久化到相應(yīng)的介質(zhì)中去。如果在windows和linux下面沒(méi)問(wèn)題,到了mac下就出了題很有可能是最后持久化的時(shí)候出了問(wèn)題。
你是否更改了存儲(chǔ)介質(zhì),比如從redis變到了文件。那么那個(gè)文件有沒(méi)有寫(xiě)的權(quán)限?要給storage目錄足夠的權(quán)限
如果是用內(nèi)存存儲(chǔ)的session那么redis或者memerycache是否配置正確?
還有就像樓上說(shuō)的那樣,不要用dd,因?yàn)閐d完之后會(huì)終止程序,session就不會(huì)持久化,只是將運(yùn)行內(nèi)存中的值給你打印出來(lái)了而已。
還有一個(gè)debug方法,在Session::put()之后加一句

Session::save();

這句代碼是手動(dòng)持久化session。如果成功說(shuō)明你的session持久化沒(méi)問(wèn)題,只是你程序運(yùn)行的時(shí)候沒(méi)有到持久化這一步。
如果失敗回報(bào)失敗的原因。
有一次我遇到了session寫(xiě)不進(jìn)去是因?yàn)橛脖P(pán)滿(mǎn)了...

瞄小懶 回答

你好,升級(jí)到4.3以后,新多出個(gè)HttpClient模塊,如果要使用攔截器,需要,將老的http改為,HttpClient.
相關(guān)代碼:

import { HttpClient } from '@angular/common/http';
this.http.get<UserResponse>('https://api.github.com/users/seeschweiler').subscribe(
  data => {
    console.log("User Login: " + data.login);
    console.log("Bio: " + data.bio);
    console.log("Company: " + data.company);
  },
  err => {
    console.log("Error occured.")
  }
);
@admin.route('/ImageUpdate', methods=['POST'])
def getimage():
    file = request.files['wangEditorH5File']
墨小白 回答

vue-router提供了導(dǎo)航守衛(wèi),你可以在守衛(wèi)里監(jiān)聽(tīng)路由的切換狀態(tài),
axios有cancelToken可以取消請(qǐng)求

孤島 回答

VMWare的那幾項(xiàng)服務(wù)啟動(dòng)沒(méi)有
cmd運(yùn)行 netsh winsock reset 重置winsock試試看
黑屏跟你說(shuō)的這些配置信息和網(wǎng)絡(luò)適配器沒(méi)多少關(guān)系

氕氘氚 回答

請(qǐng)編輯 Grunt 的配置文件 Gruntfile.js,參考下面的代碼:

module.exports = function (grunt) {
  grunt.initConfig({
    jshint: {                            
      all: 'js/*.js',
      options: {
        jshintrc: true
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-jshint');

  grunt.registerTask('default', ['jshint']);
};

然后,運(yùn)行 grunt