diff --git a/src/api/hotel.js b/src/api/hotel.js new file mode 100644 index 00000000..7d005d2b --- /dev/null +++ b/src/api/hotel.js @@ -0,0 +1,8 @@ +import request from '@/utils/request' + +export function findHotelListFromApi() { + return request({ + url: '/producer-helloworld/hotel/hotelList', + method: 'get' + }) +} diff --git a/src/api/remote-search.js b/src/api/remote-search.js deleted file mode 100644 index 02e42b46..00000000 --- a/src/api/remote-search.js +++ /dev/null @@ -1,17 +0,0 @@ -import request from '@/utils/request' - -export function searchUser(name) { - return request({ - url: '/vue-element-admin/search/user', - method: 'get', - params: { name } - }) -} - -export function transactionList(query) { - return request({ - url: '/vue-element-admin/transaction/list', - method: 'get', - params: query - }) -} diff --git a/src/api/user.js b/src/api/user.js index b8b8741c..317f50e9 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -2,7 +2,7 @@ import request from '@/utils/request' export function login(data) { return request({ - url: '/vue-element-admin/user/login', + url: '/producer-helloworld/user/login', method: 'post', data }) @@ -10,7 +10,7 @@ export function login(data) { export function getInfo(token) { return request({ - url: '/vue-element-admin/user/info', + url: '/producer-helloworld/user/info', method: 'get', params: { token } }) @@ -18,7 +18,7 @@ export function getInfo(token) { export function logout() { return request({ - url: '/vue-element-admin/user/logout', + url: '/producer-helloworld/user/logout', method: 'post' }) } diff --git a/src/main.js b/src/main.js index 1049d762..faa9bbe4 100644 --- a/src/main.js +++ b/src/main.js @@ -27,10 +27,12 @@ import * as filters from './filters' // global filters * Currently MockJs will be used in the production environment, * please remove it before going online ! ! ! */ +/* if (process.env.NODE_ENV === 'production') { const { mockXHR } = require('../mock') mockXHR() } +*/ Vue.use(Element, { size: Cookies.get('size') || 'medium' // set element-ui default size diff --git a/src/router/index.js b/src/router/index.js index e9c11afb..a4ca62ae 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -98,6 +98,18 @@ export const constantRoutes = [ * the routes that need to be dynamically loaded based on user roles */ export const asyncRoutes = [ + { + path: '/hotel', + component: Layout, + children: [ + { + path: 'hotel', + component: () => import('@/views/hotel/index'), + name: 'Hotel', + meta: { title: '酒店管理', icon: 'hotel' } + } + ] + }, // 404 page must be placed at the end !!! { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/utils/request.js b/src/utils/request.js index 2fb95ac0..2b1abd92 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -5,7 +5,8 @@ import { getToken } from '@/utils/auth' // create an axios instance const service = axios.create({ - baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url + baseURL: 'http://localhost:7000', // url = base url + request url + // baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url // withCredentials: true, // send cookies when cross-domain requests timeout: 5000 // request timeout }) diff --git a/src/views/hotel/index.vue b/src/views/hotel/index.vue new file mode 100644 index 00000000..0506fbe8 --- /dev/null +++ b/src/views/hotel/index.vue @@ -0,0 +1,44 @@ + + + + +