yh-pub 1.0.2 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AdminLogin-W5d0M-rz.js +137 -0
- package/AdminLogin-W5d0M-rz.js.map +1 -0
- package/Dict.vue_vue_type_script_setup_true_lang-CcfyhJln.js +54 -0
- package/Dict.vue_vue_type_script_setup_true_lang-CcfyhJln.js.map +1 -0
- package/Error-BZ9xAkuT.js +43 -0
- package/Error-BZ9xAkuT.js.map +1 -0
- package/Error401-DrA7Y9h3.js +30 -0
- package/Error401-DrA7Y9h3.js.map +1 -0
- package/Error404-C5K4o1R3.js +30 -0
- package/Error404-C5K4o1R3.js.map +1 -0
- package/Error500-D9nu1xhW.js +30 -0
- package/Error500-D9nu1xhW.js.map +1 -0
- package/HomeIndex-DnGu5xD0.js +438 -0
- package/HomeIndex-DnGu5xD0.js.map +1 -0
- package/IconExplorer-IvNeUIhq.js +66 -0
- package/IconExplorer-IvNeUIhq.js.map +1 -0
- package/Index-BMd4lEnI.js +5 -0
- package/Index-BMd4lEnI.js.map +1 -0
- package/MainLogin-CgJLift-.js +153 -0
- package/MainLogin-CgJLift-.js.map +1 -0
- package/MenuManage-BJkQPgpt.js +640 -0
- package/MenuManage-BJkQPgpt.js.map +1 -0
- package/OrgManage-jLpAnwf4.js +378 -0
- package/OrgManage-jLpAnwf4.js.map +1 -0
- package/RoleManage-D2RwwJoM.js +729 -0
- package/RoleManage-D2RwwJoM.js.map +1 -0
- package/SysConfig-CYcl0wCh.js +727 -0
- package/SysConfig-CYcl0wCh.js.map +1 -0
- package/TenantList-CNVwmoEt.js +693 -0
- package/TenantList-CNVwmoEt.js.map +1 -0
- package/index-C75ufNln.js +49816 -0
- package/index-C75ufNln.js.map +1 -0
- package/index-wVC41gTc.js +23955 -0
- package/index-wVC41gTc.js.map +1 -0
- package/index.d.ts +35 -0
- package/index.es.js +66 -0
- package/index.es.js.map +1 -0
- package/package.json +26 -6
- package/style.css +1 -0
- package/README.MD +0 -19
- package/layout/admin/adminIndex.vue +0 -104
- package/layout/admin/api/loginApi.js +0 -24
- package/layout/admin/api/routers.js +0 -93
- package/layout/admin/api/tenantApi.js +0 -123
- package/layout/admin/home/homeIndex.vue +0 -25
- package/layout/admin/login/login.vue +0 -161
- package/layout/admin/menu/MenuIndex.vue +0 -648
- package/layout/admin/menu/icon.vue +0 -108
- package/layout/admin/menu/iconList.js +0 -934
- package/layout/admin/saTenant/saTenant.js +0 -0
- package/layout/admin/saTenant/saTenant.vue +0 -173
- package/layout/admin/saTenant/saTenantForm.js +0 -80
- package/layout/admin/saTenant/saTenantForm.vue +0 -61
- package/layout/admin/saTenant/saTenantRoleManage.js +0 -417
- package/layout/admin/saTenant/saTenantRoleManage.vue +0 -99
- package/layout/admin/user/saUser.less +0 -6
- package/layout/admin/user/saUser.vue +0 -72
- package/layout/main/components/console/console.vue +0 -205
- package/layout/main/components/error-store/error-store.vue +0 -72
- package/layout/main/components/error-store/index.js +0 -2
- package/layout/main/components/fullscreen/fullscreen.vue +0 -57
- package/layout/main/components/fullscreen/index.js +0 -2
- package/layout/main/components/language/language.vue +0 -71
- package/layout/main/components/side-menu/side-menu.less +0 -74
- package/layout/main/components/side-menu/side-menu.vue +0 -75
- package/layout/main/components/tags-nav/tags-nav.less +0 -45
- package/layout/main/components/tags-nav/tags-nav.vue +0 -144
- package/layout/main/components/user/user.less +0 -12
- package/layout/main/components/user/user.vue +0 -185
- package/layout/main/home/home.vue +0 -480
- package/layout/main/home/index.js +0 -2
- package/layout/main/home/toDoList.vue +0 -32
- package/layout/main/login/login.less +0 -93
- package/layout/main/login/login.vue +0 -151
- package/layout/main/main.less +0 -81
- package/layout/main/main.vue +0 -254
- package/layout/main/system/dict.vue +0 -64
- package/layout/main/system/orgManage.vue +0 -473
- package/layout/main/system/roleManage.js +0 -807
- package/layout/main/system/roleManage.vue +0 -424
- package/view/basic/error-logger.vue +0 -74
- package/view/basic/error-page/401.vue +0 -22
- package/view/basic/error-page/404.vue +0 -22
- package/view/basic/error-page/500.vue +0 -22
- package/view/basic/error-page/back-btn-group.vue +0 -48
- package/view/basic/error-page/error-content.vue +0 -28
- package/view/basic/error-page/error.less +0 -46
- package/view/config/component/confFormItem.vue +0 -49
- package/view/config/config.scss +0 -45
- package/view/config/configIndex.vue +0 -150
- package/view/config/subPage/router-config.vue +0 -5
- package/view/config/subPage/sys-config.vue +0 -249
- package/view/window/IframeFReportView.vue +0 -28
- package/view/window/windowIndex.vue +0 -22
package/README.MD
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
## 注意
|
|
2
|
-
在项目使用中
|
|
3
|
-
请不要修改当前文件夹代码
|
|
4
|
-
请不要修改当前文件夹代码
|
|
5
|
-
请不要修改当前文件夹代码
|
|
6
|
-
|
|
7
|
-
当前仓库存放了前端项目框架的公共代码部分,有专门的仓库统一维护,方便更新后各个项目同步。
|
|
8
|
-
|
|
9
|
-
代码存放地址
|
|
10
|
-
[https://codeup.aliyun.com/60765e0161a945067837bb5f/ForntEnd/pub](https://codeup.aliyun.com/60765e0161a945067837bb5f/ForntEnd/pub)
|
|
11
|
-
|
|
12
|
-
**上面仓库地址对企业内人员开放,只要注册云效即可访问**
|
|
13
|
-
|
|
14
|
-
## 开发
|
|
15
|
-
前端人员在开发的过程中将通过一个完整的模板来对这个部分的代码进行开发
|
|
16
|
-
开发代码仓库地址为
|
|
17
|
-
[https://codeup.aliyun.com/60765e0161a945067837bb5f/master/BASE/tree/master/forntEnd/web-new](https://codeup.aliyun.com/60765e0161a945067837bb5f/master/BASE/tree/master/forntEnd/web-new)
|
|
18
|
-
|
|
19
|
-
**上面仓库地址只对指定人员开发,如遇权限问题请联系管理员**
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section class="main">
|
|
3
|
-
<aside
|
|
4
|
-
class="left-sider"
|
|
5
|
-
:class="{ 'is-collapse': collapse }">
|
|
6
|
-
<!-- 需要放在菜单上面的内容,如Logo,写在side-menu标签内部,如下 -->
|
|
7
|
-
<div class="logo-con">
|
|
8
|
-
<img
|
|
9
|
-
v-show="!collapse"
|
|
10
|
-
class="max-logo"
|
|
11
|
-
src="@/assets/images/logo.png"
|
|
12
|
-
key="max-logo" />
|
|
13
|
-
<img
|
|
14
|
-
v-show="collapse"
|
|
15
|
-
class="mini-logo"
|
|
16
|
-
src="@/assets/images/logo-min.png"
|
|
17
|
-
key="min-logo" />
|
|
18
|
-
</div>
|
|
19
|
-
<side-menu
|
|
20
|
-
:active-name="route?.name"
|
|
21
|
-
:collapse="collapse"
|
|
22
|
-
@select="turnToPage"
|
|
23
|
-
:menu-list="menuList"></side-menu>
|
|
24
|
-
</aside>
|
|
25
|
-
<section
|
|
26
|
-
class="right-container"
|
|
27
|
-
:class="{ 'is-collapse': collapse }">
|
|
28
|
-
<header class="header-con">
|
|
29
|
-
<i
|
|
30
|
-
:class="`iconfont class-collapsed ${collapse ? 'icon-indent' : 'icon-outdent'}`"
|
|
31
|
-
@click="handleCollapsedChange"></i>
|
|
32
|
-
<sa-user
|
|
33
|
-
:message-unread-count="unreadCount"
|
|
34
|
-
:user-name="userName" />
|
|
35
|
-
<fullscreen v-model="isFullScreen" />
|
|
36
|
-
</header>
|
|
37
|
-
<main class="main-layout-con">
|
|
38
|
-
<tags-nav />
|
|
39
|
-
<section class="main-container">
|
|
40
|
-
<router-view v-slot="{ Component }">
|
|
41
|
-
<KeepAlive ref="kpAliveRef">
|
|
42
|
-
<component
|
|
43
|
-
:is="Component"
|
|
44
|
-
:key="route?.path"
|
|
45
|
-
:max="10" />
|
|
46
|
-
</KeepAlive>
|
|
47
|
-
</router-view>
|
|
48
|
-
</section>
|
|
49
|
-
</main>
|
|
50
|
-
</section>
|
|
51
|
-
</section>
|
|
52
|
-
</template>
|
|
53
|
-
|
|
54
|
-
<script setup>
|
|
55
|
-
import { ref, onMounted } from "vue";
|
|
56
|
-
import { storeToRefs } from "pinia";
|
|
57
|
-
import "../main/main.less";
|
|
58
|
-
import { getStorage } from "@/libs/util.js";
|
|
59
|
-
import { useRouter, useRoute } from "vue-router";
|
|
60
|
-
|
|
61
|
-
import { useAppStore } from "@/store/app.js";
|
|
62
|
-
import { useUserStore } from "@/store/user.js";
|
|
63
|
-
|
|
64
|
-
import SideMenu from "yh-pub/layout/main/components/side-menu/side-menu.vue";
|
|
65
|
-
import TagsNav from "yh-pub/layout/main/components/tags-nav/tags-nav.vue";
|
|
66
|
-
import saUser from "./user/saUser.vue";
|
|
67
|
-
import Fullscreen from "yh-pub/layout/main/components/fullscreen/fullscreen.vue";
|
|
68
|
-
|
|
69
|
-
import saRouter from "yh-pub/layout/admin/api/routers.js";
|
|
70
|
-
|
|
71
|
-
const userStore = useUserStore();
|
|
72
|
-
const appStore = useAppStore();
|
|
73
|
-
const router = useRouter();
|
|
74
|
-
const route = useRoute();
|
|
75
|
-
|
|
76
|
-
const { menuList } = storeToRefs(appStore);
|
|
77
|
-
const { unreadCount } = storeToRefs(userStore);
|
|
78
|
-
|
|
79
|
-
const collapse = ref(false);
|
|
80
|
-
const userName = ref("");
|
|
81
|
-
const isFullScreen = ref(false);
|
|
82
|
-
const kpAliveRef = ref();
|
|
83
|
-
|
|
84
|
-
function turnToPage(routeName) {
|
|
85
|
-
if (routeName === "首页") {
|
|
86
|
-
router.push("/admin");
|
|
87
|
-
} else {
|
|
88
|
-
let r = saRouter.urlMap[routeName];
|
|
89
|
-
if (r) {
|
|
90
|
-
router.push(r);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
function handleCollapsedChange() {
|
|
95
|
-
collapse.value = !collapse.value;
|
|
96
|
-
}
|
|
97
|
-
onMounted(() => {
|
|
98
|
-
try {
|
|
99
|
-
userName.value = getStorage("userName").name;
|
|
100
|
-
} catch (error) {
|
|
101
|
-
console.error("菜单加载异常:", error);
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
</script>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import axios from "@/libs/api.request";
|
|
2
|
-
import { errorHandler } from "@/libs/axios.handler";
|
|
3
|
-
|
|
4
|
-
export const saLogin = (param) => {
|
|
5
|
-
return axios
|
|
6
|
-
.request({
|
|
7
|
-
url: "admin/login",
|
|
8
|
-
data: param,
|
|
9
|
-
method: "post",
|
|
10
|
-
type: "json",
|
|
11
|
-
})
|
|
12
|
-
.catch(errorHandler);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const getSaUserInfo = (param) => {
|
|
16
|
-
return axios
|
|
17
|
-
.request({
|
|
18
|
-
url: "admin/getSaUserInfo",
|
|
19
|
-
data: param,
|
|
20
|
-
method: "post",
|
|
21
|
-
type: "json",
|
|
22
|
-
})
|
|
23
|
-
.catch(errorHandler);
|
|
24
|
-
};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
const saRouter = {
|
|
2
|
-
urlMap: {
|
|
3
|
-
saTenant: {
|
|
4
|
-
name: "租户",
|
|
5
|
-
id: "saTenant",
|
|
6
|
-
sort: 9,
|
|
7
|
-
path: "/admin/saTenant",
|
|
8
|
-
meta: {
|
|
9
|
-
id: "saTenant",
|
|
10
|
-
title: "租户",
|
|
11
|
-
icon: "iconfont icon-s-custom",
|
|
12
|
-
keepAlive: true,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
1: {
|
|
16
|
-
name: "模块管理",
|
|
17
|
-
id: "1",
|
|
18
|
-
sort: 9,
|
|
19
|
-
path: "/admin/window/1",
|
|
20
|
-
meta: {
|
|
21
|
-
id: "1",
|
|
22
|
-
title: "模块管理",
|
|
23
|
-
icon: "iconfont icon-block",
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
2: {
|
|
27
|
-
name: "JDBC管理",
|
|
28
|
-
id: "2",
|
|
29
|
-
sort: 9,
|
|
30
|
-
path: "/admin/window/2",
|
|
31
|
-
meta: {
|
|
32
|
-
id: "2",
|
|
33
|
-
title: "JDBC管理",
|
|
34
|
-
icon: "iconfont icon-s-tools",
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
3: {
|
|
38
|
-
name: "数据源管理",
|
|
39
|
-
id: "3",
|
|
40
|
-
sort: 9,
|
|
41
|
-
path: "/admin/window/3",
|
|
42
|
-
meta: {
|
|
43
|
-
id: "3",
|
|
44
|
-
title: "数据源管理",
|
|
45
|
-
icon: "iconfont icon-database",
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
4: {
|
|
49
|
-
name: "数据选项",
|
|
50
|
-
id: "4",
|
|
51
|
-
sort: 9,
|
|
52
|
-
path: "/admin/window/4",
|
|
53
|
-
meta: {
|
|
54
|
-
id: "4",
|
|
55
|
-
title: "数据选项",
|
|
56
|
-
icon: "iconfont icon-s-data",
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
5: {
|
|
60
|
-
name: "窗口管理",
|
|
61
|
-
id: "5",
|
|
62
|
-
sort: 2,
|
|
63
|
-
path: "/admin/window/5",
|
|
64
|
-
meta: {
|
|
65
|
-
id: "5",
|
|
66
|
-
title: "窗口管理",
|
|
67
|
-
icon: "iconfont icon-windows",
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
menu: {
|
|
71
|
-
name: "菜单管理",
|
|
72
|
-
id: "menu",
|
|
73
|
-
sort: 1,
|
|
74
|
-
path: "/admin/menu",
|
|
75
|
-
meta: {
|
|
76
|
-
id: "menu",
|
|
77
|
-
icon: "iconfont icon-menu1",
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
Statement: {
|
|
81
|
-
name: "报表管理",
|
|
82
|
-
id: "Statement",
|
|
83
|
-
sort: 1,
|
|
84
|
-
path: "/admin/statement/list",
|
|
85
|
-
meta: {
|
|
86
|
-
id: "Statement",
|
|
87
|
-
icon: "iconfont icon-menu1",
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
export default saRouter;
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import axios from "@/libs/api.request";
|
|
2
|
-
import { errorHandler } from "@/libs/axios.handler";
|
|
3
|
-
|
|
4
|
-
export const saTenantSetMenus = (params) => {
|
|
5
|
-
return axios
|
|
6
|
-
.request({
|
|
7
|
-
method: "post",
|
|
8
|
-
url: "/admin/tenant/setMenus",
|
|
9
|
-
data: params,
|
|
10
|
-
type: "json",
|
|
11
|
-
})
|
|
12
|
-
.catch(errorHandler);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const saTenantRemoveMenus = (params) => {
|
|
16
|
-
return axios
|
|
17
|
-
.request({
|
|
18
|
-
method: "post",
|
|
19
|
-
url: "/admin/tenant/removeMenus",
|
|
20
|
-
data: params,
|
|
21
|
-
type: "json",
|
|
22
|
-
})
|
|
23
|
-
.catch(errorHandler);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const saTenantGetMenuWindowButton = (params) => {
|
|
27
|
-
return axios
|
|
28
|
-
.request({
|
|
29
|
-
method: "post",
|
|
30
|
-
url: "/admin/tenant/getMenuWindowButton",
|
|
31
|
-
data: params,
|
|
32
|
-
type: "json",
|
|
33
|
-
})
|
|
34
|
-
.catch(errorHandler);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const saTenantGetRoleWindowButton = (params) => {
|
|
38
|
-
return axios
|
|
39
|
-
.request({
|
|
40
|
-
method: "post",
|
|
41
|
-
url: "/admin/tenant/getRoleWindowButton",
|
|
42
|
-
data: params,
|
|
43
|
-
type: "json",
|
|
44
|
-
})
|
|
45
|
-
.catch(errorHandler);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const saTenantGetRoleMenus = (params) => {
|
|
49
|
-
return axios
|
|
50
|
-
.request({
|
|
51
|
-
method: "post",
|
|
52
|
-
url: "/admin/tenant/getRoleMenus",
|
|
53
|
-
data: params,
|
|
54
|
-
type: "json",
|
|
55
|
-
})
|
|
56
|
-
.catch(errorHandler);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export const saTenantGetMenuList = (params) => {
|
|
60
|
-
return axios
|
|
61
|
-
.request({
|
|
62
|
-
method: "post",
|
|
63
|
-
url: "/admin/tenant/getMenuList",
|
|
64
|
-
data: params,
|
|
65
|
-
type: "json",
|
|
66
|
-
})
|
|
67
|
-
.catch(errorHandler);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export const saTenantListPage = (params) => {
|
|
71
|
-
return axios
|
|
72
|
-
.request({
|
|
73
|
-
method: "post",
|
|
74
|
-
url: "/admin/tenant/listPage",
|
|
75
|
-
data: params,
|
|
76
|
-
type: "json",
|
|
77
|
-
})
|
|
78
|
-
.catch(errorHandler);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export const saTenantGetById = (params) => {
|
|
82
|
-
return axios
|
|
83
|
-
.request({
|
|
84
|
-
method: "post",
|
|
85
|
-
url: "/admin/tenant/getById",
|
|
86
|
-
data: params,
|
|
87
|
-
type: "json",
|
|
88
|
-
})
|
|
89
|
-
.catch(errorHandler);
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
export const saTenantInsert = (params) => {
|
|
93
|
-
return axios
|
|
94
|
-
.request({
|
|
95
|
-
method: "post",
|
|
96
|
-
url: "/admin/tenant/insert",
|
|
97
|
-
data: params,
|
|
98
|
-
type: "json",
|
|
99
|
-
})
|
|
100
|
-
.catch(errorHandler);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export const saTenantUpdate = (params) => {
|
|
104
|
-
return axios
|
|
105
|
-
.request({
|
|
106
|
-
method: "post",
|
|
107
|
-
url: "/admin/tenant/update",
|
|
108
|
-
data: params,
|
|
109
|
-
type: "json",
|
|
110
|
-
})
|
|
111
|
-
.catch(errorHandler);
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
export const saTenantDelete = (params) => {
|
|
115
|
-
return axios
|
|
116
|
-
.request({
|
|
117
|
-
method: "post",
|
|
118
|
-
url: "/admin/tenant/delete",
|
|
119
|
-
data: params,
|
|
120
|
-
type: "json",
|
|
121
|
-
})
|
|
122
|
-
.catch(errorHandler);
|
|
123
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<iframe
|
|
3
|
-
class="admin-home-index"
|
|
4
|
-
src="http://docs.js.sforcecon.com:5900/view/589"
|
|
5
|
-
frameborder="0"></iframe>
|
|
6
|
-
</template>
|
|
7
|
-
<script>
|
|
8
|
-
// import * as echarts from "echarts";
|
|
9
|
-
|
|
10
|
-
export default {
|
|
11
|
-
data() {
|
|
12
|
-
return {};
|
|
13
|
-
},
|
|
14
|
-
methods: {},
|
|
15
|
-
};
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<style>
|
|
19
|
-
.main-container .admin-home-index {
|
|
20
|
-
margin: 0 0 -20px 0;
|
|
21
|
-
width: 100%;
|
|
22
|
-
height: calc(100% + 10px);
|
|
23
|
-
overflow: hidden;
|
|
24
|
-
}
|
|
25
|
-
</style>
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="login">
|
|
3
|
-
<div class="login-wrap">
|
|
4
|
-
<el-card
|
|
5
|
-
icon="log-in"
|
|
6
|
-
:bordered="false"
|
|
7
|
-
class="login-panel">
|
|
8
|
-
<div class="h3-title">系统管理后台</div>
|
|
9
|
-
<div class="form-con">
|
|
10
|
-
<el-form
|
|
11
|
-
ref="formValidate"
|
|
12
|
-
:model="formValidate"
|
|
13
|
-
:rules="ruleValidate"
|
|
14
|
-
:label-width="35"
|
|
15
|
-
autocomplete="off">
|
|
16
|
-
<el-form-item prop="name">
|
|
17
|
-
<el-input
|
|
18
|
-
v-model="formValidate.name"
|
|
19
|
-
placeholder="请输入用户名"
|
|
20
|
-
autocomplete="off"></el-input>
|
|
21
|
-
</el-form-item>
|
|
22
|
-
<el-form-item prop="passwd">
|
|
23
|
-
<el-input
|
|
24
|
-
type="password"
|
|
25
|
-
v-model="formValidate.passwd"
|
|
26
|
-
placeholder="请输入密码"
|
|
27
|
-
autocomplete="off"></el-input>
|
|
28
|
-
</el-form-item>
|
|
29
|
-
<el-form-item
|
|
30
|
-
style="padding-top: 10px"
|
|
31
|
-
align="center">
|
|
32
|
-
<el-button
|
|
33
|
-
type="primary"
|
|
34
|
-
long
|
|
35
|
-
@click="submitLogin('formValidate')"
|
|
36
|
-
style="width: 80%; margin-left: 10%; height: 40px; font-size: 18px"
|
|
37
|
-
:loading="loginLoading">
|
|
38
|
-
登录
|
|
39
|
-
</el-button>
|
|
40
|
-
</el-form-item>
|
|
41
|
-
</el-form>
|
|
42
|
-
</div>
|
|
43
|
-
</el-card>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
</template>
|
|
47
|
-
<style scoped>
|
|
48
|
-
.login {
|
|
49
|
-
width: 100%;
|
|
50
|
-
height: 100%;
|
|
51
|
-
background-image: url("@/assets/images/admin-logo-bg.jpg");
|
|
52
|
-
background-size: cover;
|
|
53
|
-
background-position: center;
|
|
54
|
-
position: relative;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.login-con {
|
|
58
|
-
position: absolute;
|
|
59
|
-
right: 160px;
|
|
60
|
-
top: 50%;
|
|
61
|
-
transform: translateY(-60%);
|
|
62
|
-
width: 300px;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.login-con-header {
|
|
66
|
-
font-size: 16px;
|
|
67
|
-
font-weight: 300;
|
|
68
|
-
text-align: center;
|
|
69
|
-
padding: 30px 0;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.login-con .form-con {
|
|
73
|
-
padding: 10px 0 0;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.login-con .login-tip {
|
|
77
|
-
font-size: 10px;
|
|
78
|
-
text-align: center;
|
|
79
|
-
color: #c3c3c3;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.login-wrap {
|
|
83
|
-
padding-top: 200px;
|
|
84
|
-
padding-left: calc(50% - 175px);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.login-panel {
|
|
88
|
-
width: 350px;
|
|
89
|
-
border: 1px #f0f0f0 solid;
|
|
90
|
-
border-radius: 10px;
|
|
91
|
-
background-color: #f9f9f9;
|
|
92
|
-
}
|
|
93
|
-
.form-con {
|
|
94
|
-
width: 270px;
|
|
95
|
-
}
|
|
96
|
-
.h3-title {
|
|
97
|
-
padding-bottom: 30px;
|
|
98
|
-
text-align: center;
|
|
99
|
-
font-size: 40px;
|
|
100
|
-
}
|
|
101
|
-
</style>
|
|
102
|
-
<script>
|
|
103
|
-
import { clearStorage, setSaToken, setStorage } from "@/libs/util";
|
|
104
|
-
import { getSaUserInfo, saLogin } from "yh-pub/layout/admin/api/loginApi";
|
|
105
|
-
|
|
106
|
-
export default {
|
|
107
|
-
data() {
|
|
108
|
-
return {
|
|
109
|
-
formValidate: {
|
|
110
|
-
name: "",
|
|
111
|
-
passwd: "",
|
|
112
|
-
},
|
|
113
|
-
ruleValidate: {
|
|
114
|
-
name: [{ required: true, message: "请输入用户名", trigger: "blur" }],
|
|
115
|
-
passwd: [{ required: true, message: "请输入密码", trigger: "blur" }],
|
|
116
|
-
},
|
|
117
|
-
loginLoading: false,
|
|
118
|
-
};
|
|
119
|
-
},
|
|
120
|
-
mounted() {
|
|
121
|
-
clearStorage();
|
|
122
|
-
},
|
|
123
|
-
methods: {
|
|
124
|
-
submitLogin(name) {
|
|
125
|
-
this.$refs[name].validate((valid) => {
|
|
126
|
-
if (valid) {
|
|
127
|
-
let loginData = {
|
|
128
|
-
username: this.formValidate.name,
|
|
129
|
-
password: this.formValidate.passwd,
|
|
130
|
-
};
|
|
131
|
-
this.loginLoading = true;
|
|
132
|
-
saLogin(loginData).then((response) => {
|
|
133
|
-
clearStorage();
|
|
134
|
-
this.loginLoading = false;
|
|
135
|
-
if (response.data.result && response.data.msg === "ok") {
|
|
136
|
-
setSaToken(response.data.token);
|
|
137
|
-
getSaUserInfo({}).then((response) => {
|
|
138
|
-
if (response.data.result && response.data.msg === "ok") {
|
|
139
|
-
let saUser = JSON.stringify(response.data.saUser);
|
|
140
|
-
setStorage("userName", saUser);
|
|
141
|
-
this.$router
|
|
142
|
-
.replace({
|
|
143
|
-
path: this.$config.adminPath,
|
|
144
|
-
})
|
|
145
|
-
.then(() => {
|
|
146
|
-
window.navigation.reload();
|
|
147
|
-
});
|
|
148
|
-
} else {
|
|
149
|
-
this.$message.error(response.data.msg);
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
} else {
|
|
153
|
-
this.$message.error(response.data.msg);
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
};
|
|
161
|
-
</script>
|