龍巖易富通網(wǎng)絡(luò)科技有限公司http://www.xjjjv6omnt78jk.com/龍巖小程序開發(fā),龍巖分銷系統(tǒng)centos 格式化掛載數(shù)據(jù)盤http://www.xjjjv6omnt78jk.com/post/2712.html<p>本示例以CentOS 7.6 64位系統(tǒng)為例,介紹如何在Linux服務(wù)器上使用Parted和e2fsprogs工具分區(qū)并格式化數(shù)據(jù)盤。</p><p><br/></p><p>Linux服務(wù)器上掛載的數(shù)據(jù)盤,建議您采用GPT分區(qū)格式,并采用xfs或者ext4文件系統(tǒng)。</p><p>1、遠程連接Linux服務(wù)器,并安裝Parted和e2fsprogs工具。</p><p>a、遠程連接服務(wù)器。</p><p>b、運行以下命令,切換為root用戶,并返回根目錄。</p><p>sudo su root</p><p>cd</p><p>c、依次運行以下命令,安裝Parted和e2fsprogs工具。</p><p>安裝Parted工具:</p><p>yum install -y parted</p><p>安裝e2fsprogs工具:</p><p>yum install -y e2fsprogs</p><p><br/></p><p>2、運行以下命令,查看服務(wù)器內(nèi)的數(shù)據(jù)盤信息。</p><p>fdisk -l</p><p>查看到的數(shù)據(jù)盤信息。</p><p></p><p>3、使用Parted工具為數(shù)據(jù)盤進行分區(qū)。</p><p>a、運行以下命令開始分區(qū)。</p><p>parted /dev/vdb</p><p>b、運行以下命令,設(shè)置GPT分區(qū)。</p><p>mklabel gpt</p><p>系統(tǒng)將提示您轉(zhuǎn)換分區(qū)格式將導(dǎo)致磁盤數(shù)據(jù)丟失。本文介紹如何處理一塊全新的數(shù)據(jù)盤,因此輸入Yes即可。</p><p>c、運行以下命令,劃分一個主分區(qū),并設(shè)置分區(qū)的開始位置和結(jié)束位置。</p><p>mkpart primary 1 100%</p><p>d、運行以下命令,檢查分區(qū)是否對齊。</p><p>align-check optimal 1</p><p>e、運行以下命令,查看分區(qū)表。</p><p>print</p><p>f、運行以下命令,退出Parted工具。</p><p>quit</p><p><br/></p><p>4、運行以下命令,使系統(tǒng)重讀分區(qū)表。</p><p>partprobe</p><p><br/></p><p>5、運行以下命令,為/dev/vdb1分區(qū)創(chuàng)建一個文件系統(tǒng)。</p><p>根據(jù)您的需求運行以下任一命令,創(chuàng)建文件系統(tǒng)。</p><p>創(chuàng)建一個ext4文件系統(tǒng)。</p><p>mkfs -t ext4 /dev/vdb1</p><p>創(chuàng)建一個xfs文件系統(tǒng)。</p><p>mkfs -t xfs /dev/vdb1</p><p>本示例中選擇創(chuàng)建ext4文件系統(tǒng)。</p><p><br/></p><p>6、在/etc/fstab文件中寫入新分區(qū)信息,啟動開機自動掛載分區(qū)。</p><p>a、運行以下命令,創(chuàng)建一個名為/data的掛載點。</p><p>mkdir /data</p><p>b、運行以下命令,備份/etc/fstab。</p><p>cp /etc/fstab /etc/fstab.bak</p><p>c、運行以下命令,向/etc/fstab里寫入新分區(qū)信息。</p><p>echo `blkid /dev/vdb1 | awk &#39;{print $2}&#39; | sed &#39;s/\&quot;//g&#39;` /data ext4 defaults 0 0 &gt;&gt; /etc/fstab</p><p>說明/dev/vdb1為數(shù)據(jù)盤分區(qū)設(shè)備名、/data為本示例中自定義的掛載點、ext4表示ext4文件系統(tǒng),您需要根據(jù)實際情況做相應(yīng)修改。</p><p>d、運行以下命令,查看/etc/fstab的信息。</p><p>cat /etc/fstab</p><p>如果返回結(jié)果里出現(xiàn)了寫入的新分區(qū)信息,說明寫入成功。</p><p>e、運行以下命令,使/etc/fstab中掛載數(shù)據(jù)盤的配置生效。</p><p>mount -a</p><p><br/></p><p>7、運行以下命令,查看目前磁盤空間和使用情況。</p><p>df -h</p><p>如果返回結(jié)果里出現(xiàn)新建文件系統(tǒng)的信息,說明掛載成功,您可以使用新的文件系統(tǒng)了。</p><p><br/></p>Fri, 04 Apr 2025 16:35:05 +0800uniapp 微信小程序v-model雙向綁定沖突http://www.xjjjv6omnt78jk.com/post/2711.html<p><br/></p><p><span style="">&lt;input type=&quot;text&quot; class=&quot;input-text&quot; placeholder=&quot;請?zhí)顚戫椖棵?amp;quot; :value=&quot;info.title&quot; @input=&quot;handleInput&quot; data-model=&quot;title&quot;&gt;</span></p><p><span style=""><br/></span></p><p><span style=""><br/></span></p><p><span style="">handleInput(e) {</span></p><p><span style="">&nbsp; &nbsp;var that = this;</span></p><p><span style="">&nbsp; &nbsp;var name = e.currentTarget.dataset.model;</span></p><p><span style="">&nbsp; &nbsp;that.$set(that, name, e.detail.value);</span></p><p><span style="">},</span></p><p><br/></p>Wed, 02 Apr 2025 15:28:19 +0800uniapp 一個數(shù)組賦值給另一個數(shù)組后,修改值原有數(shù)組變量也會更改http://www.xjjjv6omnt78jk.com/post/2710.html<p>小程序一個數(shù)組賦值給另一個數(shù)組后,修改值原有數(shù)組變量也會更改</p><p>原因在js代碼中,字符串、數(shù)字、布爾、這種稱為基礎(chǔ)類型是可以直接賦值的,即使是修改后也不會影響原來的數(shù)據(jù)。但是引用類型比如object,array這種就會出現(xiàn)上面描述的問題。</p><p><br/></p><p>解決方法:var data=JSON.parse(JSON.stringify(data));</p><p><br/></p>Mon, 24 Feb 2025 09:25:52 +0800js在當(dāng)前日期添加天、周、月、年http://www.xjjjv6omnt78jk.com/post/2709.html<p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">//創(chuàng)建date</span></p><p><span style="text-wrap-mode: nowrap;">var nowDate = new Date();</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">//添加天數(shù)</span></p><p><span style="text-wrap-mode: nowrap;">nowDate.setDate(nowDate.getDate() + 1);</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">//添加周 添加周用添加天的方式,來添加七天,即為一周</span></p><p><span style="text-wrap-mode: nowrap;">nowDate.setDate(nowDate.getDate() + 7);</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">//添加月數(shù)</span></p><p><span style="text-wrap-mode: nowrap;">nowDate.setMonth(nowDate.getMonth() + 1);</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">//添加年數(shù)</span></p><p><span style="text-wrap-mode: nowrap;">nowDate.setYear(nowDate.getFullYear() + 1);</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">打印格式為年月日時分秒</span></p><p><span style="text-wrap-mode: nowrap;">const year = nowDate.getFullYear();</span></p><p><span style="text-wrap-mode: nowrap;">const month = (nowDate.getMonth() + 1).toString().padStart(2, &#39;0&#39;);</span></p><p><span style="text-wrap-mode: nowrap;">const day = nowDate.getDate().toString().padStart(2, &#39;0&#39;);</span></p><p><span style="text-wrap-mode: nowrap;">const hours = nowDate.getHours().toString().padStart(2, &#39;0&#39;);</span></p><p><span style="text-wrap-mode: nowrap;">const minutes = nowDate.getMinutes().toString().padStart(2, &#39;0&#39;);</span></p><p><span style="text-wrap-mode: nowrap;">const seconds = nowDate.getSeconds().toString().padStart(2, &#39;0&#39;);</span></p><p><span style="text-wrap-mode: nowrap;">console.log(`${year}-${month}-${day} ${hours}:${minutes}:${seconds}`);</span></p><p><br/></p>Wed, 11 Dec 2024 17:16:15 +0800centos 禁用php5.6版本eval函數(shù)http://www.xjjjv6omnt78jk.com/post/2708.html<p><span style="text-wrap-mode: nowrap;">不支持PHP8,官方只支持PHP7以下</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">服務(wù)器只裝了一個PHP5.6版本,一定要安裝對應(yīng)的suhosin-0.9.38版本,</span></p><p><span style="text-wrap-mode: nowrap;">測試成功是&nbsp; php5.x: wget https://download.suhosin.org/suhosin-0.9.38.tar.gz</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">一、安裝Suhosin</span></p><p><strong><span style="text-wrap-mode: nowrap;">1、不是寶塔環(huán)境</span></strong></p><p><span style="text-wrap-mode: nowrap;">cd /usr/local/src</span></p><p><span style="text-wrap-mode: nowrap;">wget https://download.suhosin.org/suhosin-0.9.38.tar.gz</span></p><p><span style="text-wrap-mode: nowrap;">tar zxvf suhosin-0.9.38.tar.gz</span></p><p><span style="text-wrap-mode: nowrap;">cd suhosin-0.9.38</span></p><p><span style="text-wrap-mode: nowrap;">/usr/local/php/bin/phpize</span></p><p><span style="text-wrap-mode: nowrap;">./configure --with-php-config=/usr/local/php/bin/php-config</span></p><p><span style="text-wrap-mode: nowrap;">make&nbsp;</span></p><p><span style="text-wrap-mode: nowrap;">make install</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><strong><span style="text-wrap-mode: nowrap;">2、寶塔環(huán)境安裝</span></strong></p><p><span style="text-wrap-mode: nowrap;">cd /usr/local/src</span></p><p><span style="text-wrap-mode: nowrap;">wget https://download.suhosin.org/suhosin-0.9.38.tar.gz</span></p><p><span style="text-wrap-mode: nowrap;">tar zxvf suhosin-0.9.38.tar.gz</span></p><p><span style="text-wrap-mode: nowrap;">cd suhosin-0.9.38</span></p><p><span style="text-wrap-mode: nowrap;">/www/server/php/56/bin/phpize</span></p><p><span style="text-wrap-mode: nowrap;">./configure --with-php-config=/www/server/php/56/bin/php-config</span></p><p><span style="text-wrap-mode: nowrap;">make</span></p><p><span style="text-wrap-mode: nowrap;">make install</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">安裝完成之后,出現(xiàn)下面的界面,說明安裝成功。</span></p><p><span style="text-wrap-mode: nowrap;">/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/&nbsp; #suhosin模塊路徑</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">二、在php.ini下加入suhosin.so即可</span></p><p><span style="text-wrap-mode: nowrap;">extension=suhosin.so</span></p><p><span style="text-wrap-mode: nowrap;">suhosin.executor.disable_eval = on</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">三、測試確定是禁止,運行下面代碼</span></p><p><span style="text-wrap-mode: nowrap;">&lt;?php</span></p><p><span style="text-wrap-mode: nowrap;">eval(&quot;echo&#39;hello world&#39;;&quot;);</span></p><p><span style="text-wrap-mode: nowrap;">?&gt;</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">如果能輸出:hello world,說明沒有禁用,</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">如果什么都看不到或報錯,說明正確,已經(jīng)禁用</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">如果還是看的到,重啟下服務(wù)器。</span></p><p><br/></p>Sat, 02 Nov 2024 10:16:52 +0800返回json格式報錯:Inf and NaN cannot be JSON encodedhttp://www.xjjjv6omnt78jk.com/post/2707.html<p>$res = unserialize(str_replace(array(&#39;NAN;&#39;,&#39;INF;&#39;),&#39;0;&#39;,serialize($res)));<br/></p><p><br/></p>Wed, 16 Oct 2024 21:43:37 +0800tp5.1 時間戳運算后比較http://www.xjjjv6omnt78jk.com/post/2706.html<p>&nbsp;db( &#39;goods&#39; )-&gt;where( array ([ &#39;status&#39;,&#39;&lt;&#39;,4 ] ))-&gt;whereRaw(&quot;update_time+&quot; . 24 * 60 * 60 . &#39;&lt;&#39; . time () )-&gt;select;</p>Mon, 05 Aug 2024 16:08:59 +0800 php獲取本周一、周日http://www.xjjjv6omnt78jk.com/post/2705.html<p>$week = date ( &#39;w&#39; ) == 0 ? 7 : date ( &#39;w&#39; );</p><p>$monday = strtotime ( &#39;today -&#39; . ($week - 1) . &#39;day&#39; );</p><p>$sunday = strtotime ( &#39;today +&#39; . (8 - $week) . &#39;day -1second&#39; );</p><p>&nbsp;</p><p>$monday_date = date(&quot;Y-m-d&quot;, $monday);&nbsp; // 本周一的日期(年-月-日)</p><p>$sunday_date = date(&quot;Y-m-d&quot;, $sunday);&nbsp; // 本周日的日期(年-月-日)</p><p>&nbsp;</p><p>echo &quot;本周一:&quot;.$monday_date.&quot;&lt;br&gt;&quot;;</p><p>echo &quot;本周日:&quot;.$sunday_date;</p><p><br/></p>Mon, 24 Jun 2024 09:15:03 +0800小程序昨天日期(年月日)函數(shù)http://www.xjjjv6omnt78jk.com/post/2704.html<p>function getYesterdayDate() {</p><p>&nbsp; const today = new Date();</p><p>&nbsp; const yesterday = new Date(today.getTime() - (24 * 60 * 60 * 1000));</p><p>&nbsp; return yesterday.toISOString().split(&#39;T&#39;)[0];</p><p>}</p><p>&nbsp;</p><p>console.log(getYesterdayDate()); // 輸出格式為YYYY-MM-DD</p><p><br/></p>Mon, 03 Jun 2024 16:35:12 +0800小程序通過掃碼進入http://www.xjjjv6omnt78jk.com/post/2703.html<p>onLoad((options)=&gt;{</p><p>&nbsp; &nbsp; if(options.scene){</p><p><span style="white-space-collapse: preserve;"></span>&nbsp; &nbsp; &nbsp; const scene = decodeURIComponent(options.scene)</p><p><span style="white-space-collapse: preserve;"></span>&nbsp; &nbsp; &nbsp; console.log(scene.id);</p><p>&nbsp; &nbsp; }</p><p>})</p><p><br/></p>Mon, 01 Apr 2024 22:40:59 +0800