Commit ec879c13 authored by mengwenhao's avatar mengwenhao

update: 接口的封装

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