Commit 2b40d74f authored by lvweichao's avatar lvweichao

Merge branch 'manage-zt' into dev

parents a2f4f106 b466e907
......@@ -2,17 +2,17 @@
DIST_FILE_NAME="webui_opwebservice_package.tar.gz"
PROJECT_DIR="metro.yidianzixun.com"
PROJECT_DIR="opservice.yidianzixun.com"
START_SCRIPT="./start_env/${PROJECT_DIR}/start.sh"
SYNC_DATA_OPERATIONS=""
DEST_FILE_NAME="webui_metro_package.tar.gz"
DEST_FILE_NAME="webui_opwebservice_package.tar.gz"
DEST_FILE_PATH="start_env"
BASE_IMAGE="docker2.yidian.com:5000/webui/metro:20200310"
BASE_IMAGE="docker2.yidian.com:5000/webui/op-web-service:20210527"
MAINTAINER=""
......
const { LOGIN_URI, API_INTERNAL_URI} = require('../config.js')
const LOGIN_URI = require('../config.js').LOGIN_URI
const req = require('../utils/request').httpReq
/**
* 用户登录校验,用于校验是否是公司员工, 目前使用pandora系统的登录验证
*/
exports.login = async (ctx, next) => {
const url = `${LOGIN_URI}/api/v1/pandora/auth`;
const opts = {
url,
var url = `${LOGIN_URI}/api/v1/pandora/auth`;
var opts = {
url: url,
method: 'POST',
json: true,
timeout: 8000,
body : ctx.request.body
}
// ctx.body = await req(ctx, opts)
const userInfo = await req(ctx, opts);
// {
// type: 'Bearer',
// token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MjIwNTc1OTMsImlhdCI6MTYyMjAxNDM5MywiaW5mbyI6eyJpZCI6IjczMjQ3MzQzOSIsImlzU3VwZXIiOnRydWUsIm5hbWUiOiLlkJXkvJ_mnJ0iLCJkZXBhcnRtZW50SWQiOiIxMzk4MzY4NDEwIiwicGVybWlzc2lvbnMiOltdLCJzZWN1cml0eSI6ZmFsc2UsImFjdGl2ZSI6dHJ1ZX19.65357uakQSUaWS95c16nQgj9JkBmKGvwGJW4C4hEjWY',
// auth: {
// id: '732473439',
// isSuper: true,
// name: '吕伟朝',
// departmentId: '1398368410',
// permissions: [],
// security: false,
// active: true
// },
// userInfo: {
// id: '732473439',
// isSuper: true,
// name: '吕伟朝',
// displayName: '吕伟朝',
// email: 'lvweichao@yidian-inc.com',
// departmentId: '1398368410',
// department: { id: '1398368410', name: '平台产品研发部' },
// property: 'yidian',
// description: '',
// createdAt: '2020-07-31T08:24:05Z',
// lastUpdate: '2020-08-07T07:18:59.194Z',
// active: true
// }
// }
if (typeof userInfo === 'string') {
ctx.body = {status: 'fail', message: userInfo};
} else {
}
console.log(43444, userInfo, typeof userInfo);
// if userInfo
ctx.body = await req(ctx, opts)
}
const Router = require('koa-router');
const system = require('./controllers/system')
const user = require('./controllers/user')
// const index = require('./controllers/index');
// const about = require('./controllers/about');
// const api = require('./controllers/api/index');
// const apiPosts = require('./controllers/api/posts');
const router = Router();
router.post('/login', system.login);
router.get('/home/user/:type', user.query)
module.exports = router;
import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import ElementPlus from "element-plus";
import { ElMessage } from "element-plus";
import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
import ElementPlus from 'element-plus';
// import './assets/styles/index.scss';
import "element-plus/lib/theme-chalk/index.css";
import "dayjs/locale/zh-cn";
import locale from "element-plus/lib/locale/lang/zh-cn";
createApp().config.globalProperties.$message = ElMessage;
import 'element-plus/lib/theme-chalk/index.css';
import 'dayjs/locale/zh-cn';
import locale from 'element-plus/lib/locale/lang/zh-cn';
createApp(App)
.use(router)
.use(store)
.use(ElementPlus, { locale })
.mount("#app");
.mount('#app');
<template>
<div class="block">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
v-model:currentPage="currentPage"
:page-size="pageSize"
layout=" total,prev, pager, next"
:total="totalNum"
>
</el-pagination>
</div>
</template>
<script>
export default {
props: ['data', 'totalNum'],
data () {
return {
currentPage: 5,
pageSize: 20
}
},
methods: {
handleSizeChange (size) {
console.log(`每页 ${size} 条`);
this.$emit('update', { pageSize: size })
},
handleCurrentChange (pageIndex) {
console.log(`当前页: ${pageIndex}`);
this.$emit('update', { page: pageIndex })
}
},
}
</script>
<style lang="less">
.block {
margin-top: 50px;
}
// 样式可以内联,也可以通过 src 引入
</style>
\ No newline at end of file
<template>
<div class="lifeNoInfo">
<!-- 状态、生活号名称、创建时间、创建人(账号信息,昵称+账号) -->
<el-descriptions
class="margin-top"
title="生活号信息"
:column="3"
:size="size"
border
>
<template #extra> </template>
<el-descriptions-item>
<template #label> ID </template>
00001
</el-descriptions-item>
<el-descriptions-item>
<template #label> 状态 </template>
想吃饭
</el-descriptions-item>
<el-descriptions-item>
<template #label> 创建人 </template>
张三
</el-descriptions-item>
<el-descriptions-item>
<template #label> 创建时间 </template>
2020-03-21
</el-descriptions-item>
<el-descriptions-item>
<template #label> 生活号名称 </template>
生活号名称生活号名称生活号名称
</el-descriptions-item>
</el-descriptions>
</div>
</template>
<script>
export default {
data () {
return {
}
}
}
</script>
<style lang="less" scoped>
.lifeNoInfo {
}
</style>
\ No newline at end of file
<template>
<div class="lifeNoUser">
<!-- 管理员:管理员昵称、管理员账号、管理员账号ID
子账号(多个):昵称、账号、账号ID -->
<el-descriptions
class="margin-top"
title="用户信息"
:column="3"
:size="size"
border
>
<template #extra> </template>
<el-descriptions-item>
<template #label>管理员昵称 </template>
派大星
</el-descriptions-item>
<el-descriptions-item>
<template #label> 管理员账号 </template>
0001
</el-descriptions-item>
<el-descriptions-item>
<template #label> 管理员账号ID </template>
9203201993
</el-descriptions-item>
<el-descriptions-item>
<template #label> 子账号昵称 </template>
子账号昵称
</el-descriptions-item>
<el-descriptions-item>
<template #label> 子账号账号 </template>
0002
</el-descriptions-item>
<el-descriptions-item>
<template #label> 子账号账号ID </template>
0002ID
</el-descriptions-item>
</el-descriptions>
</div>
</template>
<script>
export default {
data () {
return {
}
}
}
</script>
<style lang="less" scoped>
.lifeNoUser {
.margin-top {
margin-top: 10px;
}
}
</style>
\ No newline at end of file
<template>
<div class="lifeNotype">
<el-descriptions
class="margin-top"
title="类型信息"
:column="3"
:size="size"
border
>
<template #extra> </template>
<el-descriptions-item>
<template #label>职业表标签 </template>
运动员
</el-descriptions-item>
<el-descriptions-item>
<template #label> 姓名 </template>
张三
</el-descriptions-item>
<el-descriptions-item>
<template #label> 身份证号 </template>
XXXXXXXXXX
</el-descriptions-item>
<el-descriptions-item>
<template #label> 统一社会信用代码(注册码) </template>
00019
</el-descriptions-item>
<el-descriptions-item>
<template #label> 企业注册名称 </template>
不二杂货铺
</el-descriptions-item>
</el-descriptions>
</div>
</template>
<script>
export default {
data () {
return {
}
}
}
</script>
<style lang="less" scoped>
.lifeNotype {
.margin-top {
margin-top: 10px;
}
}
</style>
\ No newline at end of file
<template>
<div class="life-no">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="生活号名称/企业名称">
<el-input
class="search_life"
maxlength="15"
v-model="formInline.user"
placeholder="生活号名称/企业名称"
></el-input>
</el-form-item>
<el-form-item label="类型">
<el-select v-model="formInline.region" placeholder="类型">
<el-option value="shanghai"></el-option>
<el-option value="beijing"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSearchSubmit">查询</el-button>
<el-button @click="onReset">重置</el-button>
</el-form-item>
</el-form>
<el-table
:data="tableData"
border
style="width: 100%"
@row-click="toLifeDetail"
>
<el-table-column prop="id" label="ID"> </el-table-column>
<el-table-column prop="name" label="生活号名称"> </el-table-column>
<el-table-column prop="address" label="类型"> </el-table-column>
<el-table-column prop="name" label="状态"> </el-table-column>
<el-table-column prop="date" label="创建时间"> </el-table-column>
</el-table>
<page :totalNum="totalNum" @update="update" />
</div>
</template>
<script>
import page from "./components/Pagination"
export default {
components: {
page
},
data () {
return {
params: {
page: 1,
pageSize: 10
},
totalNum: 1000,
lifeList: [],
tableData: [{
id: '001',
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
id: '002',
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1517 弄'
}, {
id: '003',
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1519 弄'
}, {
id: '004',
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1516 弄'
}],
formInline: {
user: '',
region: ''
}
}
},
methods: {
//查询
onSearchSubmit () {
console.log(this.formInline.user, this.formInline.region, 'submit!');
},
//重置
onReset () {
this.formInline.user = "",
this.formInline.region = ""
},
update (obj) {
Object.assign(this.params, obj)
this.getlifeNoList(this.params)
},
toLifeDetail (row) {
// this.$router.push({ path: lifeNoDetail })
console.log(row.id, 'eee去详情')
},
//获取列表数据
getlifeNoList () {
}
}
}
</script>
<style lang="less" scoped>
.life-no {
margin: 30px;
.search_life {
width: 280px;
}
}
</style>
<template>
<div class="life-no-detail">
<lifeNoInfo />
<lifeNotype />
<lifeNoUser />
</div>
</template>
<script>
import lifeNoInfo from './components/lifeNoInfo'
import lifeNotype from './components/lifeNotype'
import lifeNoUser from './components/lifeNoUser'
export default {
components: {
lifeNoInfo,
lifeNotype,
lifeNoUser
},
data () {
return {
lifeNoInfo: {}
}
}
}
</script>
<style lang="less" scoped>
.life-no-detail {
margin: 50px;
.box-card {
width: 100%;
}
}
</style>
\ No newline at end of file
<template>
<div class="addRole">
<el-button type="primary" @click="dialogFormVisible = true">新增</el-button>
<el-table
:data="tableData"
style="width: 100%; margin-top: 10px"
:header-cell-style="{ background: '#e1e4e5', color: '#80878f' }"
>
<el-table-column prop="name" label="角色名称" width="180">
</el-table-column>
<el-table-column prop="address" label="角色范围"> </el-table-column>
<el-table-column label="操作">
<template #default="scope">
<el-button
size="mini"
type="text"
@click="handleModify(scope.$index, scope.row)"
>修改</el-button
>
</template>
</el-table-column>
</el-table>
<el-dialog title="新增角色" v-model="dialogFormVisible">
<el-form>
<el-form-item label="角色名称" :label-width="formLabelWidth">
<el-input
style="width: 400px"
v-model="roleName"
autocomplete="off"
></el-input>
</el-form-item>
<el-form-item label="角色范围" :label-width="formLabelWidth">
<el-cascader
v-model="selectedOptions"
:options="options"
:props="props"
ref="cascaderAddr"
@change="parentCateChange"
filterable
clearable
></el-cascader>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="confirmRole">确 定</el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script>
export default {
data () {
return {
tableData: [{
id: '1',
name: '超级管理员',
address: '角色范围'
}, {
id: '2',
name: '普通角色',
address: '角色范围'
}, {
id: '3',
name: '超级管理员',
address: '角色范围'
}, {
id: '4',
name: '普通角色',
address: '角色范围'
}],
vals: [],
dialogFormVisible: false,
roleName: '',
checkedRole: [],//已经选择的角色
roleTitle: '新增角色',
props: {
multiple: true,//设置为多选
checkStrictly: true,
value: 'name', //value值和哪个值绑定
label: 'desc',//label值和哪个值绑定
children: 'button_list'//children值和哪个值绑定
},
formLabelWidth: '120px',
selectedOptions: [],
rolePrivilege: [],
currentRolePrivilege: '',
options: [
{
"name": "用户列表",
"desc": "用户列表",
// "menu_redirect":"\/user\/user\/list",
"button_list": [
{
"name": "deleteBtn",
"desc": "删除用户"
},
{
"name": "addBtn",
"desc": "添加用户"
},
{
"name": "updateBtn",
"desc": "修改用户"
}
]
},
{
"menu_name": "企业审核列表",
// "menu_redirect": "\/aut\/user\/list",
"desc": "企业审核列表",
"button_list": [
{
"name": "addBtn",
"desc": "添加"
},
{
"name": "showBtn",
"desc": "查看"
}
]
}
]
}
},
methods: {
//修改
handleModify (index, row) {
console.log(index, row, 'index, row')
this.roleTitle = '角色修改'
this.dialogFormVisible = true
},
confirmRole () {
console.log(this.roleName, 'roleNameroleName')
this.dialogFormVisible = false
},
getCascaderObj (val, opt) {
console.log(val, opt, 'val, opt')
return val.map(function (value) {
for (var itm of opt) {
if (itm.value == value) { opt = itm.children; return itm; }
}
return null;
});
},
parentCateChange () {
this.vals = this.getCascaderObj(this.selectedOptions, this.options);
const checkedNodes = this.$refs['cascaderAddr'].getCheckedNodes()
console.log(checkedNodes[0].pathLabels, '000') // 获取由 label 组成的数
},
// getCurrentPrivilege (id) {
// get("/merchant/authority/get_role_list").then((res) => {
// if (res.status == 200) {
// this.rolePrivilege = res.data;
// res.data.forEach((item) => {
// if (item.id == id) {
// this.currentRolePrivilege = item;
// console.log(item);
// // this.getCheckedId(this.currentRolePrivilege);
// }
// });
// }
// });
// },
// getSelectedKeys (obj) {
// this.SelectedKeys = [];
// console.log(obj);
// obj.privileges.forEach((item, index) => {
// if (item.parentId != null) {
// this.selectedKeys.push([item.btn_name, item.btn_desc]);
// } else {
// this.selectedKeys.push([item.btn_name, item.btn_desc]);
// }
// });
// console.log(this.checkedId);
// },
}
}
</script>
<style lang="less" scoped>
.addRole {
margin: 50px;
}
</style>
\ No newline at end of file
<template>
<div class="user-detail">
<el-descriptions class="margin-top" :column="3" :size="size" border>
<el-descriptions-item>
<template #label> 用户姓名 </template>
kooriookami
</el-descriptions-item>
<el-descriptions-item>
<template #label> 手机号 </template>
18100000000
</el-descriptions-item>
<el-descriptions-item>
<template #label> 所属组织 </template>
研发部
</el-descriptions-item>
<el-descriptions-item>
<template #label> 添加人账号 </template>
XXXX
</el-descriptions-item>
<el-descriptions-item>
<template #label> 添加时间 </template>
2020-12-01
</el-descriptions-item>
<el-descriptions-item>
<template #label> 最后修改人账号 </template>
张三
</el-descriptions-item>
<el-descriptions-item>
<template #label> 最后修改时间 </template>
2021-05-21
</el-descriptions-item>
<el-descriptions-item>
<template #label> 已拥有角色池 </template>
角色池
</el-descriptions-item>
<el-descriptions-item>
<template #label> 角色名称 </template>
管理员
</el-descriptions-item>
<el-descriptions-item>
<template #label> 敏感词权限 </template>
敏感词权限
</el-descriptions-item>
<el-descriptions-item>
<template #label> 数据权限 </template>
数据权限
</el-descriptions-item>
</el-descriptions>
</div>
</template>
<script>
export default {
data () {
return {
userInfoList: [{
}]
}
}
}
</script>
<style lang="less" scoped>
.user-detail {
margin: 50px;
}
</style>
\ No newline at end of file
import { createRouter, createWebHistory } from "vue-router";
import Home from "../pages/Home";
import Login from "../pages/Login";
import LifeNo from '../pages/Life-no/index.vue'
import LifeNoDetail from '../pages/Life-no/life-no-detail.vue'
import UserDetail from '../pages/User/user-detail.vue'
import AddRole from '../pages/Role/add-role.vue'
const routes = [
{
......@@ -32,7 +37,30 @@ const routes = [
path: '/enterprise/establish',
name: 'Establish',
component: () => import(/* webpackChunkName: "enterprise" */ '@/pages/Enterprise/Establish')
}
},
//生活号管理
{
path: '/life-no/life',
name: 'LifeNo',
component: LifeNo,
},
{
path: '/life-no/lifeNoDetail',
name: 'LifeNoDetail',
component: LifeNoDetail,
},
//用户管理
{
path: '/user/userDetail',
name: 'UserDetail',
component: UserDetail,
},
//角色管理
{
path: '/role/addRole',
name: 'AddRole',
component: AddRole,
},
];
const router = createRouter({
......
import axios from '../utils/request';
export async function userLogin(email, password) {
let res = await axios.post(`api/login`, {
email, password, authCode: ''
});
return res.data;
}
\ No newline at end of file
import { createStore } from "vuex";
import { getPermissions } from '@/service/user';
import Vuex from "vuex";
export default createStore({
state: {
userPermission: null,
},
mutations: {
updateUserPermission(state, payload) {
state.userPermission = payload;
}
},
actions: {
async getUserPermission({ commit }, payload) {
const permissions = await getPermissions(payload.email);
commit(permissions)
}
},
export default Vuex.createStore({
state: {},
mutations: {},
actions: {},
modules: {},
getters: {
}
});
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