Commit 1fbe38dc authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 13e1e943 c5394d72
#开发环境
NODE_ENV = "development"
VUE_APP_API_BASE_URL=http://192.168.0.252:11089
VUE_APP_API_IMG_URL=http://192.168.0.252:11089/
VUE_APP_API_BASE_URL=http://192.168.0.252:11071
VUE_APP_API_IMG_URL=http://192.168.0.252:11071/
# VUE_APP_API_BASE_URL=http://192.168.0.98:11078
# VUE_APP_API_IMG_URL=http://192.168.0.98:11078/
#VUE_APP_API_BASE_URL=http://10.12.185.213:11071
\ No newline at end of file
<template>
<common-layout>
<div class="top">
<div class="header">
<img alt="logo" class="logo" src="@/assets/img/logo.png" />
<span class="title">{{ systemName }}</span>
</div>
<div class="desc">智慧政务先行者</div>
</div>
<!-- <div class="login">
<a-form @submit="onSubmit" :form="form">
<a-tabs
size="large"
:tabBarStyle="{ textAlign: 'center' }"
style="padding: 0 2px"
>
<a-tab-pane tab="账户密码登录" key="1">
<a-alert
type="error"
:closable="true"
v-if="error"
:message="error"
@close="onClose"
showIcon
style="margin-bottom: 24px"
/>
<a-form-item>
<a-input
autocomplete="autocomplete"
size="large"
placeholder="请输入账号"
v-decorator="[
'userName',
{
rules: [
{
required: true,
message: '请输入账户名',
whitespace: true,
},
],
},
]"
>
<a-icon slot="prefix" type="user" />
</a-input>
</a-form-item>
<a-form-item>
<a-input
size="large"
placeholder="请输入密码"
autocomplete="autocomplete"
type="password"
v-decorator="[
'password',
{
rules: [
{
required: true,
message: '请输入密码',
whitespace: true,
},
],
},
]"
>
<a-icon slot="prefix" type="lock" />
</a-input>
</a-form-item>
</a-tab-pane>
</a-tabs>
<div></div>
<a-form-item>
<a-button
:loading="logging"
style="width: 100%; margin-top: 24px"
size="large"
htmlType="submit"
type="primary"
>登录</a-button
>
</a-form-item>
</a-form>
</div> -->
</common-layout>
</template>
<script>
import CommonLayout from "@/layouts/CommonLayout";
import local from "@/utils/local";
// import {login, getRoutesConfig} from '@/services/user'
import { login } from "@/services/user";
// import { setAuthorization } from "@/utils/request";
// import {loadRoutes} from '@/utils/routerUtil'
import { mapMutations } from "vuex";
export default {
name: "Login",
components: { CommonLayout },
data() {
return {
logging: false,
error: "",
form: this.$form.createForm(this),
};
},
created() {
if (this.$route.query.loginName) {
const userName = this.$route.query.loginName;
// this.form.password = 'admin';
const password = "xhxADMIN8@a";
login(userName, password).then(this.afterLogin);
}
},
computed: {
systemName() {
return this.$store.state.setting.systemName;
},
},
methods: {
...mapMutations("account", ["setUser", "setPermissions", "setRoles"]),
onSubmit(e) {
e.preventDefault();
this.form.validateFields((err) => {
if (!err) {
this.logging = true;
const userName = this.form.getFieldValue("userName");
const password = this.form.getFieldValue("password");
login(userName, password).then(this.afterLogin);
}
});
},
afterLogin(res) {
this.logging = false;
const loginRes = res.data;
console.log(loginRes);
if (loginRes.code == 1) {
const { token } = loginRes.data;
local.setLocal("token", token);
// setAuthorization({ token: token, expireAt: new Date(expiresTime) });
this.$router.push("basicset/website");
this.$message.success(loginRes.msg, 3);
} else {
this.error = loginRes.msg;
}
},
onClose() {
this.error = false;
},
},
};
</script>
<style lang="less" scoped>
.ant-form-item {
margin-bottom: 0;
display: block;
align-items: normal;
}
.common-layout {
.top {
text-align: center;
.header {
height: 44px;
line-height: 44px;
a {
text-decoration: none;
}
.logo {
height: 44px;
vertical-align: top;
margin-right: 16px;
}
.title {
font-size: 33px;
color: @title-color;
font-family: "Myriad Pro", "Helvetica Neue", Arial, Helvetica,
sans-serif;
font-weight: 600;
position: relative;
top: 2px;
}
}
.desc {
font-size: 14px;
color: @text-color-second;
margin-top: 12px;
margin-bottom: 40px;
}
}
.login {
width: 368px;
margin: 0 auto;
@media screen and (max-width: 576px) {
width: 95%;
}
@media screen and (max-width: 320px) {
.captcha-button {
font-size: 14px;
}
}
.icon {
font-size: 24px;
color: @text-color-second;
margin-left: 16px;
vertical-align: middle;
cursor: pointer;
transition: color 0.3s;
&:hover {
color: @primary-color;
}
}
}
}
/deep/.ant-form-item-control {
height: 55px;
margin-bottom: 5px;
}
/deep/.ant-input {
width: 100% !important;
}
</style>
<template>
<common-layout>
<div class="top">
<div class="header">
<img alt="logo" class="logo" src="@/assets/img/logo.png" />
<span class="title">{{ systemName }}</span>
</div>
<div class="desc">智慧政务先行者</div>
</div>
<!-- <div class="login">
<a-form @submit="onSubmit" :form="form">
<a-tabs
size="large"
:tabBarStyle="{ textAlign: 'center' }"
style="padding: 0 2px"
>
<a-tab-pane tab="账户密码登录" key="1">
<a-alert
type="error"
:closable="true"
v-if="error"
:message="error"
@close="onClose"
showIcon
style="margin-bottom: 24px"
/>
<a-form-item>
<a-input
autocomplete="autocomplete"
size="large"
placeholder="请输入账号"
v-decorator="[
'userName',
{
rules: [
{
required: true,
message: '请输入账户名',
whitespace: true,
},
],
},
]"
>
<a-icon slot="prefix" type="user" />
</a-input>
</a-form-item>
<a-form-item>
<a-input
size="large"
placeholder="请输入密码"
autocomplete="autocomplete"
type="password"
v-decorator="[
'password',
{
rules: [
{
required: true,
message: '请输入密码',
whitespace: true,
},
],
},
]"
>
<a-icon slot="prefix" type="lock" />
</a-input>
</a-form-item>
</a-tab-pane>
</a-tabs>
<div></div>
<a-form-item>
<a-button
:loading="logging"
style="width: 100%; margin-top: 24px"
size="large"
htmlType="submit"
type="primary"
>登录</a-button
>
</a-form-item>
</a-form>
</div> -->
</common-layout>
<div>
<div>页面跳转中......</div>
</div>
</template>
<script>
import CommonLayout from "@/layouts/CommonLayout";
import local from "@/utils/local";
// import {login, getRoutesConfig} from '@/services/user'
import { login } from "@/services/user";
// import { setAuthorization } from "@/utils/request";
// import {loadRoutes} from '@/utils/routerUtil'
import { mapMutations } from "vuex";
import { createMenus } from "@/router";
import { login } from "@/services/user";
export default {
name: "Login",
components: { CommonLayout },
data() {
return {
logging: false,
error: "",
form: this.$form.createForm(this),
};
return {};
},
created() {
if (this.$route.query.loginName) {
const userName = this.$route.query.loginName;
// this.form.password = 'admin';
const password = "xhxADMIN8@a";
login(userName, password).then(this.afterLogin);
login(userName, password).then((res) => {
const loginRes = res.data;
console.log(loginRes);
if (loginRes.code == 1) {
const { token } = loginRes.data;
local.setLocal("token", token);
let userInfo = {
id: loginRes.data.id,
userType: loginRes.data.userType,
currUserName: loginRes.data.currUserName,
};
this.getToken(token, userInfo, loginRes.data);
this.$message.success(loginRes.msg, 3);
} else {
this.error = loginRes.msg;
}
});
}
},
computed: {
systemName() {
return this.$store.state.setting.systemName;
},
},
methods: {
...mapMutations("account", ["setUser", "setPermissions", "setRoles"]),
onSubmit(e) {
e.preventDefault();
this.form.validateFields((err) => {
if (!err) {
this.logging = true;
const userName = this.form.getFieldValue("userName");
const password = this.form.getFieldValue("password");
login(userName, password).then(this.afterLogin);
}
});
},
afterLogin(res) {
this.logging = false;
const loginRes = res.data;
console.log(loginRes);
if (loginRes.code == 1) {
const { token } = loginRes.data;
local.setLocal("token", token);
// setAuthorization({ token: token, expireAt: new Date(expiresTime) });
this.$router.push("basicset/website");
this.$message.success(loginRes.msg, 3);
...mapMutations("site", [
"SET_userInfo",
"SET_token",
"SET_SITE_ID",
"SET_siteName",
"SET_sysName",
"SET_sysLogo",
"SET_path",
]),
// 获取token
getToken(token, userInfo, data) {
// let { userInfo, siteid, siteName, sysName, sysLogo, path } =
// this.$route.query;
if (token) {
this.SET_userInfo(userInfo);
this.SET_token(token);
console.log(data);
// data.siteid ? this.SET_SITE_ID(data.siteid) : "";
// data.siteName ? this.SET_siteName(data.siteName) : "";
// this.SET_sysName(data.sysName);
// this.SET_sysLogo(data.sysLogo);
// this.SET_path(data.path);
// local.setLocal("siteId", data.siteid);
// local.setLocal("siteName", data.siteName);
// 动态菜单
createMenus();
this.$router.push("/website");
} else {
this.error = loginRes.msg;
this.$message.warning("跳转失败,请重新登录");
setTimeout(() => {
location.href = process.env.VUE_APP_API_portal_URL;
}, 2000);
}
},
onClose() {
this.error = false;
},
},
};
</script>
<style lang="less" scoped>
.ant-form-item {
margin-bottom: 0;
display: block;
align-items: normal;
}
.common-layout {
.top {
text-align: center;
.header {
height: 44px;
line-height: 44px;
a {
text-decoration: none;
}
.logo {
height: 44px;
vertical-align: top;
margin-right: 16px;
}
.title {
font-size: 33px;
color: @title-color;
font-family: "Myriad Pro", "Helvetica Neue", Arial, Helvetica,
sans-serif;
font-weight: 600;
position: relative;
top: 2px;
}
}
.desc {
font-size: 14px;
color: @text-color-second;
margin-top: 12px;
margin-bottom: 40px;
}
}
.login {
width: 368px;
margin: 0 auto;
@media screen and (max-width: 576px) {
width: 95%;
}
@media screen and (max-width: 320px) {
.captcha-button {
font-size: 14px;
}
}
.icon {
font-size: 24px;
color: @text-color-second;
margin-left: 16px;
vertical-align: middle;
cursor: pointer;
transition: color 0.3s;
&:hover {
color: @primary-color;
}
}
}
}
/deep/.ant-form-item-control {
height: 55px;
margin-bottom: 5px;
}
/deep/.ant-input {
width: 100% !important;
}
</style>
<style lang="less" scoped></style>
......@@ -4,6 +4,8 @@ import { formatRoutes } from "@/utils/routerUtil";
import { i18n } from "@/utils/i18n";
import store from "@/store";
import { mergeI18nFromRoutes } from "@/utils/i18n";
import Layouts from "@/layouts/Layouts";
Vue.use(VueRouter);
//解决重复路由报错
const originalPush = VueRouter.prototype.push;
......@@ -33,6 +35,345 @@ const routes = [
name: "403",
component: () => import("@/pages/exception/403"),
},
{
path: "/",
name: "首页",
component: Layouts,
redirect: "/website",
children: [
{
path: "/website",
name: "站点管理",
meta: {
icon: "bank",
},
component: () => import("@/pages/basicset/site/website"),
},
{
path: "/business",
meta: {
icon: "book",
},
component: () => import("@/pages/basicset/business/Index"),
children: [
{
path: "",
name: "业务事项管理",
meta: {
icon: "book",
invisible: true,
},
component: () => import("@/pages/basicset/business/business"),
redirect: "/business/businessmanage",
children: [
// 业务管理
{
path: "businessmanage",
meta: {
invisible: true,
},
component: () =>
import("@/pages/basicset/business/components/businessTabs1"),
},
// 事项管理
{
path: "mattermanage",
meta: {
invisible: true,
},
component: () =>
import("@/pages/basicset/business/components/businessTabs2"),
},
// 业务事项关联
{
path: "businessinmanage",
meta: {
invisible: true,
},
component: () =>
import("@/pages/basicset/business/components/businessTabs3"),
},
// 办事指南事项管理
{
path: "workguide",
meta: {
invisible: true,
},
component: () =>
import("@/pages/basicset/business/components/businessTabs4"),
},
],
},
{
path: "addmatter",
name: "新增事项",
component: () => import("@/pages/basicset/addmatter/AddMatter"),
meta: { invisible: true },
},
{
path: "synopsis",
name: "事项概要",
component: () => import("@/pages/basicset/addmatter/Synopsis"),
meta: { invisible: true },
},
],
},
{
path: "/department",
meta: {
icon: "audit",
},
component: () => import("@/pages/basicset/dept/Index"),
children: [
{
path: "",
name: "部门及窗口管理",
component: () => import("@/pages/basicset/dept/department"),
meta: { invisible: true, keepAlive: true },
},
{
path: "adddepartment",
name: "新增窗口事项",
meta: {
invisible: true,
},
component: () => import("@/pages/basicset/dept/addWindowMatter"),
},
],
},
{
path: "/personnel",
name: "工作人员管理",
meta: {
icon: "idcard",
},
component: () => import("@/pages/basicset/workman/personnel"),
},
{
path: "/festival",
name: "节假日管理",
meta: {
icon: "carry-out",
},
component: () => import("@/pages/basicset/holiday/festival"),
},
{
path: "/deploy",
name: "部署模块管理",
meta: {
icon: "appstore",
roles: ["admin"],
},
component: () => import("@/pages/basicset/deploy/deploy"),
},
{
path: "/hall",
name: "大厅管理",
meta: {
icon: "gateway",
},
component: () => import("@/pages/basicset/hall/Hall"),
redirect: "/hall/hallmanage",
children: [
{
path: "hallmanage",
name: "",
component: () =>
import("@/pages/basicset/hall/hallmanage/HallManage.vue"),
meta: {
invisible: true,
},
},
{
path: "hallwindow",
name: "大厅窗口管理",
meta: {
invisible: true,
},
component: () =>
import("@/pages/basicset/hall/hallwindow/HallWindow.vue"),
},
],
},
{
path: "/surface",
component: () => import("@/pages/basicset/surface/index"),
meta: {
icon: "skin",
},
children: [
{
path: "",
name: "皮肤管理",
component: () => import("@/pages/basicset/surface/surface"),
meta: { invisible: true },
},
{
path: "addsurfacetemplate",
name: "新增皮肤模板",
component: () =>
import("@/pages/basicset/surface/AddSurfaceTemplate"),
meta: { invisible: true },
},
],
},
{
path: "/configurat",
name: "短信配置",
meta: {
icon: "mail",
},
component: () => import("@/pages/basicset/sms/configurat"),
},
{
path: "/appmarket",
component: () => import("@/pages/basicset/appmarket/Index"),
meta: {
icon: "shop",
},
children: [
{
path: "",
name: "应用集市",
component: () => import("@/pages/basicset/appmarket/AppMarket"),
meta: { invisible: true },
redirect: "/appmarket/terminalapp",
children: [
{
path: "terminalapp",
component: () =>
import("@/pages/basicset/appmarket/components/TerminalApp"),
meta: {
invisible: true,
// keepAlive: true,
},
},
{
path: "moveapp",
component: () =>
import("@/pages/basicset/appmarket/components/MoveApp"),
meta: {
invisible: true,
// keepAlive: true,
},
},
{
path: "blackapp",
component: () =>
import("@/pages/basicset/appmarket/components/BlackApp"),
meta: {
invisible: true,
},
},
{
path: "appTheme",
component: () =>
import("@/pages/basicset/appmarket/components/AppTheme"),
meta: {
invisible: true,
},
},
],
},
{
path: "appdetails",
name: "应用详情",
component: () => import("@/pages/basicset/appmarket/AppDetails"),
meta: { invisible: true },
redirect: "/appmarket/appdetails/appdetailspage",
children: [
{
path: "appdetailspage",
component: () =>
import(
"@/pages/basicset/appmarket/components/AppDetailsPage"
),
meta: {
invisible: true,
},
},
{
path: "dataupdate",
component: () =>
import("@/pages/basicset/appmarket/components/DataUpdate"),
meta: {
invisible: true,
},
},
{
path: "fieldconfig",
component: () =>
import("@/pages/basicset/appmarket/components/FieldConfig"),
meta: {
invisible: true,
},
},
],
},
],
},
{
path: "/system",
name: "系统设置",
component: () => import("@/pages/basicset/system/System"),
meta: {
icon: "global",
},
redirect: "system/parameter",
children: [
{
path: "user",
name: "用户管理",
component: () => import("@/pages/basicset/system/user/User"),
meta: { invisible: true },
},
{
path: "role",
name: "角色管理",
component: () => import("@/pages/basicset/system/role/Role"),
meta: { invisible: true },
},
{
path: "resource",
name: "资源管理",
component: () =>
import("@/pages/basicset/system/resourceManage/Resource"),
meta: { invisible: true },
},
{
path: "dimension",
name: "维度管理",
component: () =>
import("@/pages/basicset/system/dimension/Dimension"),
meta: { invisible: true },
},
{
path: "parameter",
name: "系统参数",
component: () =>
import("@/pages/basicset/system/parameter/Parameter"),
meta: { invisible: true },
},
{
path: "task",
name: "任务信息",
component: () => import("@/pages/basicset/system/task/TaskSet"),
meta: { invisible: true },
},
{
path: "systemlogs",
name: "操作日志",
component: () =>
import("@/pages/basicset/system/systemlogs/SystemLogs"),
meta: { invisible: true },
},
],
},
],
},
];
formatRoutes(routes);
const router = new VueRouter({
......
const BASE_URL =
process.env.NODE_ENV === "development"
? "/api"
? "/basics_api"
: process.env.VUE_APP_API_BASE_URL;
module.exports = {
loginapi: {
......
......@@ -40,12 +40,12 @@ module.exports = {
disableHostCheck: true,
port: 8080,
proxy: {
"/api": {
"/basics_api": {
//此处要与 /services/api.js 中的 API_PROXY_PREFIX 值保持一致
target: process.env.VUE_APP_API_BASE_URL,
changeOrigin: true,
pathRewrite: {
"^/api": "",
"^/basics_api": "",
},
// cookieDomainRewrite: 'localhost',
},
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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 to comment