Commit 1749109c authored by zhangtong5@yidian-inc.com's avatar zhangtong5@yidian-inc.com

update:add

parents 8dcf481f 5504a7b8
......@@ -7,6 +7,7 @@
"dev": "sh ./bin/start.sh development",
"test": "sh ./bin/start.sh testing",
"prod": "sh ./bin/start.sh production",
"koa": "node app.js",
"web-dev": "cross-env NODE_ENV=development vue-cli-service serve",
"web-build": "cross-env NODE_ENV=production vue-cli-service build",
"test:unit": "vue-cli-service test:unit",
......@@ -42,6 +43,7 @@
"eslint-plugin-vue": "^7.0.0-alpha.0",
"less": "^3.0.4",
"less-loader": "^5.0.0",
"nodemon": "^2.0.7",
"pm2": "2.7.0",
"prettier": "^1.19.1"
},
......@@ -53,4 +55,4 @@
"Android >= 4.1"
],
"license": "YIDIAN"
}
}
\ No newline at end of file
......@@ -2,7 +2,7 @@ const env = process.env.NODE_ENV || 'development';
const port = process.env.PORT || 8055;
const LOGIN_URI = {
'development': "http://web-rest.int.yidian-inc.com",
'development': "http://bp-test.ini.yidian-inc.com ",
'test': "http://web-rest.int.yidian-inc.com",
'production': "http://web-rest.int.yidian-inc.com"
}
......
const LOGIN_URI = require('../config.js').LOGIN_URI
const API_INTERNAL_URI = require('../config.js').API_INTERNAL_URI
const req = require('../utils/request').httpReqexports.get_life_list = async (ctx, next) => {
var url = `${API_INTERNAL_URI}/merchant/lifeinner/life_list`;
var opts = {
url: url,
method: 'GET',
json: true,
timeout: 8000,
body: ctx.request.body
}
ctx.body = await req(ctx, opts)
}
\ No newline at end of file
const LOGIN_URI = require('../config.js').LOGIN_URI
const API_INTERNAL_URI = require('../config.js').API_INTERNAL_URI
const req = require('../utils/request').httpReq
exports.getAll_role_list = async (ctx, next) => {
var url = `${API_INTERNAL_URI}/merchant/authority/get_role_list`;
var opts = {
url: url,
method: 'POST',
json: true,
timeout: 8000,
body: ctx.request.body
}
ctx.body = await req(ctx, opts)
}
exports.getRole_list = async (ctx, next) => {
var url = `${API_INTERNAL_URI}/merchant/authority/role_list`;
var opts = {
url: url,
method: 'POST',
timeout: 8000,
}
ctx.body = await req(ctx, opts)
}
exports.get_role_info = async (ctx, next) => {
var url = `${API_INTERNAL_URI}/merchant/authority/get_role_info`;
var opts = {
url: url,
method: 'POST',
json: true,
timeout: 8000,
body: ctx.request.body
}
ctx.body = await req(ctx, opts)
}
exports.getUpdate_role = async (ctx, next) => {
var url = `${API_INTERNAL_URI}/merchant/authority/update_role`;
var opts = {
url: url,
method: 'POST',
timeout: 8000
}
ctx.body = await req(ctx, opts)
}
exports.getUser_detail = async (ctx, next) => {
var url = `${API_INTERNAL_URI}/merchant/lifeinner/life_info`;
var opts = {
url: url,
method: 'POST',
timeout: 8000
}
ctx.body = await req(ctx, opts)
}
\ No newline at end of file
const LOGIN_URI = require("../config.js").LOGIN_URI;
const PANDORA_URI = require("../config.js").PANDORA_URI;
const req = require("../utils/request").httpReq;
// exports.login = async (ctx, next) => {
// const url = `${LOGIN_URI}/api/v1/pandora/auth`;
// const opts = {
......
......@@ -17,7 +17,6 @@ var query = {
ctx.body = await req(ctx, opts);
}
};
exports.query = async (ctx, next) => {
var type = ctx.params.type;
console.log("koa user::::::", type);
......
const Router = require("koa-router");
const system = require("./controllers/system");
const user = require("./controllers/user");
const enterprise = require("./controllers/enterprise");
const role = require('./controllers/role')
const life = require('./controllers/life-no')
const router = Router();
const API_VERSION = "/api/v1";
......@@ -13,6 +16,13 @@ router.get(`${API_VERSION}/certification`, enterprise.entCheck);
router.post(`${API_VERSION}/emterprise_commit`, enterprise.entCommit);
router.post(`${API_VERSION}/check_life`, enterprise.checkLife);
router.post(`${API_VERSION}/create_life`, enterprise.createLife);
router.post(`${API_VERSION}/merchant/authority/role_list`, role.getRole_list)
router.post(`${API_VERSION}/merchant/authority/add_role`, role.getAdd_role)
router.post(`${API_VERSION}/merchant/authority/update_role`, role.getUpdate_role)
router.post(`${API_VERSION}/merchant/authority/get_role_list`, role.getAll_role_list)
router.post(`${API_VERSION}/merchant/authority/get_role_info`, role.get_role_info)
router.post(`${API_VERSION}/merchant/lifeinner/life_info`, role.getUser_detail)
router.get(`${API_VERSION}/merchant/lifeinner/life_list`, life.get_life_list)
module.exports = router;
<template>
<div>
<layout>
Forbidden!
</layout>
<layout> Forbidden! </layout>
</div>
</template>
<script>
import Layout from '@/layouts';
export default {
components: {
Layout,
},
};
import Layout from '@/layouts';
export default {
components: {
Layout,
},
};
</script>
<style lang="less">
......
<template>
<div class="lifeNoInfo">
<!-- 状态、生活号名称、创建时间、创建人(账号信息,昵称+账号) -->
<el-descriptions
class="margin-top"
title="生活号信息"
:column="3"
:size="size"
border
>
<el-descriptions class="margin-top" title="生活号信息" :column="3" border>
<template #extra> </template>
<el-descriptions-item>
<template #label> ID </template>
......@@ -30,17 +24,74 @@
生活号名称生活号名称生活号名称
</el-descriptions-item>
</el-descriptions>
<el-descriptions class="margin-top" title="类型信息" :column="3" 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>
<el-descriptions class="margin-top" title="用户信息" :column="3" 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 {
lifeNoId: this.$route.query.lifeId
}
},
created () {
console.log(this.$route.query.lifeId, this.lifeNoId, '0000')
}
}
</script>
<style lang="less" scoped>
.lifeNoInfo {
.margin-top {
margin-top: 10px;
}
}
</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>
<layout>
<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>
</layout>
<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="life_account.name"
placeholder="生活号名称/企业名称"
></el-input>
</el-form-item>
<el-form-item label="类型">
<el-select v-model="life_account.type" placeholder="类型">
<el-option value="个人" label="个人"></el-option>
<el-option value="企业" label="企业"></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="LifeNoList"
border
style="width: 100%"
@row-click="toLifeDetail"
>
<el-table-column prop="life_account_id" label="ID"> </el-table-column>
<el-table-column prop="life_account_name" label="生活号名称">
</el-table-column>
<el-table-column prop="life_account_type" label="类型"> </el-table-column>
<el-table-column prop="life_account_auth_status" label="状态">
</el-table-column>
<el-table-column prop="create_time" label="创建时间"> </el-table-column>
</el-table>
<page :totalNum="totalNum" @update="update" />
</div>
</template>
<script>
import Layout from '@/layouts'
import page from "./components/Pagination"
import page from "../components/Pagination"
import { getLifeNoList as reqGetLifeNoList } from "../../service/life-no";
export default {
name: "LifeNo",
components: {
Layout,
page
},
data () {
return {
params: {
page: 1,
pageSize: 10
page_size: 20
},
totalNum: 1000,
life_account: {
name: "",
type: "",
},
totalNum: null,
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 弄'
}],
LifeNoList: [],
formInline: {
user: '',
region: ''
}
}
},
created () {
this.getLifeNoListFn()
},
methods: {
//获取列表数据
getLifeNoListFn () {
let { name, type } = this.life_account
let { page, page_size } = this.params
let params = {
page,
page_size,
life_account_name: name,
life_account_type: type == "个人" ? 1 : 2
}
reqGetLifeNoList(params).then(res => {
this.totalNum = res.count
this.LifeNoList = res.data
})
},
//查询
onSearchSubmit () {
console.log(this.formInline.user, this.formInline.region, 'submit!');
this.getLifeNoListFn()
},
//重置
onReset () {
this.formInline.user = "",
this.formInline.region = ""
this.life_account.name = "",
this.life_account.type = ""
},
update (obj) {
Object.assign(this.params, obj)
this.getlifeNoList(this.params)
this.getLifeNoListFn(this.params)
},
toLifeDetail (row) {
// this.$router.push({ path: lifeNoDetail })
console.log(row.id, 'eee去详情')
this.$router.push({ name: 'LifeNoDetail', query: { lifeId: row.life_account_id } });
console.log(row.life_account_id, 'eee去详情')
},
//获取列表数据
getlifeNoList () {
}
}
}
</script>
......
<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 {
......
......@@ -28,7 +28,7 @@
import { login as reqLogin } from "../../service/user";
export default {
name: "Login",
data() {
data () {
return {
userInfo: {
email: "",
......@@ -36,9 +36,9 @@ export default {
},
};
},
created() {},
created () { },
methods: {
async login() {
async login () {
const { email, password } = this.userInfo;
console.log(34333, email, password);
if (!email) {
......
.role_management {
padding: 50px;
}
.role_management .el-button {
margin: 0 2px;
}
.role_management{
padding: 50px;
.el-button{
margin: 0 2px;
}
}
\ No newline at end of file
This diff is collapsed.
<template>
<div>
<el-form-item label="状态" :label-width="formLabelWidth" prop="pass">
<el-input disabled v-model="loaclRole_info.role_status"></el-input>
</el-form-item>
<el-form-item label="ID" :label-width="formLabelWidth" prop="pass">
<el-input disabled v-model="loaclRole_info.role_id"></el-input>
</el-form-item>
<el-form-item label="创建人账号" :label-width="formLabelWidth">
<el-input disabled v-model="loaclRole_info.create_user_name"></el-input>
</el-form-item>
<el-form-item label="创建时间" :label-width="formLabelWidth">
<el-input disabled v-model="loaclRole_info.create_time"></el-input>
</el-form-item>
<el-form-item label="最后修改人账号" :label-width="formLabelWidth">
<el-input disabled v-model="loaclRole_info.update_user_name"></el-input>
</el-form-item>
<el-form-item label="最后修改时间" :label-width="formLabelWidth">
<el-input disabled v-model="loaclRole_info.update_time"></el-input>
</el-form-item>
</div>
</template>
<script>
export default {
props: ["role_info_detail"],
data () {
return {
formLabelWidth: "120px",
loaclRole_info: this.role_info_detail
}
},
created () {
console.log(this.role_info_detail, 'role_info_detail')
}
}
</script>
\ No newline at end of file
......@@ -2,10 +2,7 @@
<layout>
<el-card class="role_management">
<!-- 角色检索区域 -->
<el-form
inline
:model="searchForm"
>
<el-form inline :model="searchForm">
<el-form-item label="角色名称">
<el-input v-model="searchForm.roleName"></el-input>
</el-form-item>
......@@ -14,18 +11,9 @@
v-model="searchForm.roleStatus"
placeholder="请选择角色状态"
>
<el-option
label="正常"
:value="1"
></el-option>
<el-option
label="禁用"
:value="2"
></el-option>
<el-option
label="删除"
:value="3"
></el-option>
<el-option label="正常" :value="1"></el-option>
<el-option label="禁用" :value="2"></el-option>
<el-option label="删除" :value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item>
......@@ -35,15 +23,8 @@
</el-form>
<!-- 角色搜索列表 -->
<el-table
border
:data="managementList"
>
<el-table-column
label="ID"
prop="id"
align="center"
></el-table-column>
<el-table border :data="managementList">
<el-table-column label="ID" prop="id" align="center"></el-table-column>
<el-table-column
label="角色名称"
prop="name"
......@@ -64,45 +45,41 @@
prop="updateNumber"
align="center"
></el-table-column>
<el-table-column
label="操作"
align="center"
>
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button
size="mini"
@click="handelClick(scope.row)"
type="primary"
>修改</el-button>
>修改</el-button
>
<el-button
size="mini"
@click="handelClick(scope.row)"
type="warning"
>删除</el-button>
<el-button
size="mini"
@click="handelClick(scope.row)"
type="danger"
>禁用</el-button>
>删除</el-button
>
<el-button size="mini" @click="handelClick(scope.row)" type="danger"
>禁用</el-button
>
<el-button
size="mini"
@click="handelClick(scope.row)"
type="success"
>启用</el-button>
>启用</el-button
>
<el-button
style="margin-top:10px"
style="margin-top: 10px"
size="mini"
@click="handelClick(scope.row)"
>查看详情</el-button>
>查看详情</el-button
>
</template>
</el-table-column>
</el-table>
</el-card>
</layout>
</template>
<style lang="less" scope src="./index.less"></style>
<script>
import Layout from "@/layouts";
export default {
......@@ -129,3 +106,11 @@ export default {
},
};
</script>
<style lang="less" scoped>
.role_management {
padding: 50px;
}
.role_management .el-button {
margin: 0 2px;
}
</style>
<template>
<div class="user-detail">
<h2 style="margin-bottom: 10px">用户详情</h2>
<el-descriptions class="margin-top" :column="3" :size="size" border>
<el-descriptions-item>
<template #label> 用户姓名 </template>
......@@ -49,12 +50,19 @@
</div>
</template>
<script>
// import { getUser_detail as reqGetUser_detail } from '../../service/user'
export default {
data () {
return {
user_id: 1,
userInfoList: [{
}]
}
},
created () {
// reqGetUser_detail(this.user_id).then((res) => {
// console.log(res, '000')
// })
}
}
</script>
......
<template>
<div class="block">
<!-- <el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:page-size="page_size"
background
layout="total,prev, pager, next"
:total="totalNum"
>
</el-pagination> -->
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
v-model:currentPage="currentPage"
:page-size="pageSize"
layout=" total,prev, pager, next"
:current-page="currentPage"
:page-size="page_size"
background
layout="total, prev, pager, next, jumper"
:total="totalNum"
>
</el-pagination>
......@@ -16,14 +26,14 @@ export default {
props: ['data', 'totalNum'],
data () {
return {
currentPage: 5,
pageSize: 20
currentPage: 1,
page_size: 20
}
},
methods: {
handleSizeChange (size) {
console.log(`每页 ${size} 条`);
this.$emit('update', { pageSize: size })
this.$emit('update', { page_size: size })
},
handleCurrentChange (pageIndex) {
console.log(`当前页: ${pageIndex}`);
......@@ -36,5 +46,4 @@ export default {
.block {
margin-top: 50px;
}
// 样式可以内联,也可以通过 src 引入
</style>
\ No newline at end of file
......@@ -3,10 +3,10 @@ import { createRouter, createWebHistory } from "vue-router";
import LifeNo from '../pages/Life-no/index.vue'
import LifeNoDetail from '../pages/Life-no/life-no-detail.vue'
import User from '../pages/User/userList'
// import User from '../pages/User/userList'
import UserDetail from '../pages/User/user-detail.vue'
import AddRole from '../pages/Role/add-role.vue'
import ManageRole from '../pages/Role/manage-role.vue'
const routes = [
{
......@@ -51,42 +51,31 @@ const routes = [
},
//生活号管理
{
path: '/life-no/life',
path: '/lifeNo',
name: 'LifeNo',
component: LifeNo,
meta: {
requireAuth: true,
}
},
{
path: "/life-no/lifeNoDetail",
name: "LifeNoDetail",
component: LifeNoDetail
path: '/lifeNoDetail',
name: 'LifeNoDetail',
component: LifeNoDetail,
},
//用户管理
{
path: '/user',
name: 'User',
component: User,
meta: {
requireAuth: true,
}
},
{
path: '/user/userDetail',
path: '/userDetail',
name: 'UserDetail',
component: UserDetail,
},
//角色管理
{
path: "/role/addRole",
name: "AddRole",
path: '/roleAddRole',
name: 'AddRole',
component: AddRole
},
{
path: "/role",
name: "Role",
component: import(/* webpackChunkName: "role" */ "@/pages/Role/RoleManagement")
path: '/roleManageRole',
name: 'ManageRole',
component: ManageRole
}
];
......
import axios from '../utils/request';
//生活号列表
export async function getLifeNoList (params) {
const res = await axios.get(`/api/v1/merchant/lifeinner/life_list`, {
params
})
return res.result;
}
\ No newline at end of file
import axios from '../utils/request';
// import qs from 'qs';
//角色列表
export async function getRole_list (page, page_size) {
const res = await axios.post("/api/v1/merchant/authority/role_list", {
page, page_size
})
return res;
}
//添加角色
export async function getAdd_role (role_name, permissions) {
const res = await axios.post("/api/v1/merchant/authority/add_role", {
role_name, permissions
})
return res.result;
}
//角色编辑
export async function getUpdate_role (role_name, role_id, permissions) {
const res = await axios.post("/api/v1/merchant/authority/update_role", {
role_name, role_id, permissions
})
return res.result;
}
//角色详情
export async function get_role_info (role_id) {
const res = await axios.post("/api/v1/merchant/authority/get_role_info", {
role_id
})
return res.result;
}
//权限列表
export async function getAll_role_list (user_name, user_email) {
const res = await axios.post("/api/v1/merchant/authority/get_role_list", {
user_name, user_email
})
return res.permissions;
}
import axios from '../utils/request';
export async function login(email, password) {
export async function login (email, password) {
const res = await axios.post(`/api/v1/login`, {
email, password, authCode: ''
});
return res.data;
}
export async function fetchCurrentUser() {
export async function fetchCurrentUser () {
return await axios.get("/api/v1/fetch_user");
}
export async function getPermissions(email) {
export async function getPermissions (email) {
console.log("fe service, getPermissions:::", email)
return await axios.get("/api/v1/user/get_permissions", { params: {email} });
}
\ No newline at end of file
return await axios.get("/api/v1/user/get_permissions", { params: { email } });
}
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