Commit ec879c13 authored by mengwenhao's avatar mengwenhao

update: 接口的封装

parent 1f52d687
const { LOGIN_URI, API_INTERNAL_URI} = require('../config.js')
const req = require('../utils/request').httpReq
const { LOGIN_URI, API_INTERNAL_URI } = require("../config.js");
const req = require("../utils/request").httpReq;
/**
* 用户登录校验,用于校验是否是公司员工, 目前使用pandora系统的登录验证
......@@ -8,10 +8,10 @@ exports.login = async (ctx, next) => {
const url = `${LOGIN_URI}/api/v1/pandora/auth`;
const opts = {
url,
method: 'POST',
method: "POST",
json: true,
body : ctx.request.body
}
body: ctx.request.body
};
// ctx.body = await req(ctx, opts)
const userInfo = await req(ctx, opts);
......@@ -42,13 +42,10 @@ exports.login = async (ctx, next) => {
// active: true
// }
// }
if (typeof userInfo === 'string') {
ctx.body = {status: 'fail', message: userInfo};
} else {
if (typeof userInfo === "string") {
ctx.body = { status: "fail", message: userInfo };
}
console.log(43444, userInfo, typeof userInfo);
// if userInfo
}
};
This diff is collapsed.
......@@ -148,17 +148,17 @@
<el-button
size="mini"
type="primary"
@click="goAuditPage('AUDIT',scope.row.id)"
@click="goAuditPage('AUDIT', scope.row.id)"
>审核</el-button>
<el-button
size="mini"
type="success"
@click="goAuditPage('EDIT',scope.row.id)"
@click="goAuditPage('EDIT', scope.row.id)"
>修改提交</el-button>
<el-button
size="mini"
type="warning"
@click="goAuditPage('DETAIL',scope.row.id)"
@click="goAuditPage('DETAIL', scope.row.id)"
>查看详情</el-button>
</template>
</el-table-column>
......@@ -171,9 +171,10 @@
<style lang="less" src="./index.less" scope></style>
<script>
import Layout from '@/layouts'
import Layout from "@/layouts";
import { entCheck as entChecked } from "@/service/enterprise";
export default {
name: 'Certification',
name: "Certification",
components: { Layout },
data () {
return {
......@@ -214,10 +215,21 @@ export default {
};
},
created () { },
created () {
this.entCheck();
},
methods: {
// 获取商户认证检查信息
async entCheck () {
try {
const res = await entChecked(510232747179);
console.log(res);
}
catch (error) {
console.log(error);
}
},
// 重置表单
resetForm (formName) {
......@@ -226,20 +238,18 @@ export default {
// 跳转到审核页面
goAuditPage (pageStatus, auditId) {
this.$router.push(
{
this.$router.push({
name: "Audit",
params: {
pageStatus,
auditId
}
}
);
});
},
// 跳转到企业信息提交
goEstablish () {
this.$router.push({ name: 'Establish' })
this.$router.push({ name: "Establish" });
}
}
};
......
/**
* 企业请求
*/
import axios from "../utils/request";
export default {
async getMessage () {
const res = await axios.get()
console.log(res);
export const entCheck = async user_id => {
const res = await axios({
method: "GET",
url: "/api/merchant/inner/ent_check",
params: {
user_id
}
});
return res;
};
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