diff --git a/.env.development b/.env.development index be6c86b..cdfe6f7 100644 --- a/.env.development +++ b/.env.development @@ -2,5 +2,5 @@ ENV='development' # base api -VUE_APP_BASE_API=http://dongtuo.ali251.langye.net -VUE_APP_UPLOAD_API=http://dongtuo.ali251.langye.net/api/admin/upload-file +VUE_APP_BASE_API=https://dongtuo.ali251.langye.net +VUE_APP_UPLOAD_API=https://dongtuo.ali251.langye.net/api/admin/upload-file diff --git a/.env.production b/.env.production index 75af701..56f2ce6 100644 --- a/.env.production +++ b/.env.production @@ -2,5 +2,5 @@ ENV = 'production' # base api -VUE_APP_BASE_API=http://dongtuo.ali251.langye.net -VUE_APP_UPLOAD_API=http://dongtuo.ali251.langye.net/api/admin/upload-file \ No newline at end of file +VUE_APP_BASE_API=https://dongtuo.ali251.langye.net +VUE_APP_UPLOAD_API=https://dongtuo.ali251.langye.net/api/admin/upload-file diff --git a/src/api/h5/index.js b/src/api/h5/index.js new file mode 100644 index 0000000..1897b4b --- /dev/null +++ b/src/api/h5/index.js @@ -0,0 +1,64 @@ +import request from "@/utils/request"; + +export function sendSms (params,isLoading = false) { + return request({ + method: 'get', + url: '/api/admin/other/send_sms', + params, + isLoading + }) +} + +export function login (params,isLoading = false) { + return request({ + method: 'get', + url: '/api/admin/other/login', + params, + isLoading + }) +} + +export function register (data,isLoading = false) { + return request({ + method: 'post', + url: '/api/admin/other/register', + data, + isLoading + }) +} + +export function meetingList (params,isLoading = false) { + return request({ + method: 'get', + url: '/api/admin/other/meeting', + params, + isLoading + }) +} + +export function exhibitorList (params,isLoading = false) { + return request({ + method: 'get', + url: '/api/admin/other/exhibitor_files', + params, + isLoading + }) +} + +export function exhibitorSave (data,isLoading = false) { + return request({ + method: 'post', + url: '/api/admin/other/exhibitor_files_save', + data, + isLoading + }) +} + +export function exhibitorDelete (params,isLoading = false) { + return request({ + method: 'get', + url: '/api/admin/other/exhibitor_files_delete', + params, + isLoading + }) +} diff --git a/src/assets/h5bkg.jpeg b/src/assets/h5bkg.jpeg new file mode 100644 index 0000000..3e7ab0d Binary files /dev/null and b/src/assets/h5bkg.jpeg differ diff --git a/src/assets/logo-mini.png b/src/assets/logo-mini.png index 8ecb6ba..9792989 100644 Binary files a/src/assets/logo-mini.png and b/src/assets/logo-mini.png differ diff --git a/src/components/XyDialog/index.vue b/src/components/XyDialog/index.vue index 32bda2d..0ea8473 100644 --- a/src/components/XyDialog/index.vue +++ b/src/components/XyDialog/index.vue @@ -288,6 +288,12 @@ export default { flex-shrink: 0; flex-basis: 50%; } + +.ivu-message{ + z-index: 5000 !important; +} + + diff --git a/src/permission.js b/src/permission.js index c5e41fa..b6e58c5 100644 --- a/src/permission.js +++ b/src/permission.js @@ -8,7 +8,7 @@ import getPageTitle from '@/utils/get-page-title' NProgress.configure({ showSpinner: false }) // NProgress Configuration -const whiteList = ['/login'] // no redirect whitelist +const whiteList = ['/login','/h5/login'] // no redirect whitelist router.beforeEach(async(to, from, next) => { // start progress bar @@ -18,12 +18,19 @@ router.beforeEach(async(to, from, next) => { document.title = getPageTitle(to.meta.title) // determine whether the user has logged in - const hasToken = getToken() + const hasToken = !!(getToken() && getToken() !== 'undefined' && getToken() !== 'null') + + if (whiteList.indexOf(to.path) !== -1) { + // in the free login whitelist, go directly + next() + return + } if (hasToken) { - if (to.path === '/login') { + if (to.path === '/login' || to.path === '/h5/login') { // if is logged in, redirect to the home page - next({ path: '/' }) + let isH5 = to.path !== '/login' + next({ path: isH5 ? '/h5' : '/' }) NProgress.done() } else { // determine whether the user has obtained his permission roles through getInfo @@ -34,24 +41,25 @@ router.beforeEach(async(to, from, next) => { try { // get user info // note: roles must be a object array! such as: ['admin'] or ,['developer','editor'] - const { roles } = await store.dispatch('user/getInfo') - - // generate accessible routes map based on roles - const accessRoutes = await store.dispatch('permission/generateRoutes', roles) + if (!/^\/h5.*/.test(to.path)) { + const { roles } = await store.dispatch('user/getInfo') - //console.log(accessRoutes) - // dynamically add accessible routes - router.addRoutes(accessRoutes) + // generate accessible routes map based on roles + const accessRoutes = await store.dispatch('permission/generateRoutes', roles) - // hack method to ensure that addRoutes is complete - // set the replace: true, so the navigation will not leave a history record - next({ ...to, replace: true }) + //console.log(accessRoutes) + // dynamically add accessible routes + router.addRoutes(accessRoutes) + next({ ...to, replace: true }) + } else { + next(); + } } catch (error) { console.log(error) // remove token and go to login page to re-login await store.dispatch('user/resetToken') Message.error(error || 'Has Error') - next(`/login?redirect=${to.path}`) + next(`${/^\/h5.*/.test(to.path) ? '/h5/login' : '/login'}?redirect=${to.path}`) NProgress.done() } } @@ -64,7 +72,7 @@ router.beforeEach(async(to, from, next) => { next() } else { // other pages that do not have permission to access are redirected to the login page. - next(`/login?redirect=${to.path}`) + next(`${/^\/h5.*/.test(to.path) ? '/h5/login' : '/login'}?redirect=${to.path}`) NProgress.done() } } diff --git a/src/router/index.js b/src/router/index.js index 0c0b8ea..7c4b03c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -73,7 +73,28 @@ export const constantRoutes = [{ icon: 'dashboard' } }, ] - } + }, + + { + path: "/h5/index", + component: () => import("@/views/h5/index.vue"), + meta: { + title: "首页", + }, + hidden: true + }, + { + path: '/h5/login', + component:() => import("@/views/h5/login/login.vue"), + meta: { + title: "登录", + }, + hidden: true + }, + { + path: '/h5', + redirect: '/h5/index' + }, ] diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss index 0062411..0e8efab 100644 --- a/src/styles/element-ui.scss +++ b/src/styles/element-ui.scss @@ -47,3 +47,10 @@ .el-range-separator { box-sizing: content-box; } + +@media (max-width: 768px) { + .el-message { + width: 90vw; + min-width: 200px; + } +} diff --git a/src/utils/auth.js b/src/utils/auth.js index 43d10c2..9acaa69 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,15 +1,18 @@ import Cookies from 'js-cookie' const TokenKey = 'dongtuo_token' - +const TokenKey_h5 = 'dongtuo_token_h5' export function getToken() { - return Cookies.get(TokenKey) + let flag = /\/h5.*/.test(window.location.href) + return Cookies.get(flag ? TokenKey_h5 : TokenKey) } export function setToken(token) { - return Cookies.set(TokenKey, token) + let flag = /\/h5.*/.test(window.location.href) + return Cookies.set(flag ? TokenKey_h5 : TokenKey, token) } export function removeToken() { - return Cookies.remove(TokenKey) + let flag = /\/h5.*/.test(window.location.href) + return Cookies.remove(flag ? TokenKey_h5 : TokenKey) } diff --git a/src/views/component/dialog.vue b/src/views/component/dialog.vue index 1a980e8..e00d341 100644 --- a/src/views/component/dialog.vue +++ b/src/views/component/dialog.vue @@ -24,7 +24,7 @@ export default { props: { title: "新增", visible: this.dialogVisible, - width: "74vw", + width: "600", }, on: { "update:visible": (val) => { diff --git a/src/views/h5/exhibitor/form.vue b/src/views/h5/exhibitor/form.vue new file mode 100644 index 0000000..f1678b4 --- /dev/null +++ b/src/views/h5/exhibitor/form.vue @@ -0,0 +1,266 @@ + + + + + + + + + + + 选取文件 + 大小不超过5Mb + + + + + + + + + + + + + + 确 认 + + + + + + + + { + meetingSelect.page = e; + getMeetings(); + }" + /> + + + + + + + + + diff --git a/src/views/h5/exhibitor/myExhibitor.vue b/src/views/h5/exhibitor/myExhibitor.vue new file mode 100644 index 0000000..08bdcd8 --- /dev/null +++ b/src/views/h5/exhibitor/myExhibitor.vue @@ -0,0 +1,104 @@ + + + + + + + + {{ item.meeting_id_meetings_id_relation ? item.meeting_id_meetings_id_relation.name : '' }} + + + {{ status(item.status) }} + + 附件 + + 111 + + + + + + { + exhibitorSelect.page = e; + getExhibitors(); + } + " + /> + + + + + + + diff --git a/src/views/h5/index.vue b/src/views/h5/index.vue new file mode 100644 index 0000000..55df889 --- /dev/null +++ b/src/views/h5/index.vue @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/h5/login/component/login.vue b/src/views/h5/login/component/login.vue new file mode 100644 index 0000000..a78c0c7 --- /dev/null +++ b/src/views/h5/login/component/login.vue @@ -0,0 +1,128 @@ + + + + + + + + {{ time ? time+'秒重新获取' : '发送验证码'}} + + + + + + + 注 册 + 登 录 + + + + + + + + + diff --git a/src/views/h5/login/component/loginPanel.vue b/src/views/h5/login/component/loginPanel.vue new file mode 100644 index 0000000..9e48b70 --- /dev/null +++ b/src/views/h5/login/component/loginPanel.vue @@ -0,0 +1,127 @@ + + + + + + + + 展商{{ isLogin ? '登录' : '注册'}} + + 请输入{{ isLogin ? '登录' : '注册'}}信息 + + + + + + + + + + + + + + + + + + diff --git a/src/views/h5/login/component/register.vue b/src/views/h5/login/component/register.vue new file mode 100644 index 0000000..bdc1092 --- /dev/null +++ b/src/views/h5/login/component/register.vue @@ -0,0 +1,169 @@ + + + + + + + + {{ time ? time+'秒重新获取' : '发送验证码'}} + + + + + + + 返回登录 + 确认注册 + + + + + + + + + diff --git a/src/views/h5/login/login.vue b/src/views/h5/login/login.vue new file mode 100644 index 0000000..cd80dc9 --- /dev/null +++ b/src/views/h5/login/login.vue @@ -0,0 +1,102 @@ + + + + + + + 欢迎使用本平台 + + + 本平台为展商提供资料上传 + + + -盐城国际会议展览中心- + + + + + + + + diff --git a/vue.config.js b/vue.config.js index 1d64ddc..9d570e1 100644 --- a/vue.config.js +++ b/vue.config.js @@ -25,7 +25,7 @@ module.exports = { * Detail: https://cli.vuejs.org/config/#publicpath */ publicPath: '/admin/', - outputDir: '/Users/mac/Documents/Work/s-苏州东拓/code/dongtuo-meet-service/public/admin', + outputDir: './dist', assetsDir: 'static', css: { loaderOptions: { // 向 CSS 相关的 loader 传递选项
+ + {{ item.meeting_id_meetings_id_relation ? item.meeting_id_meetings_id_relation.name : '' }} +