|
发表于 2024-11-3 05:19:57
|
显示全部楼层
新疆维吾尔自治区乌鲁木齐市
去看下js吧 里面有如何生成的
function() {
var t = Object(u["a"])(regeneratorRuntime.mark((function t(e) {
var i, a, o, n, s, r, c, l, d, h, m, v, _, g, b, y, w, x, k, C, $ = arguments;
return regeneratorRuntime.wrap((function(t) {
while (1)
switch (t.prev = t.next) {
case 0:
if (i = $.length > 1 && void 0 !== $[1] ? $[1] : {},
a = $.length > 2 && void 0 !== $[2] ? $[2] : 0,
o = $.length > 3 && void 0 !== $[3] ? $[3] : 1,
n = "picupload.weibo.com",
s = "",
"image/gif" == e.type) {
t.next = 11;
break
}
return t.next = 8,
tm(e);
case 8:
s = t.sent,
t.next = 14;
break;
case 11:
return t.next = 13,
tm(e);
case 13:
s = t.sent;
case 14:
if (t.prev = 14,
c = +new Date,
l = 0 === i.watermark ? "" : Zf(),
a) {
t.next = 26;
break
}
return d = "//".concat(n, "/interface/pic_upload.php?app=miniblog&s=json&p=1&data=1&").concat(l),
h = p.a.create(),
delete h.defaults.headers.common["X-Requested-With"],
t.next = 23,
h.request({
url: d,
method: "post",
data: s,
withCredentials: !0,
timeout: 12e4,
xsrfCookieName: null,
headers: {
"Content-Type": "multipart/form-data"
}
});
case 23:
r = t.sent,
t.next = 46;
break;
case 26:
return t.t0 = Qf,
t.next = 29,
em(e);
case 29:
return t.t1 = t.sent,
_ = (0,
t.t0)(t.t1),
t.next = 33,
Xf(e).catch((function(t) {
throw new Error("计算image MD5失败(".concat(t.message, ")"))
}
));
case 33:
g = t.sent,
b = {
file_source: o,
cs: _,
ent: "miniblog",
appid: 339644097,
uid: window.$CONFIG && window.$CONFIG.uid || window.$CONFIG && window.$CONFIG.user && (null === (m = window.$CONFIG) || void 0 === m || null === (v = m.user) || void 0 === v ? void 0 : v.id),
raw_md5: g,
ori: 1,
mpos: 0 !== i.watermark && window.$CONFIG && window.$CONFIG.user && window.$CONFIG.user.watermark && window.$CONFIG.user.watermark.markpos,
nick: 0 !== i.watermark && window.$CONFIG && window.$CONFIG.user && window.$CONFIG.user.watermark && window.$CONFIG.user.watermark.nick,
request_id: c,
file_size: e.size
},
y = f.a.stringify(b),
w = "//".concat(n, "/interface/upload.php?").concat(y),
h = p.a.create(),
delete h.defaults.headers.common["X-Requested-With"];
try {
performance.mark("imageUpload", {
detail: {
request_id: c,
fileSize: e.size
}
})
} catch (O) {}
return x = Kf()().unix(),
k = p.a.CancelToken,
C = k.source(),
t.next = 45,
h.request({
url: w,
method: "post",
data: s,
withCredentials: !0,
timeout: 12e4,
xsrfCookieName: null,
cancelToken: C.token,
headers: {
"Content-Type": "application/octet-stream"
},
onUploadProgress: function() {
var t = Object(u["a"])(regeneratorRuntime.mark((function t(e) {
var i, a, o;
return regeneratorRuntime.wrap((function(t) {
while (1)
switch (t.prev = t.next) {
case 0:
i = e.loaded,
a = Kf()().unix() - x,
a > 3 && "image.api.weibo.com" !== n && (o = i / 1024 / a,
o < 25 && C.cancel("hostUpdate"));
case 3:
case "end":
return t.stop()
}
}
), t)
}
)));
function e(e) {
return t.apply(this, arguments)
}
return e
}()
});
case 45:
r = t.sent;
case 46:
t.next = 56;
break;
case 48:
if (t.prev = 48,
t.t2 = t["catch"](14),
"hostUpdate" !== t.t2.message) {
t.next = 55;
break
}
return n = "image.api.weibo.com",
t.abrupt("return", om(e, i, a, o));
case 55:
throw new im(t.t2);
case 56:
if (!r.data.ret) {
t.next = 60;
break
}
return t.abrupt("return", r.data.pic.pid);
case 60:
if (!1 !== r.data.ret) {
t.next = 64;
break
}
throw new am(r.data.errno);
case 64:
if (r.data.code && "A00006" == r.data.code) {
t.next = 66;
break
}
throw new am(r.data.data && r.data.data.count);
case 66:
return t.abrupt("return", r.data.data.pics.pic_1.pid);
case 67:
case "end":
return t.stop()
}
}
), t, null, [[14, 48]])
}
)));
return function(e) {
return t.apply(this, arguments)
}
} |
|