diff --git a/src/api/user.js b/src/api/user.js index 8ff4389..a012364 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -1,24 +1,17 @@ import request from '@/utils/request' -export function login(data) { +export function captcha(datas) { return request({ - url: '/vue-admin-template/user/login', + url: '/api/captcha', method: 'post', - data + data: datas }) } -export function getInfo(token) { - return request({ - url: '/vue-admin-template/user/info', - method: 'get', - params: { token } - }) -} - -export function logout() { - return request({ - url: '/vue-admin-template/user/logout', - method: 'post' - }) -} +export function login(datas) { + return request({ + url: '/api/login', + method: 'post', + data: datas + }) +} \ No newline at end of file diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index c4d4f43..d40c9f8 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -4,7 +4,7 @@ -
+
@@ -46,7 +46,7 @@ export default { this.$store.dispatch('app/toggleSideBar') }, async logout() { - await this.$store.dispatch('user/logout') + //await this.$store.dispatch('user/logout') this.$router.push(`/login?redirect=${this.$route.fullPath}`) } } diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue index 040fab6..2d37355 100644 --- a/src/layout/components/Sidebar/Logo.vue +++ b/src/layout/components/Sidebar/Logo.vue @@ -24,7 +24,7 @@ export default { }, data() { return { - title: 'Vue Admin Template', + title: '嘉洛马', logo: 'https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png' } } diff --git a/src/layout/index.vue b/src/layout/index.vue index db22a7b..bd50217 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -1,12 +1,29 @@ @@ -90,4 +107,12 @@ export default { .mobile .fixed-header { width: 100%; } + +.content_main{margin-top:91px;} +.toptitle{color:#FFF;height:91px;padding:0 6% 0 34px;z-index:1002;background-color:#2b3245;position:fixed;top:0;left:0;right:0;} +.toptitle .leftk{float:left;margin-top:18px;} +.toptitle .leftk>img{vertical-align:middle;} +.toptitle .leftk>i{vertical-align:middle;color:#FFF;font-size:30px;margin:6px 0 0 15px;} +.toptitle .rightk{float:right;margin-top:24px;position:relative;} +.toptitle .erectline{margin:0 18px;display:inline-block;vertical-align:middle;height:40px;width:1px;background-color:#414758;} diff --git a/src/main.js b/src/main.js index d453053..f175e40 100644 --- a/src/main.js +++ b/src/main.js @@ -13,7 +13,7 @@ import store from './store' import router from './router' import '@/icons' // icon -import '@/permission' // permission control如果 +//import '@/permission' // permission control如果 /** * If you don't want to use mock-server diff --git a/src/router/index.js b/src/router/index.js index 5054d12..db0f76a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -45,7 +45,7 @@ export const constantRoutes = [ { path: '/', component: Layout, - redirect: '/filemange', + redirect: '/filemange', // 重定向地址 children: [{ path: 'filemange', name: 'Filemange', @@ -190,16 +190,6 @@ export const constantRoutes = [ // ] // }, -// { -// path: 'external-link', -// component: Layout, -// children: [ -// { -// path: 'https://panjiachen.github.io/vue-element-admin-site/#/', -// meta: { title: 'External Link', icon: 'link' } -// } -// ] -// }, // 404 page must be placed at the end !!! { path: '*', redirect: '/404', hidden: true } diff --git a/src/styles/sidebar.scss b/src/styles/sidebar.scss index 94760cc..bcdc915 100644 --- a/src/styles/sidebar.scss +++ b/src/styles/sidebar.scss @@ -14,7 +14,7 @@ height: 100%; position: fixed; font-size: 0px; - top: 0; + top: 91px; bottom: 0; left: 0; z-index: 1001; diff --git a/src/utils/auth.js b/src/utils/auth.js index 059af18..a105e7b 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,6 +1,6 @@ import Cookies from 'js-cookie' -const TokenKey = 'vue_admin_template_token' +const TokenKey = 'jialuoma_token' export function getToken() { return Cookies.get(TokenKey) diff --git a/src/utils/get-page-title.js b/src/utils/get-page-title.js index a6de99d..82db07f 100644 --- a/src/utils/get-page-title.js +++ b/src/utils/get-page-title.js @@ -1,6 +1,6 @@ import defaultSettings from '@/settings' -const title = defaultSettings.title || 'Vue Admin Template' +const title = defaultSettings.title || '嘉洛马' export default function getPageTitle(pageTitle) { if (pageTitle) { diff --git a/src/utils/request.js b/src/utils/request.js index 2fb95ac..7a0702f 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,85 +1,89 @@ import axios from 'axios' -import { MessageBox, Message } from 'element-ui' -import store from '@/store' -import { getToken } from '@/utils/auth' +//import { MessageBox, Message } from 'element-ui' +//import store from '@/store' +//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: process.env.VUE_APP_BASE_API, // url = base url + request url // withCredentials: true, // send cookies when cross-domain requests - timeout: 5000 // request timeout + headers: { 'Content-Type': 'multipart/form-data' }, + // headers: { + // 'Content-Type': 'application/x-www-form-urlencoded' + // }, + timeout: 0 // request timeout }) // request interceptor -service.interceptors.request.use( - config => { - // do something before request is sent +// service.interceptors.request.use( +// config => { +// // do something before request is sent - if (store.getters.token) { - // let each request carry token - // ['X-Token'] is a custom headers key - // please modify it according to the actual situation - config.headers['X-Token'] = getToken() - } - return config - }, - error => { - // do something with request error - console.log(error) // for debug - return Promise.reject(error) - } -) +// if (store.getters.token) { +// // let each request carry token +// // ['X-Token'] is a custom headers key +// // please modify it according to the actual situation +// config.headers['X-Token'] = getToken() +// } +// return config +// }, +// error => { +// // do something with request error +// console.log(error) // for debug +// return Promise.reject(error) +// } +// ) -// response interceptor -service.interceptors.response.use( - /** - * If you want to get http information such as headers or status - * Please return response => response - */ +// // response interceptor +// service.interceptors.response.use( +// /** +// * If you want to get http information such as headers or status +// * Please return response => response +// */ - /** - * Determine the request status by custom code - * Here is just an example - * You can also judge the status by HTTP Status Code - */ - response => { - const res = response.data +// /** +// * Determine the request status by custom code +// * Here is just an example +// * You can also judge the status by HTTP Status Code +// */ +// response => { +// const res = response.data - // if the custom code is not 20000, it is judged as an error. - if (res.code !== 20000) { - Message({ - message: res.message || 'Error', - type: 'error', - duration: 5 * 1000 - }) +// // if the custom code is not 20000, it is judged as an error. +// if (res.code !== 20000) { +// Message({ +// message: res.message || 'Error', +// type: 'error', +// duration: 5 * 1000 +// }) - // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired; - if (res.code === 50008 || res.code === 50012 || res.code === 50014) { - // to re-login - MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', { - confirmButtonText: 'Re-Login', - cancelButtonText: 'Cancel', - type: 'warning' - }).then(() => { - store.dispatch('user/resetToken').then(() => { - location.reload() - }) - }) - } - return Promise.reject(new Error(res.message || 'Error')) - } else { - return res - } - }, - error => { - console.log('err' + error) // for debug - Message({ - message: error.message, - type: 'error', - duration: 5 * 1000 - }) - return Promise.reject(error) - } -) +// // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired; +// if (res.code === 50008 || res.code === 50012 || res.code === 50014) { +// // to re-login +// MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', { +// confirmButtonText: 'Re-Login', +// cancelButtonText: 'Cancel', +// type: 'warning' +// }).then(() => { +// store.dispatch('user/resetToken').then(() => { +// location.reload() +// }) +// }) +// } +// return Promise.reject(new Error(res.message || 'Error')) +// } else { +// return res +// } +// }, +// error => { +// console.log('err' + error) // for debug +// Message({ +// message: error.message, +// type: 'error', +// duration: 5 * 1000 +// }) +// return Promise.reject(error) +// } +// ) export default service diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue deleted file mode 100644 index d6cf156..0000000 --- a/src/views/dashboard/index.vue +++ /dev/null @@ -1,28 +0,0 @@ - - - - - diff --git a/src/views/form/index.vue b/src/views/form/index.vue deleted file mode 100644 index 5d0e277..0000000 --- a/src/views/form/index.vue +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 89bf9b3..63ae675 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -1,5 +1,8 @@