From 778180117166a8f994d01f89ccc361366e14db2d Mon Sep 17 00:00:00 2001
From: joylink_cuiweidong <364937672@qq.com>
Date: Wed, 9 Jun 2021 16:37:02 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E8=B4=A6?=
=?UTF-8?q?=E5=8F=B7=E9=80=9A=E8=BF=87url=E7=99=BB=E9=99=86=20=E4=BB=A5?=
=?UTF-8?q?=E5=8F=8A=20=E5=88=9B=E5=BB=BA=E7=AC=AC=E4=B8=89=E6=96=B9?=
=?UTF-8?q?=E8=B4=A6=E5=8F=B7=20=E5=8A=9F=E8=83=BD=E6=B7=BB=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/management/user.js | 19 ++++
src/permission.js | 2 +-
src/router/index.js | 7 ++
src/store/modules/user.js | 3 +
.../system/userControl/createSingleUser.vue | 104 ++++++++++++++++++
src/views/system/userControl/index.vue | 33 +++++-
src/views/thirdLogin/index.vue | 78 +++++++++++++
7 files changed, 244 insertions(+), 2 deletions(-)
create mode 100644 src/views/system/userControl/createSingleUser.vue
create mode 100644 src/views/thirdLogin/index.vue
diff --git a/src/api/management/user.js b/src/api/management/user.js
index 712752aa7..6fe6a86d8 100644
--- a/src/api/management/user.js
+++ b/src/api/management/user.js
@@ -145,6 +145,25 @@ export function generateOfflineUser(data) {
data: data
});
}
+
+// 创建第三方用户
+export function createThirdCount(data) {
+ return request({
+ url: `/api/user`,
+ method: 'post',
+ data: data
+ });
+}
+
+// 第三方用户登陆(通过url登陆)
+export function thirdCountLogin(data) {
+ return request({
+ url: `/api/login/third`,
+ method: 'post',
+ data: data
+ });
+}
+
// 导入学生成绩
export function importStudentResults(projectCode, data) {
return request({
diff --git a/src/permission.js b/src/permission.js
index f2f46ad94..1ae8d6a07 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -7,7 +7,7 @@ import 'nprogress/nprogress.css';
import { setToken, getToken, removeToken, getSessionStorage } from '@/utils/auth';
import localStore from 'storejs';
-const whiteList = ['/login', '/design/login', '/gzzbxy/relay', '/authorization', '/AUSline', '/AUStool', '/demo']; // 不重定向白名单
+const whiteList = ['/login', '/design/login', '/gzzbxy/relay', '/authorization', '/AUSline', '/AUStool', '/demo', '/thirdLogin']; // 不重定向白名单
const loginList = ['/login', '/design/login']; // 登陆页面
diff --git a/src/router/index.js b/src/router/index.js
index 4cfde6cca..fbef2809f 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -182,6 +182,8 @@ const UeditorDraftList = () => import('@/views/editor/listDraft');
const UploadPdfList = () => import('@/views/uploadPdf/list');
+const ThirdLogin = () => import('@/views/thirdLogin');
+
// import { GenerateRouteProjectList } from '@/scripts/ProjectConfig';
// import { getSessionStorage } from '@/utils/auth';
@@ -231,6 +233,11 @@ export const constantRoutes = [
component: Demo,
hidden: true
},
+ {
+ path: '/thirdLogin',
+ component: ThirdLogin,
+ hidden: true
+ },
{
path: '/demoTraining/:mode',
component: DemoTraining,
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 954e29f5f..cc906b09e 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -211,6 +211,9 @@ const user = {
},
setBaseUrl ({commit}, baseUrl) {
commit('setBaseUrl', baseUrl);
+ },
+ setToken({commit}, token) {
+ commit('SET_TOKEN', token);
}
}
};
diff --git a/src/views/system/userControl/createSingleUser.vue b/src/views/system/userControl/createSingleUser.vue
new file mode 100644
index 000000000..1371e7555
--- /dev/null
+++ b/src/views/system/userControl/createSingleUser.vue
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/system/userControl/index.vue b/src/views/system/userControl/index.vue
index 9aefde808..1515c4316 100644
--- a/src/views/system/userControl/index.vue
+++ b/src/views/system/userControl/index.vue
@@ -3,6 +3,7 @@
+
@@ -12,6 +13,7 @@ import { getUserList } from '@/api/management/user';
import { getCompanyList } from '@/api/company';
import DictionaryEdit from './edit';
import CreateUser from './createUser';
+import CreateSingleUser from './createSingleUser';
import BindCompany from './bindCompany';
export default {
@@ -19,6 +21,7 @@ export default {
components: {
DictionaryEdit,
CreateUser,
+ CreateSingleUser,
BindCompany
},
data() {
@@ -29,6 +32,11 @@ export default {
},
companyMap: {},
companyList: [],
+ countTypeList:[
+ {label:'个人账户', value:'1'},
+ {label:'企业账户', value:'2'},
+ {label:'企业账户下子账户', value:'3'}
+ ],
queryForm: {
labelWidth: '80px',
reset: true,
@@ -66,6 +74,13 @@ export default {
config: {
data: []
}
+ },
+ type:{
+ type: 'select',
+ label: '类型',
+ config: {
+ data: []
+ }
}
}
@@ -88,6 +103,13 @@ export default {
title: this.$t('system.nickname'),
prop: 'nickname'
},
+ {
+ title: '类型',
+ prop: 'type',
+ type: 'tag',
+ columnValue: (row) => { return this.getCountType(row.type); },
+ tagType: (row) => { return 'success'; }
+ },
{
title: this.$t('global.mobile'),
prop: 'mobile'
@@ -128,7 +150,8 @@ export default {
],
actions: [
{ text: '创建本地用户', btnCode: 'employee_auto', handler: this.createLocalUsers },
- { text: '组织管理', btnCode: 'company_manage', handler: this.companyManage }
+ { text: '组织管理', btnCode: 'company_manage', handler: this.companyManage },
+ { text: '创建第三方账户', btnCode: 'create_user', handler: this.createSingleUser }
]
},
currentModel: {}
@@ -144,6 +167,7 @@ export default {
this.companyList.push({label: item.name, value: parseInt(item.id)});
});
this.queryForm.queryObject.companyId.config.data = this.companyList;
+ this.queryForm.queryObject.type.config.data = this.countTypeList;
}
}).catch((error) => {
console.error(error);
@@ -157,12 +181,19 @@ export default {
getCompanyName(companyId) {
return this.companyMap[companyId];
},
+ getCountType(type) {
+ const countType = this.countTypeList.find(each=>{ return each.value == type; });
+ return countType ? countType.label : '';
+ },
reloadTable() {
this.queryList.reload();
},
createLocalUsers() {
this.$refs.createUser.doShow();
},
+ createSingleUser() {
+ this.$refs.createSingleUser.doShow();
+ },
companyManage() {
this.$router.push({ path: `/system/companyManage`});
},
diff --git a/src/views/thirdLogin/index.vue b/src/views/thirdLogin/index.vue
new file mode 100644
index 000000000..df5c35f6e
--- /dev/null
+++ b/src/views/thirdLogin/index.vue
@@ -0,0 +1,78 @@
+
+
+
+
+
From 15c94bd50cc4abcb46c4b932329e1afdb47e374e Mon Sep 17 00:00:00 2001
From: joylink_cuiweidong <364937672@qq.com>
Date: Wed, 9 Jun 2021 18:10:21 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E5=9C=A8=E7=BA=BF?=
=?UTF-8?q?=E7=94=A8=E6=88=B7=E6=9F=A5=E8=AF=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/management/user.js | 9 ++
src/i18n/langs/en/router.js | 1 +
src/i18n/langs/zh/router.js | 1 +
src/layout/components/Navbar.vue | 8 +-
src/router/index.js | 10 ++
src/views/system/userLoginControl/index.vue | 152 ++++++++++++++++++++
src/views/thirdLogin/index.vue | 7 +-
7 files changed, 183 insertions(+), 5 deletions(-)
create mode 100644 src/views/system/userLoginControl/index.vue
diff --git a/src/api/management/user.js b/src/api/management/user.js
index 6fe6a86d8..5c3ec6559 100644
--- a/src/api/management/user.js
+++ b/src/api/management/user.js
@@ -164,6 +164,15 @@ export function thirdCountLogin(data) {
});
}
+/** 查询在线的用户列表*/
+export function getLoginUserList(params) {
+ return request({
+ url: `/api/loginUser/paging`,
+ method: 'get',
+ params: params
+ });
+}
+
// 导入学生成绩
export function importStudentResults(projectCode, data) {
return request({
diff --git a/src/i18n/langs/en/router.js b/src/i18n/langs/en/router.js
index 774d09a4e..8d379f7bf 100644
--- a/src/i18n/langs/en/router.js
+++ b/src/i18n/langs/en/router.js
@@ -63,6 +63,7 @@ export default {
dataDictionary: 'Data dictionary',
dataDictionaryDetails: 'Data dictionary details',
userManage: 'user management',
+ loginUserManage:'login user Manage',
cacheManage: 'cache management',
userTrainingManage: 'User training management',
userExamManage: 'User examination management',
diff --git a/src/i18n/langs/zh/router.js b/src/i18n/langs/zh/router.js
index a739f53d5..a8faa5bd5 100644
--- a/src/i18n/langs/zh/router.js
+++ b/src/i18n/langs/zh/router.js
@@ -62,6 +62,7 @@ export default {
dataDictionary: '数据字典',
dataDictionaryDetails: '数据字典明细',
userManage: '用户管理',
+ loginUserManage:'在线用户管理',
cacheManage: '缓存管理',
userTrainingManage: '用户实训统计',
userExamManage: '用户考试统计',
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index b95b34e99..1ff59aad5 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -69,7 +69,7 @@
-
+
@@ -81,6 +81,7 @@ import { mapGetters } from 'vuex';
import UserLogout from './Logout';
import QuickEntry from './Entry';
import SystemTitle from './Title';
+import {getSessionStorage } from '@/utils/auth';
export default {
components: {
@@ -93,7 +94,8 @@ export default {
routes: [],
isShow: false,
activePath: '',
- index: ''
+ index: '',
+ thirdLogin:''
};
},
computed: {
@@ -101,6 +103,7 @@ export default {
'avatar',
'routers'
])
+
},
watch: {
$route(val) {
@@ -112,6 +115,7 @@ export default {
}
},
mounted() {
+ this.thirdLogin = getSessionStorage('thirdLogin');
this.routes = this.$router.options.routes;
if (this.$route.fullPath.indexOf('design/usermap') >= 0) {
this.activePath = '/design/usermap/home';
diff --git a/src/router/index.js b/src/router/index.js
index fbef2809f..62424839b 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -59,6 +59,8 @@ const CommandDictionaryDetail = () => import('@/views/system/commandDictionary/e
const configLine = () => import('@/views/system/configLine/index');
const Notification = () => import('@/views/system/notification/index');
+const LoginUserControl = () => import('@/views/system/userLoginControl/index');
+
const IscsSystem = () => import('@/views/iscs/iscsSystem/index');
const IscsDraw = () => import('@/views/iscs/iscsDraw/index');
const IscsDesign = () => import('@/views/iscs/iscsDesign/index');
@@ -1013,6 +1015,14 @@ export const asyncRouter = [
i18n: 'router.userManage'
}
},
+ {
+ // 用户管理
+ path: 'loginUserManage',
+ component: LoginUserControl,
+ meta: {
+ i18n: 'router.loginUserManage'
+ }
+ },
{
// 单位管理
path: 'companyManage',
diff --git a/src/views/system/userLoginControl/index.vue b/src/views/system/userLoginControl/index.vue
new file mode 100644
index 000000000..5bca4c9df
--- /dev/null
+++ b/src/views/system/userLoginControl/index.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+