+ image url

This commit is contained in:
Max 2021-10-15 18:04:58 +08:00
parent 285c73ba12
commit 9f4fcd131d
3 changed files with 21 additions and 2 deletions

View file

@ -9,7 +9,7 @@ import (
) )
// VERSION 版本号 // VERSION 版本号
const VERSION = "0.8.4" const VERSION = "0.8.5"
// DOMAIN 许可域 // DOMAIN 许可域
const DOMAIN = "*.iqka.com" const DOMAIN = "*.iqka.com"

View file

@ -119,5 +119,13 @@ func processGetToken(process *gou.Process) interface{} {
// processGetURL 返回文件CDN地址 // processGetURL 返回文件CDN地址
func processGetURL(process *gou.Process) interface{} { func processGetURL(process *gou.Process) interface{} {
return nil process.ValidateArgNums(1)
filename := process.ArgsString(0)
// typ := process.ArgsString(1)
// stats, err := Stor.Stat(filename)
// if err != nil {
// exception.New("读取文件信息失败 %s", 500, err.Error()).Throw()
// }
body := Stor.MustReadFile(filename)
return string(body)
} }

View file

@ -27,6 +27,17 @@
"type": "application/json" "type": "application/json"
} }
}, },
{
"path": "/url",
"method": "GET",
"guard": "-",
"process": "xiang.fs.GetURL",
"in": ["$query.name", "$query.type"],
"out": {
"status": 200,
"type": "image/png"
}
},
{ {
"path": "/token", "path": "/token",
"method": "GET", "method": "GET",