验证数据

This commit is contained in:
hoteas
2022-05-03 15:17:27 +08:00
parent b709b58fef
commit fe31335cf5
26 changed files with 106 additions and 1828 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ import (
var CompanyCtr = Ctr{
"info": func(that *Context) {
if that.Session("salesman_id").Data != nil {
if that.Session("salesman_id").Data == nil {
that.Display(2, "没有登录")
return
}
@@ -39,7 +39,7 @@ var CompanyCtr = Ctr{
that.Display(0, res)
},
"edit": func(that *Context) {
if that.Session("salesman_id").Data != nil {
if that.Session("salesman_id").Data == nil {
that.Display(2, "没有登录")
return
}
+5
View File
@@ -8,7 +8,12 @@ import (
// Project 管理端项目
var Project = Proj{
"company": CompanyCtr,
"matters": MattersCtr,
"order": OrderCtr,
"salesman": Salesman,
"sms": Sms,
"user": UserCtr,
"wechat": Wechat,
}
+2 -2
View File
@@ -8,7 +8,7 @@ import (
var MattersCtr = Ctr{
"info": func(that *Context) {
if that.Session("salesman_id").Data != nil {
if that.Session("salesman_id").Data == nil {
that.Display(2, "没有登录")
return
}
@@ -39,7 +39,7 @@ var MattersCtr = Ctr{
//用户微信公众号或者小程序登录
"search": func(that *Context) {
if that.Session("salesman_id").Data != nil {
if that.Session("salesman_id").Data == nil {
that.Display(2, "没有登录")
return
}
+4 -4
View File
@@ -7,7 +7,7 @@ import (
var OrderCtr = Ctr{
"info": func(that *Context) {
if that.Session("salesman_id").Data != nil {
if that.Session("salesman_id").Data == nil {
that.Display(2, "没有登录")
return
}
@@ -39,7 +39,7 @@ var OrderCtr = Ctr{
that.Display(0, res)
},
"create_order_record": func(that *Context) {
if that.Session("salesman_id").Data != nil {
if that.Session("salesman_id").Data == nil {
that.Display(2, "没有登录")
return
}
@@ -87,7 +87,7 @@ var OrderCtr = Ctr{
},
"edit": func(that *Context) {
if that.Session("salesman_id").Data != nil {
if that.Session("salesman_id").Data == nil {
that.Display(2, "没有登录")
return
}
@@ -160,7 +160,7 @@ var OrderCtr = Ctr{
//用户微信公众号或者小程序登录
"search": func(that *Context) {
if that.Session("salesman_id").Data != nil {
if that.Session("salesman_id").Data == nil {
that.Display(2, "没有登录")
return
}
+3 -3
View File
@@ -12,7 +12,7 @@ var Salesman = Ctr{
that.Display(0, 1)
},
"info": func(that *Context) {
if that.Session("salesman_id").Data != nil {
if that.Session("salesman_id").Data == nil {
that.Display(2, "没有登录")
return
}
@@ -35,7 +35,7 @@ var Salesman = Ctr{
},
"search": func(that *Context) {
if that.Session("salesman_id").Data != nil {
if that.Session("salesman_id").Data == nil {
that.Display(2, "没有登录")
return
}
@@ -92,7 +92,7 @@ var Salesman = Ctr{
code := that.Req.FormValue("code")
phone := that.Req.FormValue("phone")
if phone != that.Session("phone").ToStr() && code != that.Session("code").ToStr() {
if phone != that.Session("phone").ToStr() && code == that.Session("code").ToStr() {
that.Display(3, "手机号或者验证码错误")
return
}
+3 -3
View File
@@ -8,7 +8,7 @@ import (
var UserCtr = Ctr{
//用户微信公众号或者小程序登录
"info": func(that *Context) {
if that.Session("salesman_id").Data != nil {
if that.Session("salesman_id").Data == nil {
that.Display(2, "没有登录")
return
}
@@ -32,7 +32,7 @@ var UserCtr = Ctr{
"edit": func(that *Context) {
if that.Session("salesman_id").Data != nil {
if that.Session("salesman_id").Data == nil {
that.Display(2, "没有登录")
return
}
@@ -85,7 +85,7 @@ var UserCtr = Ctr{
},
"search": func(that *Context) {
if that.Session("salesman_id").Data != nil {
if that.Session("salesman_id").Data == nil {
that.Display(2, "没有登录")
return
}