You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.1 KiB
47 lines
1.1 KiB
"use strict";
|
|
const enums_appEnums = require("../enums/appEnums.js");
|
|
const getClient = () => {
|
|
return handleClientEvent({
|
|
// 微信小程序
|
|
MP_WEIXIN: () => enums_appEnums.ClientEnum["MP_WEIXIN"],
|
|
// 微信公众号
|
|
OA_WEIXIN: () => enums_appEnums.ClientEnum["OA_WEIXIN"],
|
|
// H5
|
|
H5: () => enums_appEnums.ClientEnum["H5"],
|
|
// APP
|
|
IOS: () => enums_appEnums.ClientEnum["IOS"],
|
|
ANDROID: () => enums_appEnums.ClientEnum["ANDROID"],
|
|
// 其它
|
|
OTHER: () => null
|
|
});
|
|
};
|
|
const getClientString = () => {
|
|
return handleClientEvent({
|
|
// 微信小程序
|
|
MP_WEIXIN: () => "",
|
|
// 微信公众号
|
|
OA_WEIXIN: () => "wechat",
|
|
// H5
|
|
H5: () => "jump",
|
|
// APP
|
|
IOS: () => "",
|
|
ANDROID: () => "",
|
|
// 其它
|
|
OTHER: () => null
|
|
});
|
|
};
|
|
const handleClientEvent = ({
|
|
MP_WEIXIN,
|
|
OA_WEIXIN,
|
|
H5,
|
|
IOS,
|
|
ANDROID,
|
|
OTHER
|
|
}) => {
|
|
return MP_WEIXIN();
|
|
};
|
|
const client = getClient();
|
|
exports.client = client;
|
|
exports.getClient = getClient;
|
|
exports.getClientString = getClientString;
|
|
exports.handleClientEvent = handleClientEvent;
|
|
|