Authored by 陈峰

浏览器检测

... ... @@ -5,10 +5,29 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>YOHO商铺管理平台</title>
<style>
.check-browers {
display: none;
}
</style>
</head>
<body>
<div id="app">
正在初始化
<div class="loading-init" id="loading-init">正在初始化...</div>
<div class="check-browers" id="check-browers">
检测到您的浏览器版本过低,请下载最新浏览器:
<ul>
<li><a href="http://browser.qq.com/mac/index.html">QQ浏览器</a></li>
<li><a href="http://www.firefox.com.cn/">火狐浏览器</a></li>
<li><a href="http://www.google.cn/intl/zh-CN/chrome/browser/desktop/index.html">Chrome浏览器</a></li>
</ul>
</div>
</div>
<script>
if (!Object.defineProperty) {
document.getElementById('loading-init').style.display = 'none';
document.getElementById('check-browers').style.display = 'block';
}
</script>
</body>
</html>
\ No newline at end of file
... ...
<template>
<div>
默认页
<div style="">
<Button v-purview="'opration'" @click="">我有权限吗?</Button>
<editor :content="content" @change="updateData"></editor>
<!--<Table ref="table" :data="data" :columns="columns"></Table>
<Button @click="getTable">获得数据</Button>
<Button @click="addRow">增加一列</Button>
{{data}}
<br />
<editor :content="content" @change="updateData"></editor>
{{content}}
<YohoUpload id="123" @on-success="uploadSuccess" @on-error="uploadError"></YohoUpload>-->
</div>
默认页
</div>
</template>
<script>
export default {
created() {
},
data() {
return {
content: '',
columns: [
{title: '列', key: 'name', render(row, col, index) {
return `<input type="text" v-model="row.name" />`;
}}
],
data: [
{name: '1'}
]
};
},
methods: {
getTable() {
console.log(this.$refs.table.rebuildData);
},
addRow() {
this.data = this.$refs.table.rebuildData;
this.data.push({name: '2'})
},
updateData(c) {
this.content = c;
},
uploadSuccess(id, files) {
console.log(id, files)
},
uploadError(id, error) {
console.log(id, error)
}
}
};
</script>
... ...
... ... @@ -42,12 +42,7 @@ app.use(compression());
app.use(favicon(path.join(__dirname, '/favicon.ico')));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}));
app.use(cookieParser('', {
decode(val) {
console.log(val)
return val;
}
}));
app.use(cookieParser());
const middleware = require('./middleware');
const controllers = require('./controllers');
... ...