feat:完善项目
This commit is contained in:
@ -34,7 +34,7 @@ type ImageForm struct {
|
||||
}
|
||||
|
||||
func (this *ImageForm) FilterImageURL() string {
|
||||
return strings.Replace(this.Image, config.SettingInfo.Domain, "", -1)
|
||||
return strings.Replace(this.Image, config.SystemConfig[config.Domain].(string), "", -1)
|
||||
}
|
||||
|
||||
type PositionForm struct {
|
||||
|
@ -52,7 +52,7 @@ func (a *Upload) Upload(c *gin.Context) {
|
||||
resp := new(lib.UploadHandle)
|
||||
|
||||
if resp, err = lib.Upload(config.SettingInfo.Upload.Path, config.SettingInfo.Upload.Exts, config.SettingInfo.Upload.Size,
|
||||
config.SettingInfo.Upload.Rename).Handle()(file, config.SettingInfo.Domain); err != nil {
|
||||
config.SettingInfo.Upload.Rename).Handle()(file, config.SystemConfig[config.Domain].(string)); err != nil {
|
||||
APIFailure(err)(c)
|
||||
return
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import (
|
||||
"ArmedPolice/config"
|
||||
"ArmedPolice/lib"
|
||||
"ArmedPolice/serve/orm"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type synchronized struct {
|
||||
@ -58,6 +59,7 @@ func initModel() {
|
||||
|
||||
function := func(synchronized ...*synchronized) {
|
||||
for _, v := range synchronized {
|
||||
fmt.Println(db.Migrator().HasTable(v.iModel))
|
||||
if !db.Migrator().HasTable(v.iModel) {
|
||||
_ = db.Migrator().CreateTable(v.iModel)
|
||||
|
||||
|
@ -71,7 +71,7 @@ func (c *Equipment) tree(iModel model2.IModel, src []*model2.ManageEquipment, pa
|
||||
ParentID: iModel.GetEncodeID(),
|
||||
Code: v.Code,
|
||||
Title: v.Title,
|
||||
Image: v.Analysis(config.SettingInfo.Domain),
|
||||
Image: v.Analysis(config.SystemConfig[config.Domain].(string)),
|
||||
CreatedAt: v.CreatedAt,
|
||||
Children: c.tree(iModel, src, v.ID),
|
||||
})
|
||||
@ -166,7 +166,7 @@ func (c *Equipment) Detail(id uint64) (*EquipmentDetail, error) {
|
||||
out := &EquipmentDetail{
|
||||
CommonIDString: basic.CommonIDString{ID: mManageEquipment.GetEncodeID()},
|
||||
ManageEquipment: mManageEquipment.ManageEquipment,
|
||||
Image: mManageEquipment.Analysis(config.SettingInfo.Domain),
|
||||
Image: mManageEquipment.Analysis(config.SystemConfig[config.Domain].(string)),
|
||||
Materials: make([]*EquipmentMaterialDetail, 0),
|
||||
}
|
||||
mManageEquipmentMaterial := model.NewManageEquipmentMaterial()
|
||||
|
@ -79,7 +79,7 @@ func (c *Material) List(manufacturerID, supplierID uint64, code, title string, p
|
||||
mManageMaterial.SetID(v.ManageMaterial.ManufacturerID)
|
||||
|
||||
v.Stock -= v.FrozenStock
|
||||
v.Image.Image = v.Analysis(config.SettingInfo.Domain)
|
||||
v.Image.Image = v.Analysis(config.SystemConfig[config.Domain].(string))
|
||||
|
||||
list = append(list, &MaterialInfo{
|
||||
CommonIDString: basic.CommonIDString{ID: v.GetEncodeID()},
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ArmedPolice.exe main.go
|
||||
#CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ArmedPolice.exe main.go
|
||||
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -x -v -ldflags "-s -w" -o ArmedPolice.exe main.go
|
@ -1,6 +1,3 @@
|
||||
name: 武警
|
||||
# domain 域名
|
||||
domain: http://192.168.31.195:8030/
|
||||
# token有效时间(秒)
|
||||
token_effect_time: 2592000
|
||||
# multiple_login 多地登录
|
||||
|
@ -43,10 +43,8 @@ type Redis struct {
|
||||
|
||||
// Setting 配置信息
|
||||
type Setting struct {
|
||||
Domain string `json:"domain" yaml:"domain"`
|
||||
Name string `yaml:"name"`
|
||||
TokenEffectTime int `yaml:"token_effect_time"`
|
||||
MultipleLogin bool `yaml:"multiple_login"`
|
||||
TokenEffectTime int `yaml:"token_effect_time"`
|
||||
MultipleLogin bool `yaml:"multiple_login"`
|
||||
|
||||
// Server 配置
|
||||
Server struct {
|
||||
|
Reference in New Issue
Block a user