Commit 910a011e by 匡雅琴

添加请求

1 parent 7210b752
import api from './request' import api from './request'
import ssoApi from './ssoApi' import ssoApi from './ssoApi'
import entmicroApi from './entmicroApi'
const common = 'scrm.api.carlife.common.' const common = 'scrm.api.carlife.common.'
module.exports = { module.exports = {
ssoApi, ssoApi,
entmicroApi,
commonApi: { commonApi: {
/**上传图片 /**上传图片
*/ */
......
import api from "./request";
module.exports = {
// 智能名片详情
getCardDetail(data) {
return api.post(
{
method: `entmicro.api.business.card.cardDetail`,
...data,
},
true
);
},
}
\ No newline at end of file \ No newline at end of file
const target = [ const target = ["ip", "dev", "uat", "prod"];
'ip',
'dev',
'uat',
'prod'
]
/** /**
* *
0本地 0本地
...@@ -11,43 +6,44 @@ const target = [ ...@@ -11,43 +6,44 @@ const target = [
2测试 2测试
3生产 3生产
*/ */
const index = 2 const index = 1;
const secretKey = { const secretKey = {
ip: {}, ip: {},
dev: { dev: {
sso: { sso: {
appKey: '8b31ae1009ccb0f96130ca4bd90e3d89', appKey: "8b31ae1009ccb0f96130ca4bd90e3d89",
secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b', secret: "02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b",
} },
}, },
uat: { uat: {
sso: { sso: {
appKey: '8b31ae1009ccb0f96130ca4bd90e3d89', appKey: "8b31ae1009ccb0f96130ca4bd90e3d89",
secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b', secret: "02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b",
} },
}, },
prod: { prod: {
sso: { sso: {
appKey: '8b31ae1009ccb0f96130ca4bd90e3d89', appKey: "8b31ae1009ccb0f96130ca4bd90e3d89",
secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b', secret: "02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b",
} },
}, },
} [target[index]] }[target[index]];
const domain = { const domain = {
ip: 'http://192.168.3.181:8394', ip: "http://192.168.3.181:8394",
dev: 'https://scrm.dev.glsx.com.cn', dev: "https://scrm.dev.glsx.com.cn",
uat: 'https://scrm.test.glsx.com.cn', uat: "https://scrm.test.glsx.com.cn",
prod: 'https://scrm.glsx.com.cn', prod: "https://scrm.glsx.com.cn",
} [target[index]] }[target[index]];
const pathEnum = { const pathEnum = {
sso: '/rop-scrm-sso/', sso: "/rop-scrm-sso/",
wechant: 'rop-scrm-wechant' wechant: "rop-scrm-wechant",
} business: "/rop-scrm-entmicro/",
};
module.exports = { module.exports = {
index, index,
domain, domain,
pathEnum, pathEnum,
secretKey, secretKey,
}
\ No newline at end of file \ No newline at end of file
};
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
*/ */
// pages/tab/index/index.js // pages/tab/index/index.js
import { menuMixin } from "../../../mixins/index"; import { menuMixin } from "../../../mixins/index";
import Draw from '../../../utils/Draw'; import Draw from "../../../utils/Draw";
import { ssoApi } from '../../../api/api'; import { ssoApi, entmicroApi } from "../../../api/api";
import util from "../../../utils/util";
Page({ Page({
behaviors: [menuMixin], behaviors: [menuMixin],
/** /**
...@@ -42,7 +43,7 @@ Page({ ...@@ -42,7 +43,7 @@ Page({
// 0-员工,1-代理商 // 0-员工,1-代理商
customerType: 0, customerType: 0,
// 是否授权昵称 // 是否授权昵称
hasUserInfo: false hasUserInfo: false,
}, },
introduce(e) { introduce(e) {
const curTabIndex = e.currentTarget.dataset.index; const curTabIndex = e.currentTarget.dataset.index;
...@@ -72,6 +73,15 @@ Page({ ...@@ -72,6 +73,15 @@ Page({
*/ */
onLoad(options) { onLoad(options) {
console.log(this.data.hasUserInfo); console.log(this.data.hasUserInfo);
// 获取员工名片信息
const sessionId = util.getSessionId();
let params = {};
params.cardId = 21;
params.sessionId = sessionId;
console.log(params, "+++");
// entmicroApi.getCardDetail(params).then((res) => {
// console.log(res);
// });
}, },
/** /**
...@@ -237,35 +247,34 @@ Page({ ...@@ -237,35 +247,34 @@ Page({
}, },
// 获取用户昵称 // 获取用户昵称
getUserProfile(e) { getUserProfile(e) {
console.log(e) console.log(e);
// 推荐使用 wx.getUserProfile 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认 // 推荐使用 wx.getUserProfile 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 // 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
wx.getUserProfile({ wx.getUserProfile({
desc: '用于完善资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 desc: "用于完善资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (res) => { success: (res) => {
console.log(res) console.log(res);
console.log(this.data.hasUserInfo) console.log(this.data.hasUserInfo);
this.setData({ this.setData({
hasUserInfo: true hasUserInfo: true,
}) });
ssoApi.authUserInfo({ ssoApi
...res .authUserInfo({
}).then(({ ...res,
code })
}) => { .then(({ code }) => {
if (code == '0') { if (code == "0") {
getApp().login().then(({ getApp()
data .login()
}) => { .then(({ data }) => {
this.setData({ this.setData({
userInfo: data, userInfo: data,
// hasUserInfo: true // hasUserInfo: true
}) });
}) });
} }
}) });
} },
}) });
}, },
}); });
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!