Commit 45728d0b authored by mengwenhao's avatar mengwenhao

update: 接口封装更改

parent a82b5ed8
...@@ -8,9 +8,9 @@ const LOGIN_URI = { ...@@ -8,9 +8,9 @@ const LOGIN_URI = {
} }
const API_INTERNAL_URI = { const API_INTERNAL_URI = {
'development': "bp-test.ini.yidian-inc.com ", 'development': "http://bp-test.ini.yidian-inc.com",
'test': "bp-test.ini.yidian-inc.com ", 'test': "http://bp-test.ini.yidian-inc.com",
'production': "bp-test.go2yd.com " 'production': "http://bp-test.go2yd.com"
} }
module.exports = { module.exports = {
......
const LOGIN_URI = require("../config.js").LOGIN_URI; const API_INTERNAL_URI = require("../config.js").API_INTERNAL_URI;
const req = require("../utils/request").httpReq; const req = require("../utils/request").httpReq;
exports.entCheck = async ctx => { exports.entCheck = async (ctx, next) => {
const url = `${LOGIN_URI}/merchant/inner/ent_check`; const url = `${API_INTERNAL_URI}/merchant/inner/ent_check`;
const { user_id } = ctx.request.params;
const opts = { const opts = {
url, url,
method: "GET", method: "GET",
json: true,
timeout: 8000, timeout: 8000,
params: { body: ctx.request.body
user_id
}
}; };
ctx.body = await req(ctx, opts) console.log("next:", next);
console.log("参数传递", ctx.request.query);
ctx.body = await req(ctx, opts);
}; };
...@@ -8,6 +8,6 @@ const API_VERSION = "/api/v1"; ...@@ -8,6 +8,6 @@ const API_VERSION = "/api/v1";
router.post(`${API_VERSION}/login`, system.login); router.post(`${API_VERSION}/login`, system.login);
router.get(`${API_VERSION}/user/:type`, user.query); router.get(`${API_VERSION}/user/:type`, user.query);
router.get(`${API_VERSION}/merchant/inner/ent_check`, enterprise.entCheck) router.get(`${API_VERSION}/certification/:user_id`, enterprise.entCheck);
module.exports = router; module.exports = router;
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
<!-- 修改详情页 --> <!-- 修改详情页 -->
<el-form <el-form
v-if="pageStatus === 'EDIT' "
:rules="messageLishRules" :rules="messageLishRules"
label-width="240px" label-width="240px"
ref="establish_form" ref="establish_form"
......
...@@ -172,7 +172,7 @@ ...@@ -172,7 +172,7 @@
<script> <script>
import Layout from "@/layouts"; import Layout from "@/layouts";
import { entCheck as entChecked } from "@/service/enterprise"; import { entCheck as entChecked } from "../../../service/enterprise";
export default { export default {
name: "Certification", name: "Certification",
components: { Layout }, components: { Layout },
......
import { createRouter, createWebHistory } from "vue-router"; import { createRouter, createWebHistory } from "vue-router";
import Home from "../pages/Home"; import Home from "../pages/Home";
import Login from "../pages/Login"; import Login from "../pages/Login";
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 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 Certification from "../pages/Enterprise/Certification";
import Establish from "../pages/Enterprise/Establish";
import Audit from "../pages/Enterprise/Audit";
const routes = [ const routes = [
{ {
path: "/home", path: "/home",
name: "Home", name: "Home",
component: Home, component: Home
}, },
{ {
path: "/login", path: "/login",
name: "Login", name: "Login",
component: Login, component: Login
}, },
{ {
path: "/about", path: "/about",
name: "About", name: "About",
component: () => import(/* webpackChunkName: "about" */ "../pages/About"), component: () => import(/* webpackChunkName: "about" */ "@/pages/About")
}, },
// 企业认证管理
{ {
path: '/enterprise/certification', path: "/certification",
name: 'Certification', name: "Certification",
component: () => import(/* webpackChunkName: "enterprise" */ '@/pages/Enterprise/Certification') component: Certification
}, },
{ {
path: '/enterprise/audit', path: "/audit",
name: 'Audit', name: "Audit",
component: () => import(/* webpackChunkName: "enterprise" */ '@/pages/Enterprise/Audit') component: Audit
}, },
{ {
path: '/enterprise/establish', path: "/establish",
name: 'Establish', name: "Establish",
component: () => import(/* webpackChunkName: "enterprise" */ '@/pages/Enterprise/Establish') component: Establish
}, },
//生活号管理 //生活号管理
{ {
path: '/life-no/life', path: "/life-no/life",
name: 'LifeNo', name: "LifeNo",
component: LifeNo, component: LifeNo
}, },
{ {
path: '/life-no/lifeNoDetail', path: "/life-no/lifeNoDetail",
name: 'LifeNoDetail', name: "LifeNoDetail",
component: LifeNoDetail, component: LifeNoDetail
}, },
//用户管理 //用户管理
{ {
path: '/user/userDetail', path: "/user/userDetail",
name: 'UserDetail', name: "UserDetail",
component: UserDetail, component: UserDetail
}, },
//角色管理 //角色管理
{ {
path: '/role/addRole', path: "/role/addRole",
name: 'AddRole', name: "AddRole",
component: AddRole, component: AddRole
}, }
]; ];
const router = createRouter({ const router = createRouter({
history: createWebHistory(), history: createWebHistory(),
routes, routes
}); });
export default router; export default router;
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
*/ */
import axios from "../utils/request"; import axios from "../utils/request";
export const entCheck = async user_id => { export async function entCheck (user_id) {
const res = await axios.get(`api/v1/merchant/inner/ent_check`, { params: { user_id } }) let res = await axios.get(
`api/v1/certification`, { user_id }
)
return res.data; return res.data;
}; };
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