httpd.conf文件里有個配置項
<Files ".ht*">
Require all denied
</Files>
添加一個
<Files "buildinfo.txt">
Require all denied
</Files>
即可
兩個完全不同的模塊...雖然經常有人是const fs=require("querystring")。然而它們沒半毛錢關系
querystring(文檔)是node的核心模塊,主要用來自定義url的分隔符,大概像這樣:
querystring.parse('a^4~f^6','~','^')
//{ a: '4', f: '6' }
qs模塊需要通過npm安裝,最早是由TJ大神編寫的。它是A querystring parser with nesting support,即一個支持嵌套的查詢字符串解析器,示例:
var expected = {
a: {
b: {
c: {
d: {
e: {
f: {
'[g][h][i]': 'j'
}
}
}
}
}
}
};
var string = 'a[b][c][d][e][f][g][h][i]=j';
assert.deepEqual(qs.parse(string), expected);
看上去有些奇葩,不過我看它昨天有738,087的下載量,估計有很多模塊是依賴它的。
<div class="btn">x1</div>
<div class="btn">x2</div>
<div class="btn">x3</div>
<div class="btn">x4</div>
對應
x1
x2
x3
x4
vue-cli里默認是把純靜態(tài)資源放在static下的,參見dev-server.js里的這段代碼
var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
app.use(staticPath, express.static('./static'))
cookie 有時效性...
//設置別名(新的調用會覆蓋之前的設置)
JPushInterface.setAlias(this, sequence,Id);
//設置標簽(同上)
JPushInterface.setTags(this, sequence, setUserTags(name));
private static Set<String> setUserTags(String name) {
//添加3個標簽用戶(獲取登錄userid較為常見)
Set<String> tags = new HashSet<>();
tags.add(name);
return tags;
}1.如果用的是jQuery Ajax,可以使用自帶的全局處理;
$.ajaxSetup({
type: "POST",
error: function(xhr, textStatus, errorThrown){
switch (xhr.status){
case(408):
alert("請求超時");
break;
default:
break;
}
},
success: function(data){
alert("操作成功");
}
});
2.如果用的是 fetch或者XMLHttpRequest,可以封裝一個處理請求的模塊,在這個模塊里處理一些全局的網絡錯誤。以后所有的請求都用這個模塊去處理。
哈哈哈,今天無意中找到解決辦法了
是php的路徑問題,比如我的php.exe的路徑是D:wampbinphpphp7.0.23\
test.php的文件編碼是utf-8
git bash的終端編碼也已經設置成utf-8
在git bash中使用 /D/wamp/bin/php/php7.0.23/php ./test.php 就能正常輸出中文了
所以解決的步驟就是:
1.vim ~/.bashrc
2.
export LANG=en_US.utf-8
export PATH="$PATH:/D/wamp/bin/php/php7.0.23"
3.source ~/.bashrc
至于為什么路徑的問題會造成亂碼就不清楚了
裝個正式版本試試,別用beta
OPTION 的那個請求,應該跨域 XHR2 中的。
vueLazyload 試試這個插件
你的數據不支持jsonp格式調用,改下后端數據,用callback函數包裹你的數據;
試試將js引用順序改一下,放到head里
內置了地圖的sdk
read_excel('xxx.xls',encoding = 'utf8')應該能避免那種中文編碼錯誤
我的邏輯是這樣的,就是自己保存進了state,再從不同界面取出state的數據
<template>
<div class="single" ref="single">
<div class="beforeContent">
<h2 v-show="this.biaoti.length>0" v-html="this.biaoti[0]"></h2>
<p class="ppp" v-html="this.biaotiNeirong[0]"></p>
<el-button type="primary" @click="back">編輯</el-button>
</div>
<div class="titleWrapper">
<div class="top">
<p>1、"index"</p>
<p>必填</p>
<!--單選標題部分-->
<el-form :model="ruleForm3" :rules="rules3" ref="ruleForm3" class="demo-ruleForm">
<el-form-item label="編輯選項標題信息" prop="singleTit">
<el-input v-model="ruleForm3.singleTit" placeholder="請輸入選項標題信息"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm3('ruleForm3')">完成</el-button>
<el-button @click="resetForm3('ruleForm3')">重置</el-button>
</el-form-item>
</el-form>
<p style="margin:10px 0 5px;">添加圖片 <small style="font-size:13px;color:gray;">[選填]</small></p>
<!--添加圖片上傳功能-->
<div style="border: 1px dashed red;" class="imgAdd">
<el-upload
:action="imgURL"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
:before-upload="beforeAvatarUpload"
:on-success="handleAvatarSuccess">
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog :visible.sync="dialogVisible">
<img width="120%" :src="dialogImageUrl" alt="">
</el-dialog>
</div>
<!--編輯選項內容部分-->
<!--單選框表單部分-->
<el-form :model="dynamicValidateForm" ref="dynamicValidateForm" class="demo-dynamic">
<el-form-item
v-for="(domain, index) in dynamicValidateForm.domains"
:label="'編輯選項內容' + `${index+1}`"
:key="domain.key"
:prop="'domains.' + index + '.value'"
:rules="[
{ required: true, message: '請輸入提示信息', trigger: 'blur' },
{ min: 1, max: 5, message: '長度在 3 到 5 個字符', trigger: 'blur' }
]"
>
<el-input v-model="domain.value" placeholder="請輸入選項內容"></el-input>
{{domain.value}}
<div class="imgIcon">
<div class="to-delete">
<i class="iconfont toDelete" @click.prevent="removeDomain(domain)"></i>
</div>
</div>
<!--
<p>增刪變序功能</p>
<div class="imgIcon">
<div class="to-down">
<i class="iconfont toDown"></i>
</div>
<div class="to-top">
<i class="iconfont toTop"></i>
</div>
<div class="to-delete">
<i class="iconfont toDelete"></i>
</div>
</div>
-->
</el-form-item>
<el-form-item>
<el-button @click="addDomain" type="primary">新增選項</el-button>
<el-button @click="submitForm6('dynamicValidateForm')" type="primary">完成</el-button>
<el-button @click="resetForm6('dynamicValidateForm')" style="margin-top:10px;">重置單選</el-button>
<el-button @click="submitAll" type="primary" style="margin-top:10px;">提交</el-button>
</el-form-item>
</el-form>
</div>
</div>
<span style="font-size:13px;">當患者填寫完成后,提示患者:</span>
<p class="gray">{{this.tishi[0]}}</p>
<div class="button" style="text-align:right;">
<router-link to="/Head/title">
<el-button type="primary" @click="back">編輯</el-button>
</router-link>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import '@/common/js/mockCommon'
import {mapMutations,mapGetters} from 'vuex'
let reg = /^.{1,20}$/
export default {
props: {
right: {
type: String
}
},
data() {
return{
flag: false,
flagger: false,
dialogImageUrl: '',
dialogVisible: false,
imgURL: 'http://mockjs.com/dist/mock',
imageUrl: '',
imageNum: 0 ,
dynamicValidateForm: {
domains: [{
value: ''
}]
},
ruleForm3: {
singleTit: ''
},
rules3: {
singleTit: [
{ required: true, message: '請輸入標題名稱', trigger: 'blur' },
{ min: 1, max: 5, message: '長度在 3 到 5 個字符', trigger: 'blur' }
]
}
}
},
computed: {
...mapGetters([
'biaoti',
'biaotiNeirong',
'tishi',
'danxuan',
'danxuanBiaoti',
'danxuanXiang',
'imgurlDan'
])
},
mounted() {
this.$nextTick(() => {
this._neiStyle();
})
},
methods: {
/*上傳圖片部分*/
handleAvatarSuccess(res, file) {
this.imageUrl = URL.createObjectURL(file.raw);
console.log(this.imageUrl);
this.addimgurlDan(this.imageUrl)
},
beforeAvatarUpload(file) {
const isJPG = file.type === 'image/jpeg';
const isGIF = file.type === 'image/gif';
const isPNG = file.type === 'image/png';
const isBMP = file.type === 'image/bmp';
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isJPG && !isGIF && !isPNG && !isBMP) {
this.$message.error('上傳圖片必須是JPG/GIF/PNG/BMP 格式!');
}
if (!isLt2M) {
this.$message.error('上傳圖片大小不能超過 2MB!');
}
this.imageNum++;
if(this.imageNum>3){
this.$message.error('最多只能上傳3張圖片');
return (!isJPG || !isBMP || !isGIF || !isPNG) && !isLt2M;
}
return (isJPG || isBMP || isGIF || isPNG) && isLt2M;
},
handleRemove(file, fileList) {
this.cutimgurlDan(this.imageUrl);
this.imageNum--;
console.log(file, fileList);
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
//頁面剛剛加載完成執(zhí)行的部分
_neiStyle(){
this.$refs.single.style.width = this.right;
this.addDomain();
},
back() {
this.$router.push('/Head/title');
},
chooseImg() {
axios.get('http://mockjs.com/dist/mock').then((res) => {
console.log(res)
})
},
//單選標題
submitForm3(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.$message.success('提交成功');
console.log(this.ruleForm3.singleTit);
this.adddanxuanBiaoti(this.ruleForm3.singleTit);
this.flag = true;
} else {
this.$message.error('提交失敗');
this.flag = false;
return false;
}
});
},
resetForm3(formName) {
this.flag = false;
this.cutdanxuanBiaoti(this.ruleForm3.singleTit);
this.$refs[formName].resetFields();
},
//單選選項部分
submitForm6(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.$message.success('提交成功');
this.addSucesess();
this.flagger = true;
} else {
this.$message.error('提交失敗');
this.flagger = false;
return false;
}
});
},
addSucesess() {
let index = this.dynamicValidateForm.domains.length
let domains = this.dynamicValidateForm.domains
for(index in domains){
//console.log(domains[index].value)
this.adddanxuanXiang(domains[index].value)
}
},
resetForm6(formName) {
this.cutdanxuanXiang(this.danxuanXiang);
this.$refs[formName].resetFields();
},
//整體提交
submitAll() {
if(this.flag === true && this.flagger){
this.adddanXuan(this.danxuanBiaoti)
this.adddanXuan(this.imgurlDan)
this.adddanXuan(this.danxuanXiang)
}else{
this.$message.error('提交失敗,請檢查提交信息!');
}
console.log(this.dynamicValidateForm.domains)
},
removeDomain(item) {
var index = this.dynamicValidateForm.domains.indexOf(item)
console.log(index);
if (index !== -1) {
this.dynamicValidateForm.domains.splice(index, 1)
}
},
addDomain() {
if(this.dynamicValidateForm.domains.length>2){
this.$message.error('單選最多只能添加3個選項')
return
}
this.dynamicValidateForm.domains.push({
value: '',
key: Date.now()
});
},
...mapMutations({
adddanXuan: 'ADD_DANXUAN',
adddanxuanBiaoti: 'ADD_DANXUANBIAOTI',
adddanxuanXiang: 'ADD_DANXUANXIANG',
addimgurlDan: 'ADD_IMGURLDAN',
cutdanXuan: 'CUT_DANXUAN',
cutdanxuanBiaoti: 'CUT_DANXUANBIAOTI',
cutdanxuanXiang: 'CUT_DANXUANXIANG',
cutimgurlDan: 'CUT_IMGURLDAN'
})
},
components: {
}
}
</script>1.currentTarget是指當前事件處理函數綁定的對象,這個值不可能是null的
2.你之所以在log里看到的是null,是因為這個event是一個引用,在log的時候里面的一些屬性可能被重置了
北大青鳥APTECH成立于1999年。依托北京大學優(yōu)質雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數據專業(yè)的國家
達內教育集團成立于2002年,是一家由留學海歸創(chuàng)辦的高端職業(yè)教育培訓機構,是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
北大課工場是北京大學校辦產業(yè)為響應國家深化產教融合/校企合作的政策,積極推進“中國制造2025”,實現(xiàn)中華民族偉大復興的升級產業(yè)鏈。利用北京大學優(yōu)質教育資源及背
博為峰,中國職業(yè)人才培訓領域的先行者
曾工作于聯(lián)想擔任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔任項目經理從事移動互聯(lián)網管理及研發(fā)工作,曾創(chuàng)辦藍懿科技有限責任公司從事總經理職務負責iOS教學及管理工作。
浪潮集團項目經理。精通Java與.NET 技術, 熟練的跨平臺面向對象開發(fā)經驗,技術功底深厚。 授課風格 授課風格清新自然、條理清晰、主次分明、重點難點突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網頁制作和網頁游戲開發(fā)。
具有10 年的Java 企業(yè)應用開發(fā)經驗。曾經歷任德國Software AG 技術顧問,美國Dachieve 系統(tǒng)架構師,美國AngelEngineers Inc. 系統(tǒng)架構師。