├── favicon.ico ├── .gitignore ├── _nuxt ├── fonts │ ├── 732389d.ttf │ └── 535877f.woff ├── 318bf53201c4127c79fc.js ├── a84b71f5040faa8705cb.js ├── b46e75617207ae5013d0.js └── fbd198cfd0f4459e2725.js ├── functions ├── api │ ├── manage │ │ ├── logout.js │ │ ├── login.js │ │ ├── delete │ │ │ └── [id].js │ │ ├── check.js │ │ ├── block │ │ │ └── [id].js │ │ ├── white │ │ │ └── [id].js │ │ ├── list.js │ │ └── _middleware.js │ └── bing │ │ └── wallpaper │ │ └── index.js ├── upload.js └── file │ └── [id].js ├── block-img.html ├── whitelist-on.html ├── README-EN.md ├── README.md ├── LICENSE ├── bg.svg └── admin.html /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lipeng0820/Telegraph-Image/HEAD/favicon.ico -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | package-lock.json 2 | _nuxt/b46e75617207ae5013d0.js 3 | node_modules 4 | package.json 5 | -------------------------------------------------------------------------------- /_nuxt/fonts/732389d.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lipeng0820/Telegraph-Image/HEAD/_nuxt/fonts/732389d.ttf -------------------------------------------------------------------------------- /_nuxt/fonts/535877f.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lipeng0820/Telegraph-Image/HEAD/_nuxt/fonts/535877f.woff -------------------------------------------------------------------------------- /functions/api/manage/logout.js: -------------------------------------------------------------------------------- 1 | export async function onRequest(context) { 2 | // Contents of context object 3 | const { 4 | request, // same as existing Worker API 5 | env, // same as existing Worker API 6 | params, // if filename includes [id] or [[path]] 7 | waitUntil, // same as ctx.waitUntil in existing Worker API 8 | next, // used for middleware or to fetch assets 9 | data, // arbitrary space for passing data between middlewares 10 | } = context; 11 | return new Response('Logged out.', { status: 401 }); 12 | 13 | } -------------------------------------------------------------------------------- /functions/api/manage/login.js: -------------------------------------------------------------------------------- 1 | export async function onRequest(context) { 2 | // Contents of context object 3 | const { 4 | request, // same as existing Worker API 5 | env, // same as existing Worker API 6 | params, // if filename includes [id] or [[path]] 7 | waitUntil, // same as ctx.waitUntil in existing Worker API 8 | next, // used for middleware or to fetch assets 9 | data, // arbitrary space for passing data between middlewares 10 | } = context; 11 | //get the request url 12 | const url = new URL(request.url); 13 | //redirect to admin page 14 | return Response.redirect(url.origin+"/admin.html", 302) 15 | 16 | } -------------------------------------------------------------------------------- /functions/api/manage/delete/[id].js: -------------------------------------------------------------------------------- 1 | export async function onRequest(context) { 2 | // Contents of context object 3 | const { 4 | request, // same as existing Worker API 5 | env, // same as existing Worker API 6 | params, // if filename includes [id] or [[path]] 7 | waitUntil, // same as ctx.waitUntil in existing Worker API 8 | next, // used for middleware or to fetch assets 9 | data, // arbitrary space for passing data between middlewares 10 | } = context; 11 | console.log(env) 12 | console.log(params.id) 13 | await env.img_url.delete(params.id); 14 | const info = JSON.stringify(params.id); 15 | return new Response(info); 16 | 17 | } -------------------------------------------------------------------------------- /functions/api/manage/check.js: -------------------------------------------------------------------------------- 1 | export async function onRequest(context) { 2 | // Contents of context object 3 | const { 4 | request, // same as existing Worker API 5 | env, // same as existing Worker API 6 | params, // if filename includes [id] or [[path]] 7 | waitUntil, // same as ctx.waitUntil in existing Worker API 8 | next, // used for middleware or to fetch assets 9 | data, // arbitrary space for passing data between middlewares 10 | } = context; 11 | if(typeof context.env.BASIC_USER == "undefined" || context.env.BASIC_USER == null || context.env.BASIC_USER == ""){ 12 | return new Response('Not using basic auth.', { status: 200 }); 13 | }else{ 14 | return new Response('true', { status: 200 }); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /functions/upload.js: -------------------------------------------------------------------------------- 1 | export async function onRequestPost(context) { // Contents of context object 2 | const { 3 | request, // same as existing Worker API 4 | env, // same as existing Worker API 5 | params, // if filename includes [id] or [[path]] 6 | waitUntil, // same as ctx.waitUntil in existing Worker API 7 | next, // used for middleware or to fetch assets 8 | data, // arbitrary space for passing data between middlewares 9 | } = context; 10 | context.request 11 | const url = new URL(request.url); 12 | const response = fetch('https://telegra.ph/' + url.pathname + url.search, { 13 | method: request.method, 14 | headers: request.headers, 15 | body: request.body, 16 | }); 17 | return response; 18 | } 19 | -------------------------------------------------------------------------------- /functions/api/bing/wallpaper/index.js: -------------------------------------------------------------------------------- 1 | export async function onRequest(context) { 2 | // Contents of context object 3 | const { 4 | request, // same as existing Worker API 5 | env, // same as existing Worker API 6 | params, // if filename includes [id] or [[path]] 7 | waitUntil, // same as ctx.waitUntil in existing Worker API 8 | next, // used for middleware or to fetch assets 9 | data, // arbitrary space for passing data between middlewares 10 | } = context; 11 | const res = await fetch(`https://cn.bing.com/HPImageArchive.aspx?format=js&idx=0&n=5`); 12 | const bing_data = await res.json(); 13 | const return_data={ 14 | "status":true, 15 | "message":"操作成功", 16 | "data": bing_data.images 17 | } 18 | const info = JSON.stringify(return_data); 19 | return new Response(info); 20 | 21 | } -------------------------------------------------------------------------------- /functions/api/manage/block/[id].js: -------------------------------------------------------------------------------- 1 | export async function onRequest(context) { 2 | // Contents of context object 3 | const { 4 | request, // same as existing Worker API 5 | env, // same as existing Worker API 6 | params, // if filename includes [id] or [[path]] 7 | waitUntil, // same as ctx.waitUntil in existing Worker API 8 | next, // used for middleware or to fetch assets 9 | data, // arbitrary space for passing data between middlewares 10 | } = context; 11 | console.log(env) 12 | console.log(params.id) 13 | //read the metadata 14 | const value = await env.img_url.getWithMetadata(params.id); 15 | console.log(value) 16 | //"metadata":{"TimeStamp":19876541,"ListType":"None","rating_label":"None"} 17 | //change the metadata 18 | value.metadata.ListType = "Block" 19 | await env.img_url.put(params.id,"",{metadata: value.metadata}); 20 | const info = JSON.stringify(value.metadata); 21 | return new Response(info); 22 | 23 | } -------------------------------------------------------------------------------- /functions/api/manage/white/[id].js: -------------------------------------------------------------------------------- 1 | export async function onRequest(context) { 2 | // Contents of context object 3 | const { 4 | request, // same as existing Worker API 5 | env, // same as existing Worker API 6 | params, // if filename includes [id] or [[path]] 7 | waitUntil, // same as ctx.waitUntil in existing Worker API 8 | next, // used for middleware or to fetch assets 9 | data, // arbitrary space for passing data between middlewares 10 | } = context; 11 | console.log(env) 12 | console.log(params.id) 13 | //read the metadata 14 | const value = await env.img_url.getWithMetadata(params.id); 15 | console.log(value) 16 | //"metadata":{"TimeStamp":19876541,"ListType":"None","rating_label":"None"} 17 | //change the metadata 18 | value.metadata.ListType = "White" 19 | await env.img_url.put(params.id,"",{metadata: value.metadata}); 20 | const info = JSON.stringify(value.metadata); 21 | return new Response(info); 22 | 23 | } -------------------------------------------------------------------------------- /block-img.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | The Image is blocked | Telegraph-Image 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 |
20 |
21 | 抱歉,当前图片未能通过审查,可能含有不良内容,故无法进行加载。 22 |
23 | Sorry, the current image failed to pass the review and may contain undesirable content, so it cannot be loaded. 24 |
25 |
26 |
Powered By: Telegraph-Image
29 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /functions/api/manage/list.js: -------------------------------------------------------------------------------- 1 | export async function onRequest(context) { 2 | // Contents of context object 3 | const { 4 | request, // same as existing Worker API 5 | env, // same as existing Worker API 6 | params, // if filename includes [id] or [[path]] 7 | waitUntil, // same as ctx.waitUntil in existing Worker API 8 | next, // used for middleware or to fetch assets 9 | data, // arbitrary space for passing data between middlewares 10 | } = context; 11 | console.log(env) 12 | const value = await env.img_url.list(); 13 | 14 | console.log(value) 15 | //let res=[] 16 | //for (let i in value.keys){ 17 | //add to res 18 | //"metadata":{"TimeStamp":19876541,"ListType":"None","rating_label":"None"} 19 | //let tmp = { 20 | // name: value.keys[i].name, 21 | // TimeStamp: value.keys[i].metadata.TimeStamp, 22 | // ListType: value.keys[i].metadata.ListType, 23 | // rating_label: value.keys[i].metadata.rating_label, 24 | //} 25 | //res.push(tmp) 26 | //} 27 | const info = JSON.stringify(value.keys); 28 | return new Response(info); 29 | 30 | } -------------------------------------------------------------------------------- /whitelist-on.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | WhiteList Mode is ON| Telegraph-Image 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 |
20 |
21 | 抱歉,当前已开启白名单模式,上传的图片需要审核通过后才能展示,请等待审核通过后再进行访问。 22 |
23 | Sorry, the whitelist mode is currently enabled, the uploaded images need to be audited before they can be displayed, please wait for the audit to be passed before visiting. 24 |
25 |
26 |
Powered By: Telegraph-Image
29 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /_nuxt/318bf53201c4127c79fc.js: -------------------------------------------------------------------------------- 1 | !function(e){function r(data){for(var r,n,l=data[0],f=data[1],d=data[2],i=0,h=[];i character.charCodeAt(0)); 23 | const decoded = new TextDecoder().decode(buffer).normalize(); 24 | 25 | // The username & password are split by the first colon. 26 | //=> example: "username:password" 27 | const index = decoded.indexOf(':'); 28 | 29 | // The user & password are split by the first colon and MUST NOT contain control characters. 30 | // @see https://tools.ietf.org/html/rfc5234#appendix-B.1 (=> "CTL = %x00-1F / %x7F") 31 | if (index === -1 || /[\0-\x1F\x7F]/.test(decoded)) { 32 | throw new BadRequestException('Invalid authorization value.'); 33 | } 34 | 35 | return { 36 | user: decoded.substring(0, index), 37 | pass: decoded.substring(index + 1), 38 | }; 39 | } 40 | 41 | function UnauthorizedException(reason) { 42 | return new Response(reason, { 43 | status: 401, 44 | statusText: 'Unauthorized', 45 | headers: { 46 | 'Content-Type': 'text/plain;charset=UTF-8', 47 | // Disables caching by default. 48 | 'Cache-Control': 'no-store', 49 | // Returns the "Content-Length" header for HTTP HEAD requests. 50 | 'Content-Length': reason.length, 51 | }, 52 | }); 53 | } 54 | 55 | function BadRequestException(reason) { 56 | return new Response(reason, { 57 | status: 400, 58 | statusText: 'Bad Request', 59 | headers: { 60 | 'Content-Type': 'text/plain;charset=UTF-8', 61 | // Disables caching by default. 62 | 'Cache-Control': 'no-store', 63 | // Returns the "Content-Length" header for HTTP HEAD requests. 64 | 'Content-Length': reason.length, 65 | }, 66 | }); 67 | } 68 | 69 | 70 | function authentication(context) { 71 | //context.env.BASIC_USER="admin" 72 | //context.env.BASIC_PASS="admin" 73 | //check if the env variables Disable_Dashboard are set 74 | if (typeof context.env.img_url == "undefined" || context.env.img_url == null || context.env.img_url == "") { 75 | return new Response('Dashboard is disabled. Please bind a KV namespace to use this feature.', { status: 200 }); 76 | } 77 | 78 | console.log(context.env.BASIC_USER) 79 | if(typeof context.env.BASIC_USER == "undefined" || context.env.BASIC_USER == null || context.env.BASIC_USER == ""){ 80 | return context.next(); 81 | }else{ 82 | if (context.request.headers.has('Authorization')) { 83 | // Throws exception when authorization fails. 84 | const { user, pass } = basicAuthentication(context.request); 85 | 86 | 87 | if (context.env.BASIC_USER !== user || context.env.BASIC_PASS !== pass) { 88 | return UnauthorizedException('Invalid credentials.'); 89 | }else{ 90 | return context.next(); 91 | } 92 | 93 | } else { 94 | return new Response('You need to login.', { 95 | status: 401, 96 | headers: { 97 | // Prompts the user for credentials. 98 | 'WWW-Authenticate': 'Basic realm="my scope", charset="UTF-8"', 99 | }, 100 | }); 101 | } 102 | } 103 | 104 | } 105 | 106 | export const onRequest = [errorHandling, authentication]; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Telegraph-Image 2 | 免费图片托管解决方案,Flickr/imgur替代品。使用Cloudflare Pages和Telegraph。 3 | 4 | [English](README-EN.md)|中文 5 | 6 | ## 如何部署 7 | 8 | ### 提前准备 9 | 你唯一需要提前准备的就是一个Cloudflare账户 (如果需要在自己的服务器上部署,不依赖Cloudflare,可参考[#46](https://github.com/cf-pages/Telegraph-Image/issues/46) ) 10 | 11 | ### 手把手教程 12 | 简单3步,即可部署本项目,拥有自己的图床 13 | 14 | 1.下载或Fork本仓库 (注意:目前请使用fork,在使用下载[#14](https://github.com/cf-pages/Telegraph-Image/issues/14)部署存在问题) 15 | 16 | 2.打开Cloudflare Dashboard,进入Pages管理页面,选择创建项目,如果在第一步中选择的是fork本仓库,则选择`连接到 Git 提供程序`,如果第一步中选择的是下载本仓库则选择`直接上传` 17 | ![1](https://telegraph-image.pages.dev/file/8d4ef9b7761a25821d9c2.png) 18 | 19 | 3. 按照页面提示输入项目名称,选择需要连接的git仓库(第一步选择的是fork)或是上传刚刚下载的仓库文件(第一步选择的是下载本仓库),点击`部署站点`即可完成部署 20 | 21 | ## 特性 22 | 1.无限图片储存数量,你可以上传不限数量的图片 23 | 24 | 2.无需购买服务器,托管于Cloudflare的网络上,当使用量不超过Cloudflare的免费额度时,完全免费 25 | 26 | 3.无需购买域名,可以使用Cloudflare Pages提供的`*.pages.dev`的免费二级域名,同时也支持绑定自定义域名 27 | 28 | 4.支持图片审查API,可根据需要开启,开启后不良图片将自动屏蔽,不再加载 29 | 30 | 5.支持后台图片管理,可以对上传的图片进行在线预览,添加白名单,黑名单等操作 31 | 32 | ### 绑定自定义域名 33 | 在pages的自定义域里面,绑定cloudflare中存在的域名,在cloudflare托管的域名,自动会修改dns记录 34 | ![2](https://telegraph-image.pages.dev/file/29546e3a7465a01281ee2.png) 35 | 36 | ### 开启图片审查 37 | 1.请前往https://moderatecontent.com/ 注册并获得一个免费的用于审查图像内容的API key 38 | 39 | 2.打开Cloudflare Pages的管理页面,依次点击`设置`,`环境变量`,`添加环境变量` 40 | 41 | 3.添加一个`变量名称`为`ModerateContentApiKey`,`值`为你刚刚第一步获得的`API key`,点击`保存`即可 42 | 43 | 注意:由于所做的更改将在下次部署时生效,你或许还需要进入`部署`页面,重新部署一下该本项目 44 | 45 | 开启图片审查后,因为审查需要时间,首次的图片加载将会变得缓慢,之后的图片加载由于存在缓存,并不会受到影响 46 | ![3](https://telegraph-image.pages.dev/file/bae511fb116b034ef9c14.png) 47 | 48 | ### 限制 49 | 1.由于图片文件实际存储于Telegraph,Telegraph限制上传的图片大小最大为5MB 50 | 51 | 2.由于使用Cloudflare的网络,图片的加载速度在某些地区可能得不到保证 52 | 53 | 3.Cloudflare Function免费版每日限制100,000个请求(即上传或是加载图片的总次数不能超过100,000次)如超过可能需要选择购买Cloudflare Function的付费套餐,如开启图片管理功能还会存在KV操作数量的限制,如超过需购买付费套餐 54 | 55 | ### 感谢 56 | Hostloc @feixiang和@乌拉擦 提供的思路和代码 57 | 58 | ## 更新日志 59 | 2023年1月18日--图片管理功能更新 60 | 61 | 1、支持图片管理功能,默认是关闭的,如需开启请部署完成后前往后台依次点击`设置`->`函数`->`KV 命名空间绑定`->`编辑绑定`->`变量名称`填写:`img_url` `KV 命名空间` 选择你提前创建好的KV储存空间,开启后访问http(s)://你的域名/admin 即可打开后台管理页面 62 | | 变量名称 | KV 命名空间 | 63 | | ----------- | ----------- | 64 | | img_url | 选择提前创建好的KV储存空间 | 65 | 66 | ![](https://im.gurl.eu.org/file/a0c212d5dfb61f3652d07.png) 67 | ![](https://im.gurl.eu.org/file/48b9316ed018b2cb67cf4.png) 68 | 69 | 2、后台管理页面新增登录验证功能,默认也是关闭的,如需开启请部署完成后前往后台依次点击`设置`->`环境变量`->`为生产环境定义变量`->`编辑变量` 添加如下表格所示的变量即可开启登录验证 70 | | 变量名称 | 值 | 71 | | ----------- | ----------- | 72 | |BASIC_USER = | <后台管理页面登录用户名称>| 73 | |BASIC_PASS = | <后台管理页面登录用户密码>| 74 | 75 | ![](https://im.gurl.eu.org/file/dff376498ac87cdb78071.png) 76 | 77 | 当然你也可以不设置这两个值,这样访问后台管理页面时将无需验证,直接跳过登录步骤,这一设计使得你可以结合Cloudflare Access进行使用,实现支持邮件验证码登录,Microsoft账户登录,Github账户登录等功能,能够与你域名上原有的登录方式所集成,无需再次记忆多一组后台的账号密码,添加Cloudflare Access的方式请参考官方文档,注意需要保护路径包括/admin 以及 /api/manage/* 78 | 79 | 3、新增图片总数量统计 80 | 当开启图片管理功能后,可在后台顶部查看记录中的图片数量 81 | 82 | ![](https://im.gurl.eu.org/file/b7a37c08dc2c504199824.png) 83 | 84 | 4、新增图片文件名搜索 85 | 当开启图片管理功能后,可在后台搜索框使用图片文件名称,快速搜索定位需要管理的图片 86 | 87 | ![](https://im.gurl.eu.org/file/faf6d59a7d4a48a555491.png) 88 | 89 | 5、新增图片状态显示 90 | 当开启图片管理功能后,可在后台查看图片当前的状态{ "ListType": "None", "TimeStamp": 1673984678274 } 91 | ListType代表图片当前是否在黑白名单当中,None则表示既不在黑名单中也不在白名单中,White表示在在白名单中,Block表示在黑名单中,TimeStamp为图片首次加载的时间戳,如开启的图片审查API,则这里还会显示图片审查的结果用Label标识 92 | 93 | ![](https://im.gurl.eu.org/file/6aab78b83bbd8c249ee29.png) 94 | 95 | 6、新增黑名单功能 96 | 当开启图片管理功能后,可在后台手动为图片加入黑名单,加入黑名单的图片将无法正常加载 97 | 98 | ![](https://im.gurl.eu.org/file/fb18ef006a23677a52dfe.png) 99 | 100 | 7、新增白名单功能 101 | 当开启图片管理功能后,可在后台手动为图片加入白名单,加入白名单的图片无论如何都会正常加载,可绕过图片审查API的结果 102 | 103 | ![](https://im.gurl.eu.org/file/2193409107d4f2bcd00ee.png) 104 | 105 | 8、新增记录删除功能 106 | 当开启图片管理功能后,可在后台手动删除图片记录,即不再后台显示该图片,除非有人再次上传并加载该图片,注意由于图片储存在telegraph的服务器上,我们无法删除上传的原始图片,只能通过上述第6点的黑名单功能屏蔽图片的加载 107 | 108 | 9、新增程序运行模式:白名单模式 109 | 当开启图片管理功能后,除了默认模式外,这次更新还新增了一项新的运行模式,在该模式下,只有被添加进白名单的图片才会被加载,上传的图片需要审核通过后才能展示,最大程度的防止不良图片的加载,如需开启请设置环境变量:WhiteList_Mode=="true" 110 | 111 | 10、新增后台图片预览功能 112 | 当开启图片管理功能后,可在后台预览通过你的域名加载过的图片,点击图片可以进行放大,缩小,旋转等操作 113 | 114 | ![](https://im.gurl.eu.org/file/740cd5a69672de36133a2.png) 115 | 116 | ## 已经部署了的,如何更新? 117 | 其实更新非常简单,只需要参照上面的更新内容,先进入到Cloudflare Pages后台,把需要使用的环境变量提前设置好并绑定上KV命名空间,然后去到Github你之前fork过的仓库依次选择`Sync fork`->`Update branch`即可,稍等一会,Cloudflare Pages那边检测到你的仓库更新了之后就会自动部署最新的代码了 118 | 119 | ## 一些限制: 120 | Cloudflare KV每天只有1000次的免费写入额度,每有一张新的图片加载都会占用该写入额度,如果超过该额度,图片管理后台将无法记录新加载的图片 121 | 122 | 每天最多 100,000 次免费读取操作,图片每加载一次都会占用该额度(在没有缓存的情况下,如果你的域名在Cloudflare开启了缓存,当缓存未命中时才会占用该额度),超过黑白名单等功能可能会失效 123 | 124 | 每天最多 1,000 次免费删除操作,每有一条图片记录都会占用该额度,超过将无法删除图片记录 125 | 126 | 每天最多 1,000 次免费列出操作,每打开或刷新一次后台/admin都会占用该额度,超过将进行后台图片管理 127 | 128 | 绝大多数情况下,该免费额度都基本够用,并且可以稍微超出一点,不是已超出就立马停用,且每项额度单独计算,某项操作超出免费额度后只会停用该项操作,不影响其他的功能,即即便我的免费写入额度用完了,我的读写功能不受影响,图片能够正常加载,只是不能在图片管理后台看到新的图片了。 129 | 130 | 如果你的免费额度不够用,可以自行向Cloudflare购买Cloudflare Workers的付费版本,每月$5起步,按量收费,没有上述额度限制 131 | 132 | 另外针对环境变量所做的更改将在下次部署时生效,如更改了`环境变量`,针对某项功能进行了开启或关闭,请记得重新部署。 133 | 134 | ![](https://im.gurl.eu.org/file/b514467a4b3be0567a76f.png) 135 | 136 | ### Sponsorship 137 | This project is tested with BrowserStack. 138 | 139 | This project is support by [Cloudflare](https://www.cloudflare.com/). 140 | -------------------------------------------------------------------------------- /functions/file/[id].js: -------------------------------------------------------------------------------- 1 | export async function onRequest(context) { // Contents of context object 2 | const { 3 | request, // same as existing Worker API 4 | env, // same as existing Worker API 5 | params, // if filename includes [id] or [[path]] 6 | waitUntil, // same as ctx.waitUntil in existing Worker API 7 | next, // used for middleware or to fetch assets 8 | data, // arbitrary space for passing data between middlewares 9 | } = context; 10 | context.request 11 | const url = new URL(request.url); 12 | 13 | const response = fetch('https://telegra.ph/' + url.pathname + url.search, { 14 | method: request.method, 15 | headers: request.headers, 16 | body: request.body, 17 | }).then(async (response) => { 18 | console.log(response.ok); // true if the response status is 2xx 19 | console.log(response.status); // 200 20 | if(response.ok){ 21 | // Referer header equal to the admin page 22 | console.log(url.origin+"/admin") 23 | if (request.headers.get('Referer') == url.origin+"/admin") { 24 | //show the image 25 | return response; 26 | } 27 | 28 | if (typeof env.img_url == "undefined" || env.img_url == null || env.img_url == ""){}else{ 29 | //check the record from kv 30 | const record = await env.img_url.getWithMetadata(params.id); 31 | console.log("record") 32 | console.log(record) 33 | if (record.metadata === null) { 34 | 35 | }else{ 36 | 37 | //if the record is not null, redirect to the image 38 | if (record.metadata.ListType=="White"){ 39 | return response; 40 | }else if (record.metadata.ListType=="Block"){ 41 | console.log("Referer") 42 | console.log(request.headers.get('Referer')) 43 | if(typeof request.headers.get('Referer') == "undefined" ||request.headers.get('Referer') == null || request.headers.get('Referer') == ""){ 44 | return Response.redirect(url.origin+"/block-img.html", 302) 45 | }else{ 46 | return Response.redirect("https://static-res.pages.dev/teleimage/img-block-compressed.png", 302) 47 | } 48 | 49 | }else if (record.metadata.Label=="adult"){ 50 | if(typeof request.headers.get('Referer') == "undefined" ||request.headers.get('Referer') == null || request.headers.get('Referer') == ""){ 51 | return Response.redirect(url.origin+"/block-img.html", 302) 52 | }else{ 53 | return Response.redirect("https://static-res.pages.dev/teleimage/img-block-compressed.png", 302) 54 | } 55 | } 56 | //check if the env variables WhiteList_Mode are set 57 | console.log("env.WhiteList_Mode:",env.WhiteList_Mode) 58 | if (env.WhiteList_Mode=="true"){ 59 | //if the env variables WhiteList_Mode are set, redirect to the image 60 | return Response.redirect(url.origin+"/whitelist-on.html", 302); 61 | }else{ 62 | //if the env variables WhiteList_Mode are not set, redirect to the image 63 | return response; 64 | } 65 | } 66 | 67 | } 68 | 69 | //get time 70 | let time = new Date().getTime(); 71 | 72 | let apikey=env.ModerateContentApiKey 73 | 74 | if(typeof apikey == "undefined" || apikey == null || apikey == ""){ 75 | 76 | if (typeof env.img_url == "undefined" || env.img_url == null || env.img_url == ""){ 77 | console.log("Not enbaled KV") 78 | 79 | }else{ 80 | //add image to kv 81 | await env.img_url.put(params.id, "",{ 82 | metadata: { ListType: "None", Label: "None",TimeStamp: time }, 83 | }); 84 | 85 | } 86 | }else{ 87 | await fetch(`https://api.moderatecontent.com/moderate/?key=`+apikey+`&url=https://telegra.ph/` + url.pathname + url.search). 88 | then(async (response) => { 89 | let moderate_data = await response.json(); 90 | console.log(moderate_data) 91 | console.log("---env.img_url---") 92 | console.log(env.img_url=="true") 93 | if (typeof env.img_url == "undefined" || env.img_url == null || env.img_url == ""){}else{ 94 | //add image to kv 95 | await env.img_url.put(params.id, "",{ 96 | metadata: { ListType: "None", Label: moderate_data.rating_label,TimeStamp: time }, 97 | }); 98 | } 99 | if (moderate_data.rating_label=="adult"){ 100 | return Response.redirect(url.origin+"/block-img.html", 302) 101 | }}); 102 | 103 | } 104 | } 105 | return response; 106 | }); 107 | 108 | return response; 109 | 110 | } 111 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. 122 | -------------------------------------------------------------------------------- /bg.svg: -------------------------------------------------------------------------------- 1 | { } -------------------------------------------------------------------------------- /admin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 |
Dashboard 18 | 19 | 20 | 退出登录
27 |
28 | 29 | 30 | 31 | 记录总数量: 32 | {{ Number }} 33 | 34 | 35 | 51 | 52 | 116 | 117 |
118 |
119 | 120 | 121 | 122 | 123 | 124 | 267 | 277 | 284 | 285 | -------------------------------------------------------------------------------- /_nuxt/a84b71f5040faa8705cb.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[2],{316:function(t,n,r){for(var e,o=r(3),f=r(17),c=r(45),l=c("typed_array"),h=c("view"),v=!(!o.ArrayBuffer||!o.DataView),y=v,i=0,w="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");i<9;)(e=o[w[i++]])?(f(e.prototype,l,!0),f(e.prototype,h,!0)):y=!1;t.exports={ABV:v,CONSTR:y,TYPED:l,VIEW:h}},317:function(t,n,r){var e=r(43),o=r(27);t.exports=function(t){if(void 0===t)return 0;var n=e(t),r=o(n);if(n!==r)throw RangeError("Wrong length!");return r}},318:function(t,n,r){"use strict";var e=r(42),o=r(178),f=r(27);t.exports=function(t){for(var n=e(this),r=f(n.length),c=arguments.length,l=o(c>1?arguments[1]:void 0,r),h=c>2?arguments[2]:void 0,v=void 0===h?r:o(h,r);v>l;)n[l++]=t;return n}},325:function(t,n,r){r(326)("Uint8",1,(function(t){return function(data,n,r){return t(this,data,n,r)}}))},326:function(t,n,r){"use strict";if(r(7)){var e=r(44),o=r(3),f=r(12),c=r(8),l=r(316),h=r(327),v=r(46),y=r(179),w=r(47),d=r(17),A=r(180),E=r(43),_=r(27),S=r(317),I=r(178),B=r(83),L=r(21),x=r(58),W=r(11),F=r(42),T=r(184),U=r(120),m=r(181),P=r(56).f,V=r(185),N=r(45),O=r(2),R=r(328),D=r(122),M=r(85),Y=r(123),k=r(48),C=r(186),j=r(124),J=r(318),G=r(331),z=r(10),H=r(84),K=z.f,Q=H.f,X=o.RangeError,Z=o.TypeError,$=o.Uint8Array,tt=Array.prototype,nt=h.ArrayBuffer,et=h.DataView,it=R(0),ot=R(2),ut=R(3),ft=R(4),ct=R(5),at=R(6),st=D(!0),lt=D(!1),ht=Y.values,gt=Y.keys,vt=Y.entries,yt=tt.lastIndexOf,pt=tt.reduce,wt=tt.reduceRight,bt=tt.join,At=tt.sort,Et=tt.slice,_t=tt.toString,St=tt.toLocaleString,It=O("iterator"),Bt=O("toStringTag"),Lt=N("typed_constructor"),xt=N("def_constructor"),Wt=l.CONSTR,Ft=l.TYPED,Tt=l.VIEW,Ut=R(1,(function(t,n){return Ot(M(t,t[xt]),n)})),mt=f((function(){return 1===new $(new Uint16Array([1]).buffer)[0]})),Pt=!!$&&!!$.prototype.set&&f((function(){new $(1).set({})})),Vt=function(t,n){var r=E(t);if(r<0||r%n)throw X("Wrong offset!");return r},Nt=function(t){if(W(t)&&Ft in t)return t;throw Z(t+" is not a typed array!")},Ot=function(t,n){if(!(W(t)&&Lt in t))throw Z("It is not a typed array constructor!");return new t(n)},Rt=function(t,n){return Dt(M(t,t[xt]),n)},Dt=function(t,n){for(var r=0,e=n.length,o=Ot(t,e);e>r;)o[r]=n[r++];return o},Mt=function(t,n,r){K(t,n,{get:function(){return this._d[r]}})},Yt=function(source){var i,t,n,r,e,o,f=F(source),c=arguments.length,l=c>1?arguments[1]:void 0,h=void 0!==l,y=V(f);if(null!=y&&!T(y)){for(o=y.call(f),n=[],i=0;!(e=o.next()).done;i++)n.push(e.value);f=n}for(h&&c>2&&(l=v(l,arguments[2],2)),i=0,t=_(f.length),r=Ot(this,t);t>i;i++)r[i]=h?l(f[i],i):f[i];return r},kt=function(){for(var t=0,n=arguments.length,r=Ot(this,n);n>t;)r[t]=arguments[t++];return r},Ct=!!$&&f((function(){St.call(new $(1))})),jt=function(){return St.apply(Ct?Et.call(Nt(this)):Nt(this),arguments)},Jt={copyWithin:function(t,n){return G.call(Nt(this),t,n,arguments.length>2?arguments[2]:void 0)},every:function(t){return ft(Nt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return J.apply(Nt(this),arguments)},filter:function(t){return Rt(this,ot(Nt(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return ct(Nt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return at(Nt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){it(Nt(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return lt(Nt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return st(Nt(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return bt.apply(Nt(this),arguments)},lastIndexOf:function(t){return yt.apply(Nt(this),arguments)},map:function(t){return Ut(Nt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return pt.apply(Nt(this),arguments)},reduceRight:function(t){return wt.apply(Nt(this),arguments)},reverse:function(){for(var t,n=Nt(this).length,r=Math.floor(n/2),e=0;e1?arguments[1]:void 0)},sort:function(t){return At.call(Nt(this),t)},subarray:function(t,n){var r=Nt(this),e=r.length,o=I(t,e);return new(M(r,r[xt]))(r.buffer,r.byteOffset+o*r.BYTES_PER_ELEMENT,_((void 0===n?e:I(n,e))-o))}},Gt=function(t,n){return Rt(this,Et.call(Nt(this),t,n))},qt=function(t){Nt(this);var n=Vt(arguments[1],1),r=this.length,e=F(t),o=_(e.length),f=0;if(o+n>r)throw X("Wrong length!");for(;f255?255:255&e),data.v[A](r*n+data.o,e,mt)}(this,r,t)},enumerable:!0})};L?(E=r((function(t,data,r,e){y(t,E,v,"_d");var o,f,c,l,h=0,w=0;if(W(data)){if(!(data instanceof nt||"ArrayBuffer"==(l=x(data))||"SharedArrayBuffer"==l))return Ft in data?Dt(E,data):Yt.call(E,data);o=data,w=Vt(r,n);var A=data.byteLength;if(void 0===e){if(A%n)throw X("Wrong length!");if((f=A-w)<0)throw X("Wrong length!")}else if((f=_(e)*n)+w>A)throw X("Wrong length!");c=f/n}else c=S(data),o=new nt(f=c*n);for(d(t,"_d",{b:o,o:w,l:f,e:c,v:new et(o)});h>1,rt=23===n?V(2,-24)-V(2,-77):0,i=0,s=t<0||0===t&&1/t<0?1:0;for((t=P(t))!=t||t===U?(o=t!=t?1:0,e=h):(e=N(O(t)/R),t*(f=V(2,-e))<1&&(e--,f*=2),(t+=e+v>=1?rt/f:rt*V(2,1-v))*f>=2&&(e++,f/=2),e+v>=h?(o=0,e=h):e+v>=1?(o=(t*f-1)*V(2,n),e+=v):(o=t*V(2,v-1)*V(2,n),e=0));n>=8;c[i++]=255&o,o/=256,n-=8);for(e=e<0;c[i++]=255&e,e/=256,l-=8);return c[--i]|=128*s,c}function C(t,n,r){var e,o=8*r-n-1,f=(1<>1,l=o-7,i=r-1,s=t[i--],h=127&s;for(s>>=7;l>0;h=256*h+t[i],i--,l-=8);for(e=h&(1<<-l)-1,h>>=-l,l+=n;l>0;e=256*e+t[i],i--,l-=8);if(0===h)h=1-c;else{if(h===f)return e?NaN:s?-U:U;e+=V(2,n),h-=c}return(s?-1:1)*e*V(2,h-n)}function j(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function J(t){return[255&t]}function G(t){return[255&t,t>>8&255]}function z(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function H(t){return k(t,52,8)}function K(t){return k(t,23,4)}function Q(t,n,r){_(t[B],n,{get:function(){return this[r]}})}function X(view,t,n,r){var e=A(+n);if(e+t>view[M])throw T(L);var o=view[D]._b,f=e+view[Y],c=o.slice(f,f+t);return r?c:c.reverse()}function Z(view,t,n,r,e,o){var f=A(+n);if(f+t>view[M])throw T(L);for(var c=view[D]._b,l=f+view[Y],h=r(+e),i=0;iet;)($=nt[et++])in x||l(x,$,m[$]);f||(tt.constructor=x)}var view=new W(new x(2)),it=W[B].setInt8;view.setInt8(0,2147483648),view.setInt8(1,2147483649),!view.getInt8(0)&&view.getInt8(1)||h(W[B],{setInt8:function(t,n){it.call(this,t,n<<24>>24)},setUint8:function(t,n){it.call(this,t,n<<24>>24)}},!0)}else x=function(t){y(this,x,"ArrayBuffer");var n=A(t);this._b=S.call(new Array(n),0),this[M]=n},W=function(t,n,r){y(this,W,"DataView"),y(t,x,"DataView");var e=t[M],o=w(n);if(o<0||o>e)throw T("Wrong offset!");if(o+(r=void 0===r?e-o:d(r))>e)throw T("Wrong length!");this[D]=t,this[Y]=o,this[M]=r},o&&(Q(x,"byteLength","_l"),Q(W,"buffer","_b"),Q(W,"byteLength","_l"),Q(W,"byteOffset","_o")),h(W[B],{getInt8:function(t){return X(this,1,t)[0]<<24>>24},getUint8:function(t){return X(this,1,t)[0]},getInt16:function(t){var n=X(this,2,t,arguments[1]);return(n[1]<<8|n[0])<<16>>16},getUint16:function(t){var n=X(this,2,t,arguments[1]);return n[1]<<8|n[0]},getInt32:function(t){return j(X(this,4,t,arguments[1]))},getUint32:function(t){return j(X(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return C(X(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return C(X(this,8,t,arguments[1]),52,8)},setInt8:function(t,n){Z(this,1,t,J,n)},setUint8:function(t,n){Z(this,1,t,J,n)},setInt16:function(t,n){Z(this,2,t,G,n,arguments[2])},setUint16:function(t,n){Z(this,2,t,G,n,arguments[2])},setInt32:function(t,n){Z(this,4,t,z,n,arguments[2])},setUint32:function(t,n){Z(this,4,t,z,n,arguments[2])},setFloat32:function(t,n){Z(this,4,t,K,n,arguments[2])},setFloat64:function(t,n){Z(this,8,t,H,n,arguments[2])}});I(x,"ArrayBuffer"),I(W,"DataView"),l(W[B],c.VIEW,!0),n.ArrayBuffer=x,n.DataView=W},328:function(t,n,r){var e=r(46),o=r(121),f=r(42),c=r(27),l=r(329);t.exports=function(t,n){var r=1==t,h=2==t,v=3==t,y=4==t,w=6==t,d=5==t||w,A=n||l;return function(n,l,E){for(var _,S,I=f(n),B=o(I),L=e(l,E,3),x=c(B.length),W=0,F=r?A(n,x):h?A(n,0):void 0;x>W;W++)if((d||W in B)&&(S=L(_=B[W],W,I),t))if(r)F[W]=S;else if(S)switch(t){case 3:return!0;case 5:return _;case 6:return W;case 2:F.push(_)}else if(y)return!1;return w?-1:v||y?y:F}}},329:function(t,n,r){var e=r(330);t.exports=function(t,n){return new(e(t))(n)}},330:function(t,n,r){var e=r(11),o=r(182),f=r(2)("species");t.exports=function(t){var n;return o(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!o(n.prototype)||(n=void 0),e(n)&&null===(n=n[f])&&(n=void 0)),void 0===n?Array:n}},331:function(t,n,r){"use strict";var e=r(42),o=r(178),f=r(27);t.exports=[].copyWithin||function(t,n){var r=e(this),c=f(r.length),l=o(t,c),h=o(n,c),v=arguments.length>2?arguments[2]:void 0,y=Math.min((void 0===v?c:o(v,c))-h,c-l),w=1;for(h0;)h in r?r[l]=r[h]:delete r[l],l+=w,h+=w;return r}}}]); -------------------------------------------------------------------------------- /_nuxt/b46e75617207ae5013d0.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[4],{311:function(t,e,o){var content=o(320);"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,o(41).default)("9e96ac5e",content,!0,{sourceMap:!1})},312:function(t,e,o){var content=o(322);"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,o(41).default)("3c22903d",content,!0,{sourceMap:!1})},313:function(t,e,o){var content=o(324);"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,o(41).default)("483543ae",content,!0,{sourceMap:!1})},314:function(t,e,o){var content=o(333);"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,o(41).default)("5d65cc87",content,!0,{sourceMap:!1})},315:function(t,e,o){var content=o(335);"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,o(41).default)("15da84d3",content,!0,{sourceMap:!1})},319:function(t,e,o){"use strict";var n=o(311);o.n(n).a},320:function(t,e,o){(e=o(40)(!1)).push([t.i,".background-container[data-v-045ae8ab]{background-color:linear-gradient(240deg,rgba(150,50,50,.3),rgba(0,0,200,0));z-index:-1}#background-slider figure[data-v-045ae8ab],.background-container[data-v-045ae8ab]{position:absolute;width:100%;height:100%;top:0;left:0;background-size:cover;background-position:50%;background-repeat:no-repeat;margin:0}#background-slider figure[data-v-045ae8ab]{color:transparent;opacity:0;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-animation:imageAnimation-data-v-045ae8ab 30s linear -.5s infinite;animation:imageAnimation-data-v-045ae8ab 30s linear -.5s infinite}@-webkit-keyframes imageAnimation-data-v-045ae8ab{0%{opacity:0;-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}3%{opacity:1;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}20%{opacity:1}28%{opacity:0}to{opacity:0}}",""]),t.exports=e},321:function(t,e,o){"use strict";var n=o(312);o.n(n).a},322:function(t,e,o){(e=o(40)(!1)).push([t.i,".header[data-v-c757ee00]{color:#fff;display:-webkit-box;display:flex;-webkit-box-pack:end;justify-content:flex-end}.header .icon[data-v-c757ee00]{cursor:pointer;width:28px;height:28px;fill:#fff}.header .icon[data-v-c757ee00]:hover{opacity:.7}",""]),t.exports=e},323:function(t,e,o){"use strict";var n=o(313);o.n(n).a},324:function(t,e,o){(e=o(40)(!1)).push([t.i,".footer[data-v-5d5649c4]{font-size:12px;color:#fff}.footer a[data-v-5d5649c4]{color:#fff;text-decoration:none;font-weight:700}.footer a[data-v-5d5649c4]:hover{opacity:.7}",""]),t.exports=e},332:function(t,e,o){"use strict";var n=o(314);o.n(n).a},333:function(t,e,o){(e=o(40)(!1)).push([t.i,'[data-v-793b8fc8]::-webkit-scrollbar{display:none}[data-tooltip][data-v-793b8fc8]{position:relative}[data-tooltip][data-v-793b8fc8]:after,[data-tooltip][data-v-793b8fc8]:before{text-transform:none;font-size:1.3rem;font-family:Helvetica,sans-serif,微软雅黑;line-height:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;position:absolute;display:none;left:50%;-webkit-transform:translate(-50%,.5rem);transform:translate(-50%,.5rem)}[data-tooltip][data-v-793b8fc8]:before{content:" ";top:100%;border-color:transparent transparent #333;border-style:solid;border-width:0 1rem 1rem}[data-tooltip][data-v-793b8fc8]:after{content:attr(data-tooltip);text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:.6rem 1rem;border-radius:.3rem;box-shadow:0 1em 2em -.5em rgba(0,0,0,.35);background:#333;color:#fff;z-index:1000;top:calc(100% + 5px)}[data-tooltip][data-v-793b8fc8]:hover:after,[data-tooltip][data-v-793b8fc8]:hover:before{display:block}[data-tooltip][data-v-793b8fc8]:after,[data-tooltip][data-v-793b8fc8]:before{display:none!important}.flex[data-v-793b8fc8]{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center}.upload-main[data-v-793b8fc8]{width:314px;height:370px}.upload-main[data-v-793b8fc8],.wrapper[data-v-793b8fc8]{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center}.wrapper[data-v-793b8fc8]{height:100%;max-width:314px;height:370px;background:#fff url(/bg.svg);background-size:110%;background-repeat:no-repeat;background-position:top;border-radius:3px;box-shadow:0 0 32px 0 rgba(12,12,13,.1),0 2px 16px 0 rgba(12,12,13,.05);color:#5e6878;font-size:14px}.area[data-v-793b8fc8],.wrapper[data-v-793b8fc8]{width:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}.area[data-v-793b8fc8]{height:100%;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center}.svg-wrapper[data-v-793b8fc8]{width:80px;height:80px;border-radius:50%;position:relative;border:4px solid #c7cfd7}.svg-wrapper.dragover[data-v-793b8fc8]{border-color:#0297f8}.svg-wrapper[data-v-793b8fc8]:before{content:" ";position:absolute;width:calc(100% + 2px);height:calc(100% + 2px);top:-1px;left:-1px;border-radius:50%}.svg-wrapper .svg-box[data-v-793b8fc8]{position:absolute;width:60px;height:60px;padding:10px;overflow:hidden;border-radius:50%}.svg-wrapper .svg-box svg.upload-icon[data-v-793b8fc8]{width:100%;height:100%}.waitting .svg-wrapper[data-v-793b8fc8]:before{-webkit-animation:bo-data-v-793b8fc8 1.5s linear infinite;animation:bo-data-v-793b8fc8 1.5s linear infinite}.text-area[data-v-793b8fc8]{padding:50px 0 10px;font-size:12px}.upload-btn-area input[name=Files][data-v-793b8fc8]{display:none}.upload-btn-area .btn-upload[data-v-793b8fc8]{background-color:#0297f8;border-radius:40px;display:inline-block;color:#fff;font-weight:700;padding:8px 30px;cursor:pointer}.upload-btn-area .btn-upload[data-v-793b8fc8]:hover{opacity:.8;background-color:rgba(2,151,248,.85)}.url-box[data-v-793b8fc8]{height:43px;width:80%;margin-top:15px}.copy-url[data-v-793b8fc8]{padding-left:20px;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center}.copy-url .input-group[data-v-793b8fc8]{display:-webkit-box;display:flex;background-repeat:no-repeat;border:1px solid #d1d5da;border-radius:3px}.copy-url .input-group[data-v-793b8fc8],.copy-url .input-group .input-sm[data-v-793b8fc8]{-webkit-box-flex:1;flex:1;box-shadow:inset 0 1px 2px rgba(27,31,35,.075)}.copy-url .input-group .input-sm[data-v-793b8fc8]{outline:none;font-size:12px;line-height:20px;padding:3px 5px;border:none}.copy-url .input-group .input-group-button[data-v-793b8fc8]{padding:0 8px;background-color:#eff3f6;background-image:-webkit-gradient(linear,left top,left bottom,from(#fafbfc),color-stop(90%,#eff3f6));background-image:linear-gradient(-180deg,#fafbfc,#eff3f6 90%);color:#24292e;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;cursor:pointer;border-left:1px solid #d1d5da}.copy-url .input-group .input-group-button[data-v-793b8fc8]:hover{background-color:#e6ebf1;background-image:-webkit-gradient(linear,left top,left bottom,from(#f0f3f6),color-stop(90%,#e6ebf1));background-image:linear-gradient(-180deg,#f0f3f6,#e6ebf1 90%);background-position:-.5em;border-color:rgba(27,31,35,.35)}.copy-url .input-group .input-group-button[data-v-793b8fc8]:active{background-color:#e9ecef;background-image:none;border-color:rgba(27,31,35,.35);box-shadow:inset 0 .15em .3em rgba(27,31,35,.15)}.copy-url .re-upload[data-v-793b8fc8]{cursor:pointer;padding:0 5px;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center}.uploading svg.upload-icon[data-v-793b8fc8]{-webkit-animation:up-data-v-793b8fc8 1s linear infinite;animation:up-data-v-793b8fc8 1s linear infinite}.head[data-v-793b8fc8]{width:100%;padding:15px 20px;font-weight:bolder}.head .head-title[data-v-793b8fc8]{-webkit-box-flex:1;flex:1}.head .head-download[data-v-793b8fc8]{padding:0 20px;color:#0297f8;font-size:12px;cursor:pointer}.head .head-op[data-v-793b8fc8]{font-size:12px;color:red;font-weight:500;cursor:pointer}.pics[data-v-793b8fc8]{-webkit-box-flex:1;flex:1;width:calc(100% - 40px);overflow:hidden;overflow-y:auto}@-webkit-keyframes up-data-v-793b8fc8{0%{-webkit-transform:translateY(100%);transform:translateY(100%)}to{-webkit-transform:translateY(-100%);transform:translateY(-100%)}}@keyframes up-data-v-793b8fc8{0%{-webkit-transform:translateY(100%);transform:translateY(100%)}to{-webkit-transform:translateY(-100%);transform:translateY(-100%)}}@-webkit-keyframes bo-data-v-793b8fc8{0%{-webkit-transform:scale(1);transform:scale(1);border:1px solid #c7cfd7}to{-webkit-transform:scale(1.5);transform:scale(1.5);border:1px solid rgba(199,207,215,.1)}}@keyframes bo-data-v-793b8fc8{0%{-webkit-transform:scale(1);transform:scale(1);border:1px solid #c7cfd7}to{-webkit-transform:scale(1.5);transform:scale(1.5);border:1px solid rgba(199,207,215,.1)}}.alert-text[data-v-793b8fc8]{color:#1bc1a1;font-size:12px}',""]),t.exports=e},334:function(t,e,o){"use strict";var n=o(315);o.n(n).a},335:function(t,e,o){(e=o(40)(!1)).push([t.i,'@font-face{font-family:阿里妈妈数黑体 Bold;font-weight:700;src:url(//at.alicdn.com/wf/webfont/vyMYqE6AQ53l/QuXl5poIEmsBTN1RFuJ49.woff2) format("woff2"),url(//at.alicdn.com/wf/webfont/vyMYqE6AQ53l/TgFpb2VvlZLFg0EQ_RgjM.woff) format("woff");font-display:swap}.container[data-v-5e6831cc]{margin:0 auto;min-height:100vh;flex-direction:column;padding:30px;background:linear-gradient(240deg,rgba(150,50,50,.3),rgba(0,0,200,0))}.container[data-v-5e6831cc],.main[data-v-5e6831cc]{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal}.main[data-v-5e6831cc]{-webkit-box-flex:1;flex:1;flex-direction:column;padding:30px 0;-webkit-box-align:center;align-items:center}.main .title[data-v-5e6831cc]{font-family:阿里妈妈数黑体 Bold;color:#fff;font-size:24px;font-weight:bolder;padding:30px 0 10px}',""]),t.exports=e},336:function(t,e,o){"use strict";o.r(e);var n=o(53),r=o.n(n),c={data:function(){return{bgJson:[]}},mounted:function(){this.getBingHpImage()},methods:{getBingHpImage:function(){var t=this;r.a.post(location.origin+"/api/bing/wallpaper",{n:5}).then((function(e){e.data.data.map((function(e,o){t.bgJson.push({imgUrl:"https://cn.bing.com"+e.url,delay:6*o})}))}))}}},l=(o(319),o(28)),d=Object(l.a)(c,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"background-container"},[e("div",{attrs:{id:"background-slider"}},this._l(this.bgJson,(function(t,o){return e("figure",{key:o,style:{backgroundImage:"url("+t.imgUrl+")",animationDelay:t.delay+"s"}})})),0)])}),[],!1,null,"045ae8ab",null).exports,f=(o(321),Object(l.a)({},(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"header"},[e("svg",{attrs:{width:"22",height:"22",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[e("circle",{attrs:{cx:"24",cy:"24",r:"20",stroke:"#fff","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter"}}),this._v(" "),e("path",{attrs:{d:"M9 37L17 28L33 41",stroke:"#fff","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter"}}),this._v(" "),e("circle",{attrs:{cx:"18",cy:"17",r:"4",fill:"none",stroke:"#fff","stroke-width":"4"}}),this._v(" "),e("path",{attrs:{d:"M24 33L32 23L42 31",stroke:"#fff","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter"}})])])}),[],!1,null,"c757ee00",null).exports),v=(o(323),Object(l.a)({},(function(){var t=this.$createElement;this._self._c;return this._m(0)}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"footer"},[this._v("\n 基于 "),e("a",{attrs:{href:"https://telegra.ph",target:"_blank"}},[this._v("Telegraph")]),this._v(" 的图片上传工具\n")])}],!1,null,"5d5649c4",null).exports),h=(o(325),o(183),o(187),o(78)),m={data:function(){return{status:"waitting",imgUrl:"",defcloud:"",markdown:!1,uptoken:"",config:"",file:{},copyBtn:null,isCopy:!1}},computed:Object(h.a)({markdownUrl:function(){return"![](".concat(this.imgUrl,")")},showText:function(){return this.markdown?this.markdownUrl:this.imgUrl}},"showText",{get:function(){return this.markdown?this.markdownUrl:this.imgUrl},set:function(t){this.markdown=t}}),mounted:function(){var t=this;this.pasteUpload(),this.copyBtn=new this.clipboard(this.$refs.copy),this.copyBtn.on("success",(function(e){t.isCopy=!0,setTimeout((function(){t.isCopy=!1}),1500)}))},methods:{pasteUpload:function(){var t=this;document.addEventListener("paste",(function(e){if(e.clipboardData.items[0].type.indexOf("image")>-1){t.status="uploading";var o=new FileReader,n=e.clipboardData.items[0].getAsFile();o.onload=function(e){t.upload(t.dataURLtoFile(this.result))},o.readAsDataURL(n)}}))},dataURLtoFile:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"tmp.png",o=t.split(","),n=o[0].match(/:(.*?);/)[1],r=atob(o[1]),c=r.length,l=new Uint8Array(c);c--;)l[c]=r.charCodeAt(c);return new File([l],e,{type:n})},uploadInputchange:function(){var t=document.getElementById("upFiles").files[0];this.status="uploading",this.upload(t)},clearFilelist:function(){this.status="waitting",this.fileList={},document.getElementById("upFiles").value=""},focus:function(){this.$refs.copyTxt.select()},upload:function(t){var e=this,o=new FormData;o.append("file",t),r.a.post("/upload",o).then((function(t){200===t.status?(e.status="done",e.imgUrl=location.origin+t.data[0].src):e.showError()})).catch((function(){e.showError()}))},clear:function(){this.file={},document.getElementById("upFiles").value="",this.status="waitting"},showError:function(){var t=this;this.status="error",setTimeout((function(){t.clear()}),2e3)}}},w=(o(332),{head:{title:"Telegraph-Image|免费图床"},components:{Background:d,Header:f,Footer:v,Upload:Object(l.a)(m,(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"upload-main",attrs:{id:"paste"}},[o("div",{staticClass:"wrapper",class:t.status},[o("div",{directives:[{name:"show",rawName:"v-show",value:"waitting"==t.status,expression:"status == 'waitting'"}],staticClass:"area waitting"},[o("div",{staticClass:"svg-wrapper flex"},[o("div",{staticClass:"svg-box"},[o("svg",{staticClass:"upload-icon",attrs:{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"}},[o("path",{attrs:{d:"M422.4 704l-94.72-143.36c-15.36-23.04-46.08-30.72-71.68-15.36l-15.36 15.36-130.56 204.8c-12.8 25.6-7.68 56.32 17.92 71.68 7.68 5.12 17.92 7.68 25.6 7.68h256c28.16 0 51.2-23.04 51.2-51.2 0-7.68-2.56-15.36-5.12-23.04l-33.28-66.56z",fill:"#A5C8F4"}}),t._v(" "),o("path",{attrs:{d:"M307.2 358.4c-43.52 0-76.8-33.28-76.8-76.8s33.28-76.8 76.8-76.8 76.8 33.28 76.8 76.8-33.28 76.8-76.8 76.8z m327.68-33.28c5.12-7.68 12.8-15.36 20.48-17.92 25.6-12.8 56.32 0 69.12 23.04L944.64 793.6c2.56 7.68 5.12 15.36 5.12 23.04 0 28.16-23.04 51.2-51.2 51.2H378.88c-10.24 0-20.48-2.56-30.72-10.24-23.04-15.36-28.16-48.64-12.8-71.68l56.32-79.36 243.2-381.44z",fill:"#2589FF"}})])])]),t._v(" "),t._m(0),t._v(" "),o("div",{staticClass:"upload-btn-area"},[o("input",{attrs:{accept:"image/jpeg, image/png, image/gif, video/mp4",id:"upFiles",name:"Files",type:"file"},on:{change:t.uploadInputchange}}),t._v(" "),o("labeL",{staticClass:"btn-upload",attrs:{for:"upFiles"}},[t._v("选择上传图片或视频")])],1)]),t._v(" "),o("div",{directives:[{name:"show",rawName:"v-show",value:"uploading"==t.status,expression:"status == 'uploading'"}],staticClass:"area uploading"},[o("div",{staticClass:"svg-wrapper flex"},[o("div",{staticClass:"svg-box"},[o("svg",{staticClass:"upload-icon",attrs:{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"}},[o("path",{attrs:{d:"M554.666667 268.8v601.6h-85.333334V268.8L337.066667 401.066667 277.333333 341.333333 512 106.666667 746.666667 341.333333l-59.733334 59.733334L554.666667 268.8z",fill:"#0075ff"}})])])]),t._v(" "),t._m(1)]),t._v(" "),o("div",{directives:[{name:"show",rawName:"v-show",value:"done"==t.status,expression:"status == 'done'"}],staticClass:"area done"},[o("div",{staticClass:"svg-wrapper flex"},[o("div",{staticClass:"svg-box"},[o("svg",{staticClass:"upload-icon",attrs:{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"}},[o("path",{attrs:{d:"M392.533333 806.4L85.333333 503.466667l59.733334-59.733334 247.466666 247.466667L866.133333 213.333333l59.733334 59.733334L392.533333 806.4z",fill:"#0075ff"}})])])]),t._v(" "),o("div",{staticClass:"text-area"},[t.isCopy?o("span",{staticClass:"alert-text"},[t._v("已成功复制图片地址!")]):o("span",[t._v("复制下面的图片地址 或者 取消重新上传")])]),t._v(" "),o("div",{staticClass:"url-box"},[o("div",{directives:[{name:"show",rawName:"v-show",value:t.imgUrl,expression:"imgUrl"}],staticClass:"copy-url"},[o("div",{staticClass:"input-group"},[o("input",{directives:[{name:"model",rawName:"v-model",value:t.showText,expression:"showText"}],ref:"copyTxt",staticClass:"input-sm",attrs:{readonly:"",type:"text",id:"url-content"},domProps:{value:t.showText},on:{focus:t.focus,input:function(e){e.target.composing||(t.showText=e.target.value)}}}),t._v(" "),o("div",{ref:"copy",staticClass:"input-group-button",attrs:{"data-clipboard-target":"#url-content"}},[o("svg",{staticClass:"octicon octicon-clippy",attrs:{"aria-hidden":"true",height:"16",version:"1.1",viewBox:"0 0 14 16",width:"14"}},[o("path",{attrs:{d:"M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z","fill-rule":"evenodd"}})])])]),t._v(" "),o("div",{staticClass:"re-upload",on:{click:t.clear}},[o("svg",{attrs:{height:"26",viewBox:"0 0 1024 1024",width:"26",xmlns:"http://www.w3.org/2000/svg"}},[o("path",{attrs:{d:"M396.8 200.533333l64 64L384 341.333333h298.666667c119.466667 0 213.333333 93.866667 213.333333 213.333334s-93.866667 213.333333-213.333333 213.333333H298.666667v-85.333333h384c72.533333 0 128-55.466667 128-128s-55.466667-128-128-128H170.666667l226.133333-226.133334z",fill:"#d73a49","p-id":"7650"}})])])])])]),t._v(" "),o("div",{directives:[{name:"show",rawName:"v-show",value:"error"==t.status,expression:"status == 'error'"}],staticClass:"area error"},[o("div",{staticClass:"svg-wrapper flex"},[o("div",{staticClass:"svg-box"},[o("svg",{staticClass:"upload-icon",attrs:{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"}},[o("path",{attrs:{d:"M809.222867 150.531412 868.688213 210.004945 568.397986 510.292102 868.688213 810.587446 809.222867 870.055862 508.93264 569.771775 208.644459 870.055862 149.169903 810.587446 449.461153 510.292102 149.169903 210.004945 208.644459 150.531412 508.93264 450.823686Z",fill:"#d81e06"}})])])]),t._v(" "),t._m(2)])])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-area"},[e("span",[this._v("也可直接截图并粘贴到这里")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-area"},[e("span",[this._v("正在上传,请稍等…")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-area"},[e("span",[this._v("出错啦,请重新上传")])])}],!1,null,"793b8fc8",null).exports}}),x=(o(334),Object(l.a)(w,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"container"},[e("Background"),this._v(" "),e("Header"),this._v(" "),e("div",{staticClass:"main"},[e("div",{staticClass:"title"},[this._v("Telegraph-Image")]),this._v(" "),e("Upload")],1),this._v(" "),e("Footer")],1)}),[],!1,null,"5e6831cc",null));e.default=x.exports}}]); 2 | -------------------------------------------------------------------------------- /_nuxt/fbd198cfd0f4459e2725.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[0],{1:function(t,e,n){"use strict";n.d(e,"i",(function(){return m})),n.d(e,"j",(function(){return x})),n.d(e,"a",(function(){return v})),n.d(e,"o",(function(){return y})),n.d(e,"e",(function(){return w})),n.d(e,"f",(function(){return _})),n.d(e,"c",(function(){return k})),n.d(e,"n",(function(){return C})),n.d(e,"h",(function(){return O})),n.d(e,"p",(function(){return j})),n.d(e,"k",(function(){return R})),n.d(e,"m",(function(){return P})),n.d(e,"d",(function(){return T})),n.d(e,"b",(function(){return S})),n.d(e,"g",(function(){return N})),n.d(e,"l",(function(){return A}));n(140),n(49);var r=n(54),o=(n(187),n(211),n(212),n(38)),c=(n(141),n(142),n(215),n(218),n(143),n(63),n(5)),f=(n(86),n(33),n(19),n(94),n(95),n(78)),l=n(0);function h(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}function d(t){for(var i=1;i1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"components";return Array.prototype.concat.apply([],t.matched.map((function(t,r){return Object.keys(t[n]).map((function(o){return e&&e.push(r),t[n][o]}))})))}function _(t){return w(t,arguments.length>1&&void 0!==arguments[1]&&arguments[1],"instances")}function k(t,e){return Array.prototype.concat.apply([],t.matched.map((function(t,n){return Object.keys(t.components).reduce((function(r,o){return t.components[o]?r.push(e(t.components[o],t.instances[o],t,o,n)):delete t.components[o],r}),[])})))}function C(t,e){return Promise.all(k(t,function(){var t=Object(c.a)(regeneratorRuntime.mark((function t(n,r,o,c){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("function"!=typeof n||n.options){t.next=4;break}return t.next=3,n();case 3:n=t.sent;case 4:return o.components[c]=n=y(n),t.abrupt("return","function"==typeof e?e(n,r,o,c):n);case 6:case"end":return t.stop()}}),t)})));return function(e,n,r,o){return t.apply(this,arguments)}}()))}function O(t){return $.apply(this,arguments)}function $(){return($=Object(c.a)(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,C(e);case 4:return t.abrupt("return",d({},e,{meta:w(e).map((function(t,n){return d({},t.options.meta,{},(e.matched[n]||{}).meta)}))}));case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function j(t,e){return E.apply(this,arguments)}function E(){return(E=Object(c.a)(regeneratorRuntime.mark((function t(e,n){var c,f,l,h;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.context||(e.context={isStatic:!0,isDev:!1,isHMR:!1,app:e,payload:n.payload,error:n.error,base:"/",env:{}},n.req&&(e.context.req=n.req),n.res&&(e.context.res=n.res),n.ssrContext&&(e.context.ssrContext=n.ssrContext),e.context.redirect=function(t,path,n){if(t){e.context._redirected=!0;var r=Object(o.a)(path);if("number"==typeof t||"undefined"!==r&&"object"!==r||(n=path||{},path=t,r=Object(o.a)(path),t=302),"object"===r&&(path=e.router.resolve(path).route.fullPath),!/(^[.]{1,2}\/)|(^\/(?!\/))/.test(path))throw path=z(path,n),window.location.replace(path),new Error("ERR_REDIRECT");e.context.next({path:path,query:n,status:t})}},e.context.nuxtState=window.__NUXT__),t.next=3,Promise.all([O(n.route),O(n.from)]);case 3:c=t.sent,f=Object(r.a)(c,2),l=f[0],h=f[1],n.route&&(e.context.route=l),n.from&&(e.context.from=h),e.context.next=n.next,e.context._redirected=!1,e.context._errored=!1,e.context.isHMR=!1,e.context.params=e.context.route.params||{},e.context.query=e.context.route.query||{};case 15:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function R(t,e){return!t.length||e._redirected||e._errored?Promise.resolve():P(t[0],e).then((function(){return R(t.slice(1),e)}))}function P(t,e){var n;return(n=2===t.length?new Promise((function(n){t(e,(function(t,data){t&&e.error(t),n(data=data||{})}))})):t(e))&&n instanceof Promise&&"function"==typeof n.then?n:Promise.resolve(n)}function T(base,t){var path=decodeURI(window.location.pathname);return"hash"===t?window.location.hash.replace(/^#\//,""):(base&&0===path.indexOf(base)&&(path=path.slice(base.length)),(path||"/")+window.location.search+window.location.hash)}function S(t,e){return function(t,e){for(var n=new Array(t.length),i=0;i1&&void 0!==arguments[1]?arguments[1]:y,n=arguments.length>2?arguments[2]:void 0;return w.call(this,t,e,n)},c.default.use(x.a);var _={mode:"history",base:decodeURI("/"),linkActiveClass:"nuxt-link-active",linkExactActiveClass:"nuxt-link-exact-active",scrollBehavior:function(t,e,n){var r=!1,o=Object(v.e)(t);o.length<2&&o.every((function(t){return!1!==t.options.scrollToTop}))?r={x:0,y:0}:o.some((function(t){return t.options.scrollToTop}))&&(r={x:0,y:0}),n&&(r=n);var c=window.$nuxt;return t.path===e.path&&t.hash!==e.hash&&c.$nextTick((function(){return c.$emit("triggerScroll")})),new Promise((function(e){c.$once("triggerScroll",(function(){if(t.hash){var n=t.hash;void 0!==window.CSS&&void 0!==window.CSS.escape&&(n="#"+window.CSS.escape(n.substr(1)));try{document.querySelector(n)&&(r={selector:n})}catch(t){console.warn("Failed to save scroll position. Please add CSS.escape() polyfill (https://github.com/mathiasbynens/CSS.escape).")}}e(r)}))}))},routes:[{path:"/",component:function(){return Object(v.j)(Promise.all([n.e(2),n.e(4)]).then(n.bind(null,336)))},name:"index"},{path:"/*",component:function(){return Object(v.j)(n.e(3).then(n.bind(null,337)))},name:"all"}],fallback:!1};for(var k,C={name:"NuxtChild",functional:!0,props:{nuxtChildKey:{type:String,default:""},keepAlive:Boolean,keepAliveProps:{type:Object,default:void 0}},render:function(t,e){var n=e.parent,data=e.data,r=e.props;data.nuxtChild=!0;for(var o=n,c=n.$nuxt.nuxt.transitions,f=n.$nuxt.nuxt.defaultTransition,l=0;n;)n.$vnode&&n.$vnode.data.nuxtChild&&l++,n=n.$parent;data.nuxtChildDepth=l;var h=c[l]||f,d={};O.forEach((function(t){void 0!==h[t]&&(d[t]=h[t])}));var m={};$.forEach((function(t){"function"==typeof h[t]&&(m[t]=h[t].bind(o))}));var x=m.beforeEnter;if(m.beforeEnter=function(t){if(window.$nuxt.$nextTick((function(){window.$nuxt.$emit("triggerScroll")})),x)return x.call(o,t)},!1===h.css){var v=m.leave;(!v||v.length<2)&&(m.leave=function(t,e){v&&v.call(o,t),o.$nextTick(e)})}var y=t("routerView",data);return r.keepAlive&&(y=t("keep-alive",{props:r.keepAliveProps},[y])),t("transition",{props:d,on:m},[y])}},O=["name","mode","appear","css","type","duration","enterClass","leaveClass","appearClass","enterActiveClass","enterActiveClass","leaveActiveClass","appearActiveClass","enterToClass","leaveToClass","appearToClass"],$=["beforeEnter","enter","afterEnter","enterCancelled","beforeLeave","leave","afterLeave","leaveCancelled","beforeAppear","appear","afterAppear","appearCancelled"],j={name:"NuxtError",props:{error:{type:Object,default:null}},computed:{statusCode:function(){return this.error&&this.error.statusCode||500},message:function(){return this.error.message||"Error"}},head:function(){return{title:this.message,meta:[{name:"viewport",content:"width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"}]}}},E=(n(222),n(28)),R=Object(E.a)(j,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"__nuxt-error-page"},[n("div",{staticClass:"error"},[n("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"90",height:"90",fill:"#DBE1EC",viewBox:"0 0 48 48"}},[n("path",{attrs:{d:"M22 30h4v4h-4zm0-16h4v12h-4zm1.99-10C12.94 4 4 12.95 4 24s8.94 20 19.99 20S44 35.05 44 24 35.04 4 23.99 4zM24 40c-8.84 0-16-7.16-16-16S15.16 8 24 8s16 7.16 16 16-7.16 16-16 16z"}})]),t._v(" "),n("div",{staticClass:"title"},[t._v(t._s(t.message))]),t._v(" "),404===t.statusCode?n("p",{staticClass:"description"},[n("NuxtLink",{staticClass:"error-link",attrs:{to:"/"}},[t._v("Back to the home page")])],1):t._e(),t._v(" "),t._m(0)])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"logo"},[e("a",{attrs:{href:"https://nuxtjs.org",target:"_blank",rel:"noopener"}},[this._v("Nuxt.js")])])}],!1,null,null,null).exports,P=(n(141),n(142),n(143),n(54)),T={name:"Nuxt",components:{NuxtChild:C,NuxtError:R},props:{nuxtChildKey:{type:String,default:void 0},keepAlive:Boolean,keepAliveProps:{type:Object,default:void 0},name:{type:String,default:"default"}},errorCaptured:function(t){this.displayingNuxtError&&(this.errorFromNuxtError=t,this.$forceUpdate())},computed:{routerViewKey:function(){if(void 0!==this.nuxtChildKey||this.$route.matched.length>1)return this.nuxtChildKey||Object(v.b)(this.$route.matched[0].path)(this.$route.params);var t=Object(P.a)(this.$route.matched,1)[0];if(!t)return this.$route.path;var e=t.components.default;if(e&&e.options){var n=e.options;if(n.key)return"function"==typeof n.key?n.key(this.$route):n.key}return/\/$/.test(t.path)?this.$route.path:this.$route.path.replace(/\/$/,"")}},beforeCreate:function(){c.default.util.defineReactive(this,"nuxt",this.$root.$options.nuxt)},render:function(t){var e=this;return this.nuxt.err?this.errorFromNuxtError?(this.$nextTick((function(){return e.errorFromNuxtError=!1})),t("div",{},[t("h2","An error occured while showing the error page"),t("p","Unfortunately an error occured and while showing the error page another error occured"),t("p","Error details: ".concat(this.errorFromNuxtError.toString())),t("nuxt-link",{props:{to:"/"}},"Go back to home")])):(this.displayingNuxtError=!0,this.$nextTick((function(){return e.displayingNuxtError=!1})),t(R,{props:{error:this.nuxt.err}})):t("NuxtChild",{key:this.routerViewKey,props:this.$props})}},S=(n(86),{name:"NuxtLoading",data:function(){return{percent:0,show:!1,canSucceed:!0,reversed:!1,skipTimerCount:0,rtl:!1,throttle:200,duration:5e3,continuous:!1}},computed:{left:function(){return!(!this.continuous&&!this.rtl)&&(this.rtl?this.reversed?"0px":"auto":this.reversed?"auto":"0px")}},beforeDestroy:function(){this.clear()},methods:{clear:function(){clearInterval(this._timer),clearTimeout(this._throttle),this._timer=null},start:function(){var t=this;return this.clear(),this.percent=0,this.reversed=!1,this.skipTimerCount=0,this.canSucceed=!0,this.throttle?this._throttle=setTimeout((function(){return t.startTimer()}),this.throttle):this.startTimer(),this},set:function(t){return this.show=!0,this.canSucceed=!0,this.percent=Math.min(100,Math.max(0,Math.floor(t))),this},get:function(){return this.percent},increase:function(t){return this.percent=Math.min(100,Math.floor(this.percent+t)),this},decrease:function(t){return this.percent=Math.max(0,Math.floor(this.percent-t)),this},pause:function(){return clearInterval(this._timer),this},resume:function(){return this.startTimer(),this},finish:function(){return this.percent=this.reversed?0:100,this.hide(),this},hide:function(){var t=this;return this.clear(),setTimeout((function(){t.show=!1,t.$nextTick((function(){t.percent=0,t.reversed=!1}))}),500),this},fail:function(){return this.canSucceed=!1,this},startTimer:function(){var t=this;this.show||(this.show=!0),void 0===this._cut&&(this._cut=1e4/Math.floor(this.duration)),this._timer=setInterval((function(){t.skipTimerCount>0?t.skipTimerCount--:(t.reversed?t.decrease(t._cut):t.increase(t._cut),t.continuous&&(t.percent>=100?(t.skipTimerCount=1,t.reversed=!t.reversed):t.percent<=0&&(t.skipTimerCount=1,t.reversed=!t.reversed)))}),100)}},render:function(t){var e=t(!1);return this.show&&(e=t("div",{staticClass:"nuxt-progress",class:{"nuxt-progress-notransition":this.skipTimerCount>0,"nuxt-progress-failed":!this.canSucceed},style:{width:this.percent+"%",left:this.left}})),e}}),N=(n(224),Object(E.a)(S,void 0,void 0,!1,null,null,null).exports),A=(n(226),n(231),n(233),{_default:Object(E.a)({},(function(){var t=this.$createElement,e=this._self._c||t;return e("div",[e("nuxt")],1)}),[],!1,null,null,null).exports}),D={head:{title:"img.jue.sh",meta:[{charset:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{hid:"description",name:"description",content:"免费图床,基于Telegraph的图片上传工具 IMG.NIPAO.COM"}],link:[{rel:"icon",type:"image/x-icon",href:"/favicon.ico"}],style:[],script:[]},render:function(t,e){var n=t("NuxtLoading",{ref:"loading"}),r=t(this.layout||"nuxt"),o=t("div",{domProps:{id:"__layout"},key:this.layoutName},[r]),c=t("transition",{props:{name:"layout",mode:"out-in"},on:{beforeEnter:function(t){window.$nuxt.$nextTick((function(){window.$nuxt.$emit("triggerScroll")}))}}},[o]);return t("div",{domProps:{id:"__nuxt"}},[n,c])},data:function(){return{isOnline:!0,layout:null,layoutName:""}},beforeCreate:function(){c.default.util.defineReactive(this,"nuxt",this.$options.nuxt)},created:function(){c.default.prototype.$nuxt=this,window.$nuxt=this,this.refreshOnlineStatus(),window.addEventListener("online",this.refreshOnlineStatus),window.addEventListener("offline",this.refreshOnlineStatus),this.error=this.nuxt.error,this.context=this.$options.context},mounted:function(){this.$loading=this.$refs.loading},watch:{"nuxt.err":"errorChanged"},computed:{isOffline:function(){return!this.isOnline}},methods:{refreshOnlineStatus:function(){void 0===window.navigator.onLine?this.isOnline=!0:this.isOnline=window.navigator.onLine},refresh:(k=Object(r.a)(regeneratorRuntime.mark((function t(){var e,n,r=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=Object(v.f)(this.$route)).length){t.next=3;break}return t.abrupt("return");case 3:return this.$loading.start(),n=e.map((function(t){var p=[];return t.$options.fetch&&p.push(Object(v.m)(t.$options.fetch,r.context)),t.$options.asyncData&&p.push(Object(v.m)(t.$options.asyncData,r.context).then((function(e){for(var n in e)c.default.set(t.$data,n,e[n])}))),Promise.all(p)})),t.prev=5,t.next=8,Promise.all(n);case 8:t.next=15;break;case 10:t.prev=10,t.t0=t.catch(5),this.$loading.fail(),Object(v.i)(t.t0),this.error(t.t0);case 15:this.$loading.finish();case 16:case"end":return t.stop()}}),t,this,[[5,10]])}))),function(){return k.apply(this,arguments)}),errorChanged:function(){this.nuxt.err&&this.$loading&&(this.$loading.fail&&this.$loading.fail(),this.$loading.finish&&this.$loading.finish())},setLayout:function(t){return t&&A["_"+t]||(t="default"),this.layoutName=t,this.layout=A["_"+t],this.layout},loadLayout:function(t){return t&&A["_"+t]||(t="default"),Promise.resolve(A["_"+t])}},components:{NuxtLoading:N}},L=(n(90),n(53)),M=n.n(L),I=n(174),B=n.n(I),z={setBaseURL:function(t){this.defaults.baseURL=t},setHeader:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"common",r=!0,o=!1,c=void 0;try{for(var f,l=(Array.isArray(n)?n:[n])[Symbol.iterator]();!(r=(f=l.next()).done);r=!0){var h=f.value;if(!e)return void delete this.defaults.headers[h][t];this.defaults.headers[h][t]=e}}catch(t){o=!0,c=t}finally{try{r||null==l.return||l.return()}finally{if(o)throw c}}},setToken:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"common",r=t?(e?e+" ":"")+t:null;this.setHeader("Authorization",r,n)},onRequest:function(t){this.interceptors.request.use((function(e){return t(e)||e}))},onResponse:function(t){this.interceptors.response.use((function(e){return t(e)||e}))},onRequestError:function(t){this.interceptors.request.use(void 0,(function(e){return t(e)||Promise.reject(e)}))},onResponseError:function(t){this.interceptors.response.use(void 0,(function(e){return t(e)||Promise.reject(e)}))},onError:function(t){this.onRequestError(t),this.onResponseError(t)},create:function(t){return J(B()(t,this.defaults))}},U=function(){var t=H[F];z["$"+t]=function(){return this[t].apply(this,arguments).then((function(t){return t&&t.data}))}},F=0,H=["request","delete","get","head","options","post","put","patch"];F has been deprecated and will be removed in Nuxt 3, please use instead")),m.a.render(t,e)}})),c.default.component(C.name,C),c.default.component("NChild",C),c.default.component(T.name,T),c.default.use(f.a,{keyName:"head",attribute:"data-n-head",ssrAttribute:"data-n-head-ssr",tagIDKeyName:"hid"});var ot={name:"page",mode:"out-in",appear:!1,appearClass:"appear",appearActiveClass:"appear-active",appearToClass:"appear-to"};function it(t){return at.apply(this,arguments)}function at(){return(at=Object(r.a)(regeneratorRuntime.mark((function t(e){var n,r,o,f,path,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new x.a(_);case 2:return n=t.sent,r=nt({router:n,nuxt:{defaultTransition:ot,transitions:[ot],setTransitions:function(t){return Array.isArray(t)||(t=[t]),t=t.map((function(t){return t=t?"string"==typeof t?Object.assign({},ot,{name:t}):Object.assign({},ot,t):ot})),this.$options.nuxt.transitions=t,t},err:null,dateErr:null,error:function(t){t=t||null,r.context._errored=Boolean(t),t=t?Object(v.l)(t):null;var n=this.nuxt||this.$options.nuxt;return n.dateErr=Date.now(),n.err=t,e&&(e.nuxt.error=t),t}}},D),o=e?e.next:function(t){return r.router.push(t)},e?f=n.resolve(e.url).route:(path=Object(v.d)(n.options.base,n.options.mode),f=n.resolve(path).route),t.next=8,Object(v.p)(r,{route:f,next:o,error:r.nuxt.error.bind(r),payload:e?e.payload:void 0,req:e?e.req:void 0,res:e?e.res:void 0,beforeRenderFns:e?e.beforeRenderFns:void 0,ssrContext:e});case 8:if(l=function(t,e){if(!t)throw new Error("inject(key, value) has no key provided");if(void 0===e)throw new Error("inject(key, value) has no value provided");r[t="$"+t]=e;var n="__nuxt_"+t+"_installed__";c.default[n]||(c.default[n]=!0,c.default.use((function(){Object.prototype.hasOwnProperty.call(c.default,t)||Object.defineProperty(c.default.prototype,t,{get:function(){return this.$root.$options[t]}})})))},"function"!=typeof Q){t.next=12;break}return t.next=12,Q(r.context,l);case 12:t.next=15;break;case 15:if("function"!=typeof Y){t.next=18;break}return t.next=18,Y(r.context,l);case 18:t.next=21;break;case 21:t.next=24;break;case 24:return t.abrupt("return",{app:r,router:n});case 25:case"end":return t.stop()}}),t)})))).apply(this,arguments)}},188:function(t,e,n){t.exports=n(189)},189:function(t,e,n){"use strict";n.r(e),function(t){n(86),n(90),n(49);var e=n(38),r=(n(63),n(183),n(5)),o=(n(132),n(134),n(33),n(19),n(94),n(95),n(123),n(199),n(206),n(208),n(0)),c=n(171),f=n(118),l=n(1),h=n(16),d=n(82);o.default.component(d.a.name,d.a),o.default.component("NLink",d.a),t.fetch||(t.fetch=c.a);var m,x,v=[],y=window.__NUXT__||{};Object.assign(o.default.config,{silent:!0,performance:!1});var w=o.default.config.errorHandler||console.error;function _(t,e,n){var r=function(component){var t=function(component,t){if(!component||!component.options||!component.options[t])return{};var option=component.options[t];if("function"==typeof option){for(var e=arguments.length,n=new Array(e>2?e-2:0),r=2;r0},canPrefetch:function(){var t=navigator.connection;return!(this.$nuxt.isOffline||t&&((t.effectiveType||"").includes("2g")||t.saveData))},getPrefetchComponents:function(){return this.$router.resolve(this.to,this.$route,this.append).resolved.matched.map((function(t){return t.components.default})).filter((function(t){return"function"==typeof t&&!t.options&&!t.__prefetched}))},prefetchLink:function(){if(this.canPrefetch()){f.unobserve(this.$el);var t=this.getPrefetchComponents(),e=!0,n=!1,r=void 0;try{for(var o,c=t[Symbol.iterator]();!(e=(o=c.next()).done);e=!0){var l=o.value,h=l();h instanceof Promise&&h.catch((function(){})),l.__prefetched=!0}}catch(t){n=!0,r=t}finally{try{e||null==c.return||c.return()}finally{if(n)throw r}}}}}}}},[[188,5,1,6]]]); --------------------------------------------------------------------------------