1、实现富文本编辑器

2、实现文档转换为PDF、MOBI、EPUB、Word格式
3、实现登录后跳转到来源地址
This commit is contained in:
Minho
2018-01-26 17:17:38 +08:00
parent e1ec6bb788
commit 882d93e7b0
57 changed files with 1572 additions and 1475 deletions

View File

@@ -1,15 +1,15 @@
package utils
import (
"strings"
"os"
"fmt"
"path/filepath"
"io"
"math"
"os"
"path/filepath"
"strings"
)
func AbsolutePath(p string) (string,error) {
func AbsolutePath(p string) (string, error) {
if strings.HasPrefix(p, "~") {
home := os.Getenv("HOME")
@@ -21,9 +21,9 @@ func AbsolutePath(p string) (string,error) {
s, err := filepath.Abs(p)
if nil != err {
return "",err
return "", err
}
return s,nil
return s, nil
}
// FileExists reports whether the named file or directory exists.
@@ -58,18 +58,13 @@ func FormatBytes(size int64) string {
i := 0
for ; s >= 1024 && i < 4 ; i ++ {
for ; s >= 1024 && i < 4; i++ {
s /= 1024
}
return fmt.Sprintf("%.2f%s",s,units[i])
return fmt.Sprintf("%.2f%s", s, units[i])
}
func Round(val float64, places int) float64 {
var t float64
f := math.Pow10(places)
@@ -97,12 +92,3 @@ func Round(val float64, places int) float64 {
return t
}