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

update:add

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