Commit 910a011e by 匡雅琴

添加请求

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