| 1234567891011121314151617181920212223242526272829 |
- "use strict";
- const config_env = require("../config/env.js");
- function formatTime(time, format = "yyyy年MM月dd日") {
- const date = new Date(time);
- const formatObj = {
- "y+": date.getFullYear(),
- "M+": date.getMonth() + 1,
- "d+": date.getDate(),
- "H+": date.getHours(),
- "m+": date.getMinutes(),
- "s+": date.getSeconds()
- };
- for (let key in formatObj) {
- if (new RegExp(`(${key})`).test(format)) {
- const str = formatObj[key].toString();
- format = format.replace(
- RegExp.$1,
- RegExp.$1.length === 1 ? str : ("00" + str).slice(str.length)
- );
- }
- }
- return format;
- }
- function getImageUrl(path) {
- return config_env.env.baseUrl + "/service?ssServ=dlByHttp&wdConfirmationCaptchaService=0&type=img&path=" + path;
- }
- exports.formatTime = formatTime;
- exports.getImageUrl = getImageUrl;
- //# sourceMappingURL=../../.sourcemap/mp-weixin/utils/util.js.map
|