Commit a34ecd77 by me

添加token验证

parent ec801e35
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
<el-submenu index="1"> <el-submenu index="1">
<template slot="title"><i class="icon"><img src="../assets/img/icon/ico3.png" alt=""></i>菜单管理</template> <template slot="title"><i class="icon"><img src="../assets/img/icon/ico3.png" alt=""></i>菜单管理</template>
<el-menu-item-group> <el-menu-item-group>
<el-menu-item index="/tab/bannerList">banner管理</el-menu-item> <el-menu-item index="/tab/bannerList" >banner管理</el-menu-item>
<el-menu-item index="/tab/cookbook">菜谱管理</el-menu-item> <el-menu-item index="/tab/cookbook" >菜谱管理</el-menu-item>
<el-menu-item index="/tab/cookList">厨师人员管理</el-menu-item> <el-menu-item index="/tab/cookList">厨师人员管理</el-menu-item>
<el-menu-item index="/tab/bjList">保洁人员管理</el-menu-item> <el-menu-item index="/tab/bjList">保洁人员管理</el-menu-item>
<el-menu-item index="/tab/wxList">维修人员管理</el-menu-item> <el-menu-item index="/tab/wxList">维修人员管理</el-menu-item>
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</div> </div>
</div> </div>
</el-header> </el-header>
<el-main class="main"> <el-main class="main">
<transition name="fade" mode="out-in"> <transition name="fade" mode="out-in">
<router-view></router-view> <router-view></router-view>
</transition> </transition>
...@@ -62,7 +62,9 @@ export default { ...@@ -62,7 +62,9 @@ export default {
data () { data () {
return { return {
userName: '', userName: '',
currentDate: '' currentDate: '',
index:0,
index1:0,
} }
}, },
mounted () { mounted () {
...@@ -71,6 +73,9 @@ export default { ...@@ -71,6 +73,9 @@ export default {
}, },
methods: { methods: {
getUserInfor () { getUserInfor () {
// var routerParams = this.$route.query.nameId;
// this.index = routerParams;
// console.log(routerParams)
if (window.localStorage.length > 0) { if (window.localStorage.length > 0) {
var userInfo = localStorage.getItem('userInfo') var userInfo = localStorage.getItem('userInfo')
if (userInfo != null) { if (userInfo != null) {
......
...@@ -15,8 +15,8 @@ import 'quill/dist/quill.bubble.css' ...@@ -15,8 +15,8 @@ import 'quill/dist/quill.bubble.css'
// use // use
Vue.use(VueQuillEditor) Vue.use(VueQuillEditor)
axios.defaults.baseURL = 'http://47.94.209.240:8088/' // axios.defaults.baseURL = 'http://47.94.209.240:8088/'
// axios.defaults.baseURL = 'https://slbjgfwj.cn/api/' axios.defaults.baseURL = 'https://slbjgfwj.cn/api/'
Vue.prototype.$ImageUploadUrl = 'https://slbjgfwj.cn/api/file/fileUpload' Vue.prototype.$ImageUploadUrl = 'https://slbjgfwj.cn/api/file/fileUpload'
......
...@@ -19,8 +19,9 @@ export default { ...@@ -19,8 +19,9 @@ export default {
userForm: { userForm: {
loginName: '', loginName: '',
passWord: '', passWord: '',
locPwd: false locPwd: false,
} },
// nameId:1,
} }
}, },
created () { created () {
...@@ -29,16 +30,22 @@ export default { ...@@ -29,16 +30,22 @@ export default {
methods: { methods: {
login () { login () {
if (this.userForm.loginName && this.userForm.passWord) { if (this.userForm.loginName && this.userForm.passWord) {
let _this = this let _this = this;
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: '/operator/login/user', url: '/operator/login/user',
data: _this.userForm data: _this.userForm,
}).then((res) => { }).then((res) => {
console.log(res.data) console.log(res.data.data.accessToken)
if (res.data.code === '0') { if (res.data.code === '0') {
this.$router.push({ name: 'userList' }) this.$router.push({
window.localStorage.setItem('userInfo', JSON.stringify(res.data)) name: 'userList',
// query:{
// nameId:_this.nameId,
// },
})
window.localStorage.setItem('userInfo', JSON.stringify(res.data))
window.localStorage.setItem('token', JSON.stringify(res.data.data.accessToken))
} }
}) })
} else { } else {
......
...@@ -100,8 +100,14 @@ export default { ...@@ -100,8 +100,14 @@ export default {
postUrl = '/pcbanner/update/banner' postUrl = '/pcbanner/update/banner'
params.id = this.addForm.id params.id = this.addForm.id
} }
this.$axios.post(postUrl, params, { this.$axios({
}).then((res)=> { method: 'post',
url: postUrl,
data: params,
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res)=> {
this.$router.go(-1) this.$router.go(-1)
}) })
}, },
......
...@@ -139,7 +139,10 @@ export default { ...@@ -139,7 +139,10 @@ export default {
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: '/pcbanner/get/list?p=' + this.allPage + '&c=' + this.currentPage, url: '/pcbanner/get/list?p=' + this.allPage + '&c=' + this.currentPage,
data: parms data: parms,
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res) => { }).then((res) => {
this.orderListData = res.data.data.resultList this.orderListData = res.data.data.resultList
this.countPage = res.data.data.countPage this.countPage = res.data.data.countPage
......
...@@ -84,7 +84,13 @@ export default { ...@@ -84,7 +84,13 @@ export default {
}, },
methods: { methods: {
getData () { getData () {
this.$axios.get('/pccleaning/get/' + this.$route.params.id).then((res)=>{ this.$axios({
method:'get',
url:'/pccleaning/get/' + this.$route.params.id,
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res)=>{
this.cookData = res.data.data this.cookData = res.data.data
}) })
}, },
......
...@@ -125,6 +125,9 @@ export default { ...@@ -125,6 +125,9 @@ export default {
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: '/pccook/delete/' + id, url: '/pccook/delete/' + id,
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res) => { }).then((res) => {
this.getList() this.getList()
}) })
...@@ -141,7 +144,10 @@ export default { ...@@ -141,7 +144,10 @@ export default {
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: '/pccleaning/get/list?p=' + this.allPage + '&c=' + this.currentPage, url: '/pccleaning/get/list?p=' + this.allPage + '&c=' + this.currentPage,
data: parms data: parms,
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res) => { }).then((res) => {
this.data = res.data.data.resultList this.data = res.data.data.resultList
this.countPage = res.data.data.countPage this.countPage = res.data.data.countPage
......
...@@ -109,7 +109,13 @@ export default { ...@@ -109,7 +109,13 @@ export default {
}, },
methods: { methods: {
getData () { getData () {
this.$axios.get('/pccook/get/' + this.$route.params.id).then((res)=>{ this.$axios({
method:'get',
url:'/pccook/get/' + this.$route.params.id,
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res)=>{
this.addForm = res.data.data this.addForm = res.data.data
this.imageUrl = this.addForm.url this.imageUrl = this.addForm.url
res.data.data.status == 'Y' ? this.addForm.status = true : this.addForm.status = false res.data.data.status == 'Y' ? this.addForm.status = true : this.addForm.status = false
......
...@@ -60,7 +60,13 @@ export default { ...@@ -60,7 +60,13 @@ export default {
}, },
methods: { methods: {
getData () { getData () {
this.$axios.get('/pccook/get/' + this.$route.params.id).then((res)=>{ this.$axios.get({
method:'get',
url:'/pccook/get/' + this.$route.params.id,
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res)=>{
this.cookData = res.data.data this.cookData = res.data.data
}) })
}, },
......
...@@ -138,6 +138,9 @@ export default { ...@@ -138,6 +138,9 @@ export default {
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: '/pccook/delete/' + id, url: '/pccook/delete/' + id,
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res) => { }).then((res) => {
this.getList() this.getList()
}) })
...@@ -154,7 +157,10 @@ export default { ...@@ -154,7 +157,10 @@ export default {
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: '/pccook/get/list?p=' + this.allPage + '&c=' + this.currentPage, url: '/pccook/get/list?p=' + this.allPage + '&c=' + this.currentPage,
data: parms data: parms,
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res) => { }).then((res) => {
this.data = res.data.data.resultList this.data = res.data.data.resultList
this.countPage = res.data.data.countPage this.countPage = res.data.data.countPage
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
align="center" align="center"
label="菜品图片"> label="菜品图片">
<template slot-scope="scope"> <template slot-scope="scope">
<img class="cookImage" v-if="scope.row.imgUrl" :src="scope.row.imgUrl" alt=""> <img class="cookImage" v-if="scope.row.imgBase64" :src="scope.row.imgBase64" alt="">
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -159,11 +159,15 @@ export default { ...@@ -159,11 +159,15 @@ export default {
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: '/pcfood/list?p=' + this.allPage + '&c=' + this.currentPage, url: '/pcfood/list?p=' + this.allPage + '&c=' + this.currentPage,
data: parms data: parms,
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res) => { }).then((res) => {
this.orderListData = res.data.data.resultList this.orderListData = res.data.data.resultList
this.countPage = res.data.data.countPage this.countPage = res.data.data.countPage
this.page = res.data.data.page this.page = res.data.data.page
console.log()
}) })
}, },
handleRowChange (row, event, column) { handleRowChange (row, event, column) {
......
...@@ -116,6 +116,9 @@ export default { ...@@ -116,6 +116,9 @@ export default {
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: '/pccook/delete/' + id, url: '/pccook/delete/' + id,
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res) => { }).then((res) => {
this.getList() this.getList()
}) })
...@@ -130,7 +133,10 @@ export default { ...@@ -130,7 +133,10 @@ export default {
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: '/pcproduct/get/list?p=' + this.allPage + '&c=' + this.currentPage, url: '/pcproduct/get/list?p=' + this.allPage + '&c=' + this.currentPage,
data: parms data: parms,
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res) => { }).then((res) => {
this.data = res.data.data.resultList this.data = res.data.data.resultList
this.countPage = res.data.data.countPage this.countPage = res.data.data.countPage
......
...@@ -123,7 +123,10 @@ export default { ...@@ -123,7 +123,10 @@ export default {
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: '/pclog/get/list?p=' + this.allPage + '&c=' + this.currentPage, url: '/pclog/get/list?p=' + this.allPage + '&c=' + this.currentPage,
data: parms data: parms,
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res) => { }).then((res) => {
this.orderListData = res.data.data.resultList this.orderListData = res.data.data.resultList
this.countPage = res.data.data.countPage this.countPage = res.data.data.countPage
......
...@@ -133,7 +133,12 @@ ...@@ -133,7 +133,12 @@
<el-col :span="3" class="align-right padding-right10">支付方式:</el-col> <el-col :span="3" class="align-right padding-right10">支付方式:</el-col>
<el-col :span="5">{{orderObg.payType}}</el-col> <el-col :span="5">{{orderObg.payType}}</el-col>
</el-row> </el-row>
<!-- <el-row v-if="orderObg.type == 'CS'">
<el-col :span="3" class="align-right padding-right10">取货时间:</el-col>
<el-col :span="8">付款后一周(工作日 11:30~13:30 16:30~17:00)</el-col>
<el-col :span="3" class="align-right padding-right10">取货方式:</el-col>
<el-col :span="5">{{orderObg.payType}}</el-col>
</el-row> -->
<el-row v-if="orderObg.type == 'WM' || orderObg.type == 'CS'"> <el-row v-if="orderObg.type == 'WM' || orderObg.type == 'CS'">
<el-col :span="3" class="align-right padding-right10">状态:</el-col> <el-col :span="3" class="align-right padding-right10">状态:</el-col>
<el-col :span="5">{{renderStatus(orderObg.status)}}</el-col> <el-col :span="5">{{renderStatus(orderObg.status)}}</el-col>
...@@ -197,8 +202,13 @@ export default { ...@@ -197,8 +202,13 @@ export default {
methods: { methods: {
getDetail () { getDetail () {
var _this = this var _this = this
this.$axios.get('/pc/trade/get/id/' + this.$route.params.id, { this.$axios({
}).then(function (res) { method:'get',
url:'/pc/trade/get/id/' + this.$route.params.id,
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then(function (res) {
console.log(res.data) console.log(res.data)
_this.orderObg = res.data.data _this.orderObg = res.data.data
}) })
......
...@@ -274,7 +274,10 @@ export default { ...@@ -274,7 +274,10 @@ export default {
data: { data: {
id: id, id: id,
userName: JSON.parse(window.localStorage.getItem('userInfo')).data.userResponse.userName userName: JSON.parse(window.localStorage.getItem('userInfo')).data.userResponse.userName
} },
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res) => { }).then((res) => {
this.getOrderList() this.getOrderList()
}) })
...@@ -287,7 +290,10 @@ export default { ...@@ -287,7 +290,10 @@ export default {
data: { data: {
id: id, id: id,
userName: JSON.parse(window.localStorage.getItem('userInfo')).data.userResponse.userName userName: JSON.parse(window.localStorage.getItem('userInfo')).data.userResponse.userName
} },
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res) => { }).then((res) => {
this.getOrderList() this.getOrderList()
}) })
...@@ -300,7 +306,10 @@ export default { ...@@ -300,7 +306,10 @@ export default {
data: { data: {
id: id, id: id,
userName: JSON.parse(window.localStorage.getItem('userInfo')).data.userResponse.userName userName: JSON.parse(window.localStorage.getItem('userInfo')).data.userResponse.userName
} },
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res) => { }).then((res) => {
this.getOrderList() this.getOrderList()
}) })
...@@ -313,7 +322,10 @@ export default { ...@@ -313,7 +322,10 @@ export default {
data: { data: {
id: id, id: id,
userName: JSON.parse(window.localStorage.getItem('userInfo')).data.userResponse.userName userName: JSON.parse(window.localStorage.getItem('userInfo')).data.userResponse.userName
} },
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res) => { }).then((res) => {
this.getOrderList() this.getOrderList()
}) })
...@@ -335,7 +347,10 @@ export default { ...@@ -335,7 +347,10 @@ export default {
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: '/pc/trade/get/list?p=' + this.allPage + '&c=' + this.currentPage, url: '/pc/trade/get/list?p=' + this.allPage + '&c=' + this.currentPage,
data: parms data: parms,
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res) => { }).then((res) => {
res.data.data.resultList.forEach((item)=>{ res.data.data.resultList.forEach((item)=>{
if (item.type == 'WM' || item.type == 'CS') { if (item.type == 'WM' || item.type == 'CS') {
...@@ -378,7 +393,10 @@ export default { ...@@ -378,7 +393,10 @@ export default {
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: '/pc/trade/get/group', url: '/pc/trade/get/group',
data: params data: params,
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res) => { }).then((res) => {
res.data.data.forEach((item)=>{ res.data.data.forEach((item)=>{
item.num = parseInt(item.num) item.num = parseInt(item.num)
......
...@@ -109,7 +109,7 @@ export default { ...@@ -109,7 +109,7 @@ export default {
currentPage: 10, currentPage: 10,
countPage: '', countPage: '',
page: '', page: '',
orderListData: [] orderListData: [],
} }
}, },
created () { created () {
...@@ -128,7 +128,10 @@ export default { ...@@ -128,7 +128,10 @@ export default {
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: '/pcuser/list?p=' + this.allPage + '&c=' + this.currentPage, url: '/pcuser/list?p=' + this.allPage + '&c=' + this.currentPage,
data: parms data: parms,
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res) => { }).then((res) => {
this.orderListData = res.data.data.resultList this.orderListData = res.data.data.resultList
this.countPage = res.data.data.countPage this.countPage = res.data.data.countPage
......
...@@ -73,7 +73,13 @@ export default { ...@@ -73,7 +73,13 @@ export default {
}, },
methods: { methods: {
getData () { getData () {
this.$axios.get('/pcrepair/get/' + this.$route.params.id).then((res)=>{ this.$axios({
method: 'get',
url:'/pcrepair/get/' + this.$route.params.id,
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res)=>{
this.cookData = res.data.data this.cookData = res.data.data
}) })
}, },
......
...@@ -125,6 +125,9 @@ export default { ...@@ -125,6 +125,9 @@ export default {
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: '/pccook/delete/' + id, url: '/pccook/delete/' + id,
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res) => { }).then((res) => {
this.getList() this.getList()
}) })
...@@ -141,7 +144,10 @@ export default { ...@@ -141,7 +144,10 @@ export default {
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: '/pcrepair/get/list?p=' + this.allPage + '&c=' + this.currentPage, url: '/pcrepair/get/list?p=' + this.allPage + '&c=' + this.currentPage,
data: parms data: parms,
headers: {
'token':JSON.parse(window.localStorage.getItem('token')),
}
}).then((res) => { }).then((res) => {
this.data = res.data.data.resultList this.data = res.data.data.resultList
this.countPage = res.data.data.countPage this.countPage = res.data.data.countPage
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment