Commit 45728d0b authored by mengwenhao's avatar mengwenhao

update: 接口封装更改

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