你這個邏輯有點(diǎn)復(fù)雜 歸根結(jié)底是判斷用戶是否在某個時間段內(nèi)
所以反過來判斷 先找出用戶的時間段 然后根據(jù)當(dāng)前時間戳判斷
var username = "aaa";
function inTimeSlot(arr,username){
var timestamp = Date.parse(new Date());//js獲取的都是到毫秒 我看你的數(shù)據(jù)是10位,這個要把后三位截掉
for(var i=0;i<arr.length;i++){
for(var j=0;arr[i].user_list.length;j++){
if(username==arr[i].user_list[j].user.username){//找到用戶在那個時間段內(nèi)
if(timestamp>=arr[i].start_at&×tamp<=arr[i].end_at){
return {in_now_time:true,data:arr[i]} //在當(dāng)前時間段內(nèi)
}else{
return {in_now_time:false,data:arr[i]}//不在當(dāng)前時間段內(nèi)
}
}
}
}
}
}
menuItemsArray默認(rèn)值是null吧
querySelectorAll轉(zhuǎn)成數(shù)組應(yīng)該不會是null
this.$refs.form.reset()
spring mvc上傳文件的時候,你需要在spring mvc配置文件中配置org.springframework.web.multipart.commons.CommonsMultipartResolver文件上傳解析器。
1:當(dāng)一個請求過來的時候,會調(diào)用DispatcherServlet類中的doDispatch(HttpServletRequest, HttpServletResponse)方法。
doDispatch方法體
protected void doDispatch(HttpServletRequest request, HttpServletResponse response) throws Exception {
HttpServletRequest processedRequest = request;
HandlerExecutionChain mappedHandler = null;
boolean multipartRequestParsed = false;
WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(request);
try {
ModelAndView mv = null;
Exception dispatchException = null;
try {
processedRequest = checkMultipart(request);
multipartRequestParsed = processedRequest != request;
// Determine handler for the current request.
mappedHandler = getHandler(processedRequest, false);
if (mappedHandler == null || mappedHandler.getHandler() == null) {
noHandlerFound(processedRequest, response);
return;
}
// Determine handler adapter for the current request.
HandlerAdapter ha = getHandlerAdapter(mappedHandler.getHandler());
// Process last-modified header, if supported by the handler.
String method = request.getMethod();
boolean isGet = "GET".equals(method);
if (isGet || "HEAD".equals(method)) {
long lastModified = ha.getLastModified(request, mappedHandler.getHandler());
if (logger.isDebugEnabled()) {
String requestUri = urlPathHelper.getRequestUri(request);
logger.debug("Last-Modified value for [" + requestUri + "] is: " + lastModified);
}
if (new ServletWebRequest(request, response).checkNotModified(lastModified) && isGet) {
return;
}
}
if (!mappedHandler.applyPreHandle(processedRequest, response)) {
return;
}
try {
// Actually invoke the handler.
mv = ha.handle(processedRequest, response, mappedHandler.getHandler());
}
finally {
if (asyncManager.isConcurrentHandlingStarted()) {
return;
}
}
applyDefaultViewName(request, mv);
mappedHandler.applyPostHandle(processedRequest, response, mv);
}
catch (Exception ex) {
dispatchException = ex;
}
processDispatchResult(processedRequest, response, mappedHandler, mv, dispatchException);
}
catch (Exception ex) {
triggerAfterCompletion(processedRequest, response, mappedHandler, ex);
}
catch (Error err) {
triggerAfterCompletionWithError(processedRequest, response, mappedHandler, err);
}
finally {
if (asyncManager.isConcurrentHandlingStarted()) {
// Instead of postHandle and afterCompletion
mappedHandler.applyAfterConcurrentHandlingStarted(processedRequest, response);
return;
}
// Clean up any resources used by a multipart request.
if (multipartRequestParsed) {
cleanupMultipart(processedRequest);
}
}
}
2:在doDispatch方法體中調(diào)用checkMultipart(request)方法判斷是否是文件上傳的請求,判斷是根據(jù)Content-type來的,如果是文件上傳的請求,在checkMultipart(request)方法中就會調(diào)用在CommonsMultipartResolver中的方法進(jìn)行文件解析(實(shí)際是調(diào)用apache commons-fileupload的文件長傳插件),解析完成后,其實(shí)文件已經(jīng)上傳到服務(wù)器本地磁盤了,請看下面的代碼片段。
protected HttpServletRequest checkMultipart(HttpServletRequest request) throws MultipartException {
if (this.multipartResolver != null && this.multipartResolver.isMultipart(request)) {
if (request instanceof MultipartHttpServletRequest) {
logger.debug("Request is already a MultipartHttpServletRequest - if not in a forward, " +
"this typically results from an additional MultipartFilter in web.xml");
}
else {
return this.multipartResolver.resolveMultipart(request);
}
}
// If not returned before: return original request.
return request;
}
在checkMultipart方法體中調(diào)用了CommonsMultipartResolver類的resolveMultipart方法去解析文件,該方法返回的是MultipartHttpServletRequest對象,該對象中存有已經(jīng)上傳的服務(wù)器本地的文件對象。
3:獲取具體處理器的方法(mv = ha.handle(processedRequest, response, mappedHandler.getHandler()) 這行代碼)。
如果是文件上傳的話,processedRequest是上面的checkMultipart方法返回的對象。
實(shí)際調(diào)用的org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter類的handle方法,該方法中獲取實(shí)際被調(diào)用的方法參數(shù)上有哪些注解,然后根據(jù)注解的一些配置,從processedRequest獲取對應(yīng)的值。
比如你上面的testUpload()方法。在AnnotationMethodHandlerAdapter的handle()的方法中會獲取testUpload()的方法參數(shù)有@RequestParam這個注解,然后解析這個注解,從processedRequest請求中獲取到desc的值,獲取到名為file的文件,最后調(diào)用testUploaad()方法。具體是怎么解析的可以看看org.springframework.web.bind.annotation.support.HandlerMethodInvoker.resolveHandlerArguments(Method, Object, NativeWebRequest, ExtendedModelMap)這個方法體。
的確是HTML 4.01新增的安全策略。
魅族手機(jī)keycode好像拿到的都是0 什么情況
:current-page.sync="currentPage" 這個綁定的屬性是什么意思
fs
是nodejs自身的文件模塊,并不需要其他方式的安裝。
lz這個情況挺神奇的。。用root權(quán)限跑一下npm run dev
試試?;蚴侵匮b下node。
你這個好像沒做預(yù)加載吧(看代碼是直接寫頁面?)……沒做預(yù)加載肯定沒戲的,瀏覽器不會允許你突然冒這么大一個東西直接放的。
按說一般H5產(chǎn)品思路是把這個觸發(fā)放到預(yù)加載的結(jié)束提示上,這樣不會太突兀,也比較符合用戶習(xí)慣。
不要設(shè)置高度。。。。
上面的swiper在哪呢?
沒用過這個組件,但是組件總對外有事件暴露吧,比如sliderChangeEnd(滑動結(jié)束)什么的?
一個組件的滑動結(jié)束之后或者被點(diǎn)擊時,去調(diào)用另一個組件的滑動方法或者修改控制狀態(tài)的props的值就好了呀。
圖片node的lastUpdate
用的是UTC時間,轉(zhuǎn)換實(shí)際時間要加時區(qū)。
http.ServerResponse 類
1.如果writeHead
之后想要繼續(xù)返回內(nèi)容,應(yīng)該調(diào)用write
/end
方法。
2.cookie
是在第一次服務(wù)器響應(yīng)后在客戶端設(shè)置的,所以第二次客戶端的請求才會攜帶cookie
(個人理解)
這個屬于 div 橫向滑動問題
你百度一下有很多例子可以參考
搞了個大烏龍。遞歸組件的父組件中sectionList
也是異步獲取的,未等到sectionList數(shù)據(jù)獲取完畢,遞歸組件已經(jīng)mounted了,此時遞歸組件獲取到一個長度為零的sectionList
,并沒有發(fā)起獲取details的請求,就更沒有details的數(shù)據(jù)了。然后其實(shí)并不關(guān)v-show
的事,只是粗心,父組件獲取的到的sectionList數(shù)據(jù)是一個嵌套的樹形數(shù)據(jù),我在父組件遍歷了一遍只給第一層數(shù)據(jù)設(shè)置了show屬性,更深層次的結(jié)構(gòu)沒有show屬性而導(dǎo)致v-show
的判斷并不生效(深層的details數(shù)據(jù)已經(jīng)獲取到)但一直不會顯示出來,看到第一層沒有數(shù)據(jù)誤以為深層也是沒有數(shù)據(jù)。
兄弟,這和webpack有半毛錢關(guān)系,你是后臺數(shù)據(jù)怎么靜態(tài)化?而且dede也不是靜態(tài)化,他只不過不是用的接口,類型jsp那種形式,就是后臺和前端耦合。我覺得你應(yīng)該這樣,把你寫好的頁面(靜態(tài)頁面)給你們后臺,然后讓他把數(shù)據(jù)放進(jìn)去(不要使用ajax,axios形式)。
grep 'UNIVER_SEARCH_VIDEO' example.ini >> /etc/profile
...
source /etc/profile
先安裝依賴 npm install ip
代碼里面添加
const ip = require('ip');
const IPAddress = ip.address();
console.log(IPAddress);
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
北大青鳥中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。