|
|
|
@ -3,8 +3,12 @@ package PreviewController
|
|
|
|
|
import (
|
|
|
|
|
"dsSupport/Utils/CommonUtil"
|
|
|
|
|
"dsSupport/Utils/ObsUtil"
|
|
|
|
|
"encoding/base64"
|
|
|
|
|
"fmt"
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
|
"log"
|
|
|
|
|
"net/http"
|
|
|
|
|
"path/filepath"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
//模块的路由配置
|
|
|
|
@ -18,9 +22,15 @@ func Routers(r *gin.RouterGroup) {
|
|
|
|
|
// http://127.0.0.1:9000/support/preview/preview
|
|
|
|
|
func preview(c *gin.Context) {
|
|
|
|
|
//本地物理路径
|
|
|
|
|
p :=c.Query("p")
|
|
|
|
|
uEnc :=c.Query("p")
|
|
|
|
|
uDec, err := base64.URLEncoding.DecodeString(uEnc)
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Fatalln(err)
|
|
|
|
|
}
|
|
|
|
|
fullPath:=string(uDec)
|
|
|
|
|
fmt.Println(fullPath)
|
|
|
|
|
_, p := filepath.Split(fullPath)
|
|
|
|
|
|
|
|
|
|
fullPath:="C:\\Users\\Administrator\\Desktop\\技术讨论会\\"+p
|
|
|
|
|
//判断是不是本地存在
|
|
|
|
|
isExist, err := CommonUtil.PathExists(fullPath)
|
|
|
|
|
if err != nil {
|
|
|
|
|