Browse Source

Merge pull request '将庞富镇开发的荣誉墙相关代码合并到主分支' (#2) from v1_dev_p into master

Reviewed-on: #2
pull/3/head
秦东 3 years ago
parent
commit
a970c25b4f
  1. 56
      .history/README_20220727153717.md
  2. 59
      .history/README_20220727153956.md
  3. 57
      .history/README_20220728075530.md
  4. 187
      .history/api/base/loginVerify/login_20220727153717.go
  5. 187
      .history/api/base/loginVerify/login_20220729082636.go
  6. 187
      .history/api/base/loginVerify/login_20220729082639.go
  7. 188
      .history/api/base/loginVerify/login_20220729082930.go
  8. 0
      .history/api/myTest/entry_20220728105227.go
  9. 2
      .history/api/myTest/entry_20220728105240.go
  10. 5
      .history/api/myTest/entry_20220728131248.go
  11. 5
      .history/api/myTest/entry_20220728131253.go
  12. 7
      .history/api/myTest/entry_20220728131257.go
  13. 7
      .history/api/myTest/entry_20220728131258.go
  14. 7
      .history/api/myTest/entry_20220728131321.go
  15. 7
      .history/api/myTest/entry_20220728131324.go
  16. 7
      .history/api/myTest/entry_20220728131403.go
  17. 7
      .history/api/myTest/entry_20220728131405.go
  18. 7
      .history/api/myTest/entry_20220728131417.go
  19. 7
      .history/api/myTest/entry_20220728131419.go
  20. 7
      .history/api/myTest/entry_20220728131425.go
  21. 7
      .history/api/myTest/entry_20220728131426.go
  22. 7
      .history/api/myTest/entry_20220728131430.go
  23. 7
      .history/api/myTest/entry_20220728131433.go
  24. 5
      .history/api/myTest/entry_20220728131437.go
  25. 6
      .history/api/myTest/entry_20220728131449.go
  26. 7
      .history/api/myTest/entry_20220728131502.go
  27. 7
      .history/api/myTest/entry_20220728131506.go
  28. 7
      .history/api/myTest/entry_20220728131512.go
  29. 7
      .history/api/myTest/entry_20220728131518.go
  30. 7
      .history/api/myTest/entry_20220728131526.go
  31. 7
      .history/api/myTest/entry_20220728131528.go
  32. 7
      .history/api/myTest/entry_20220728131533.go
  33. 7
      .history/api/myTest/entry_20220728131536.go
  34. 7
      .history/api/myTest/entry_20220728131545.go
  35. 7
      .history/api/myTest/entry_20220728131546.go
  36. 7
      .history/api/myTest/entry_20220728131554.go
  37. 7
      .history/api/myTest/entry_20220728131601.go
  38. 7
      .history/api/myTest/entry_20220728131744.go
  39. 8
      .history/api/myTest/entry_20220728131746.go
  40. 8
      .history/api/myTest/entry_20220728131748.go
  41. 8
      .history/api/myTest/entry_20220728131753.go
  42. 8
      .history/api/myTest/entry_20220728131801.go
  43. 8
      .history/api/myTest/entry_20220728131804.go
  44. 8
      .history/api/myTest/entry_20220728131807.go
  45. 10
      .history/api/myTest/entry_20220728131808.go
  46. 10
      .history/api/myTest/entry_20220728131815.go
  47. 8
      .history/api/myTest/entry_20220728131817.go
  48. 8
      .history/api/myTest/entry_20220728131824.go
  49. 8
      .history/api/myTest/entry_20220728131827.go
  50. 8
      .history/api/myTest/entry_20220728132012.go
  51. 8
      .history/api/myTest/entry_20220728132014.go
  52. 8
      .history/api/myTest/entry_20220728132015.go
  53. 8
      .history/api/myTest/entry_20220728132025.go
  54. 10
      .history/api/myTest/entry_20220728132027.go
  55. 10
      .history/api/myTest/entry_20220728132028.go
  56. 9
      .history/api/myTest/entry_20220728132032.go
  57. 9
      .history/api/myTest/entry_20220728132035.go
  58. 7
      .history/api/myTest/entry_20220728132036.go
  59. 7
      .history/api/myTest/entry_20220728132039.go
  60. 10
      .history/api/myTest/entry_20220728132049.go
  61. 10
      .history/api/myTest/entry_20220728132052.go
  62. 10
      .history/api/myTest/entry_20220728132055.go
  63. 9
      .history/api/myTest/entry_20220728132057.go
  64. 0
      .history/api/myTest/testRoute/testroute_20220728105311.go
  65. 1
      .history/api/myTest/testRoute/testroute_20220728105316.go
  66. 1
      .history/api/myTest/testRoute/testroute_20220728105323.go
  67. 1
      .history/api/myTest/testRoute/testroute_20220728105330.go
  68. 2
      .history/api/myTest/testRoute/testroute_20220728105333.go
  69. 2
      .history/api/myTest/testRoute/testroute_20220728105444.go
  70. 2
      .history/api/myTest/testRoute/testroute_20220728105447.go
  71. 1
      .history/api/myTest/testRoute/testroute_20220728131912.go
  72. 0
      .history/api/myTest/testRoute/testroute_20220728131914.go
  73. 1
      .history/api/myTest/testRoute/testroute_20220728131924.go
  74. 1
      .history/api/myTest/testRoute/testroute_20220728131927.go
  75. 1
      .history/api/myTest/testRoute/testroute_20220728131929.go
  76. 1
      .history/api/myTest/testRoute/testroute_20220728131953.go
  77. 2
      .history/api/myTest/testRoute/testroute_20220728131959.go
  78. 1
      .history/api/myTest/testRoute/testroute_20220728132003.go
  79. 1
      .history/api/myTest/testRoute/testroute_20220728132005.go
  80. 3
      .history/api/myTest/testRoute/testroute_20220728132229.go
  81. 3
      .history/api/myTest/testRoute/testroute_20220728132232.go
  82. 3
      .history/api/myTest/testRoute/testroute_20220728132241.go
  83. 3
      .history/api/myTest/testRoute/testroute_20220728132242.go
  84. 3
      .history/api/myTest/testRoute/testroute_20220728132245.go
  85. 3
      .history/api/myTest/testRoute/testroute_20220728132247.go
  86. 3
      .history/api/myTest/testRoute/testroute_20220728132255.go
  87. 3
      .history/api/myTest/testRoute/testroute_20220728132257.go
  88. 3
      .history/api/myTest/testRoute/testroute_20220728132259.go
  89. 5
      .history/api/myTest/testRoute/testroute_20220728132302.go
  90. 7
      .history/api/myTest/testRoute/testroute_20220728132308.go
  91. 7
      .history/api/myTest/testRoute/testroute_20220728132309.go
  92. 7
      .history/api/myTest/testRoute/testroute_20220728132322.go
  93. 7
      .history/api/myTest/testRoute/testroute_20220728132324.go
  94. 7
      .history/api/myTest/testRoute/testroute_20220728132325.go
  95. 7
      .history/api/myTest/testRoute/testroute_20220728132327.go
  96. 7
      .history/api/myTest/testRoute/testroute_20220728132332.go
  97. 8
      .history/api/myTest/testRoute/testroute_20220728132343.go
  98. 8
      .history/api/myTest/testRoute/testroute_20220728132344.go
  99. 10
      .history/api/myTest/testRoute/testroute_20220728132348.go
  100. 10
      .history/api/myTest/testRoute/testroute_20220728132353.go

56
.history/README_20220727153717.md

@ -0,0 +1,56 @@
# KPI综合管理系统
```Project
|—— api
└── version1
└── empower
|—— apirouter
|—— initialization
└── database
└── nosql
└── app
└── route
|identification
|—— config
└── configDatabase
└── configNosql
└── configAapp
└── configJson
|—— models
|—— overall
|—— middleware
```
## Hr 文件结构说明
| 文件夹 | 说明 | 描述|
|--------- |------ |-----|
| `api` | api相关业务 | api业务实现 |
| `--version1` | 业务版本文件夹 | 版本界定 |
| `--empower` |OAuth 2.0 授权 |授权Token|
| `apirouter` | 路由器 | 业务路由设定 |
| `initialization` | 初始化相关业务 | 系统初始化方面的实现 |
| `--database` | 数据库业务 | 数据库业务初始化实现 |
| `--nosql` | nosql数据库业务 | nosql业务初始化实现(例:Redis) |
| `--app` | app数据库业务 | app业务初始化实现 |
| `--route` | 路由初始化 | 路由初始化 |
| `identification` | 授权验证器 | 授权验证器 |
| `config` | 系统配置相关业务 | 系统系统配置方面的实现 |
| `--configDatabase` | 数据库业务 | 数据库业务系统配置实现 |
| `--configNosql` | nosql数据库业务 | nosql业务系统配置实现(例:Redis) |
| `--configAapp` | app系统业务 | app业务系统配置实现 |
| `--configJson` | app JSON业务 | app业务系统配置实现 |
| `models` | 数据模型 | 数据库方面的配置 |
| `overall` | 全局对象 | 全局对象|
| `middleware` | 中间件 | 中间件 |
## 加密规则
```
1、分解步骤
one = md5(CodeString)+md5(AppKey)
two = md5(one)+AppKey
therr = md5(two)
2、合并
md5(md5(md5(CodeString)+md5(AppKey))+AppKey)
```

59
.history/README_20220727153956.md

@ -0,0 +1,59 @@
# KPI综合管理系统
```Project
|—— api
└── version1
└── empower
|—— apirouter
|—— initialization
└── database
└── nosql
└── app
└── route
|identification
|—— config
└── configDatabase
└── configNosql
└── configAapp
└── configJson
|—— models
|—— overall
|—— middleware
```
## Hr 文件结构说明
| 文件夹 | 说明 | 描述|
|--------- |------ |-----|
| `api` | api相关业务 | api业务实现 |
| `--version1` | 业务版本文件夹 | 版本界定 |
| `--empower` |OAuth 2.0 授权 |授权Token|
| `apirouter` | 路由器 | 业务路由设定 |
| `initialization` | 初始化相关业务 | 系统初始化方面的实现 |
| `--database` | 数据库业务 | 数据库业务初始化实现 |
| `--nosql` | nosql数据库业务 | nosql业务初始化实现(例:Redis) |
| `--app` | app数据库业务 | app业务初始化实现 |
| `--route` | 路由初始化 | 路由初始化 |
| `identification` | 授权验证器 | 授权验证器 |
| `config` | 系统配置相关业务 | 系统系统配置方面的实现 |
| `--configDatabase` | 数据库业务 | 数据库业务系统配置实现 |
| `--configNosql` | nosql数据库业务 | nosql业务系统配置实现(例:Redis) |
| `--configAapp` | app系统业务 | app业务系统配置实现 |
| `--configJson` | app JSON业务 | app业务系统配置实现 |
| `models` | 数据模型 | 数据库方面的配置 |
| `overall` | 全局对象 | 全局对象|
| `middleware` | 中间件 | 中间件 |
## 加密规则
```
1、分解步骤
one = md5(CodeString)+md5(AppKey)
two = md5(one)+AppKey
therr = md5(two)
2、合并
md5(md5(md5(CodeString)+md5(AppKey))+AppKey)
```
123

57
.history/README_20220728075530.md

@ -0,0 +1,57 @@
# KPI综合管理系统
```Project
|—— api
└── version1
└── empower
|—— apirouter
|—— initialization
└── database
└── nosql
└── app
└── route
|identification
|—— config
└── configDatabase
└── configNosql
└── configAapp
└── configJson
|—— models
|—— overall
|—— middleware
```
## Hr 文件结构说明
| 文件夹 | 说明 | 描述|
|--------- |------ |-----|
| `api` | api相关业务 | api业务实现 |
| `--version1` | 业务版本文件夹 | 版本界定 |
| `--empower` |OAuth 2.0 授权 |授权Token|
| `apirouter` | 路由器 | 业务路由设定 |
| `initialization` | 初始化相关业务 | 系统初始化方面的实现 |
| `--database` | 数据库业务 | 数据库业务初始化实现 |
| `--nosql` | nosql数据库业务 | nosql业务初始化实现(例:Redis) |
| `--app` | app数据库业务 | app业务初始化实现 |
| `--route` | 路由初始化 | 路由初始化 |
| `identification` | 授权验证器 | 授权验证器 |
| `config` | 系统配置相关业务 | 系统系统配置方面的实现 |
| `--configDatabase` | 数据库业务 | 数据库业务系统配置实现 |
| `--configNosql` | nosql数据库业务 | nosql业务系统配置实现(例:Redis) |
| `--configAapp` | app系统业务 | app业务系统配置实现 |
| `--configJson` | app JSON业务 | app业务系统配置实现 |
| `models` | 数据模型 | 数据库方面的配置 |
| `overall` | 全局对象 | 全局对象|
| `middleware` | 中间件 | 中间件 |
## 加密规则
```
1、分解步骤
one = md5(CodeString)+md5(AppKey)
two = md5(one)+AppKey
therr = md5(two)
2、合并
md5(md5(md5(CodeString)+md5(AppKey))+AppKey)
```

187
.history/api/base/loginVerify/login_20220727153717.go

@ -0,0 +1,187 @@
package loginVerify
import (
"fmt"
"key_performance_indicators/middleware/grocerystore"
"key_performance_indicators/models"
"key_performance_indicators/overall"
"key_performance_indicators/overall/publicmethod"
"github.com/gin-gonic/gin"
)
func (a *ApiMethod) ScanCodeLogin(c *gin.Context) {
var requestData Login
c.ShouldBindJSON(&requestData)
if requestData.Username == "" {
publicmethod.Result(1, requestData, c, "请输入用户名!")
return
}
if requestData.Password == "" {
publicmethod.Result(1, requestData, c, "请输入密码!")
return
}
if requestData.Captcha == "" {
publicmethod.Result(1, requestData, c, "请输入验证码!")
return
}
// if store.Verify(requestData.CaptchaId, requestData.Captcha, true) != true {
// publicmethod.Result(1, requestData, c, "验证码不正确!")
// return
// }
userAgent := c.Request.Header.Get("User-Agent")
// userAgent = "250"
var md5JiaMiPwd publicmethod.Md5Encryption
md5JiaMiPwd.Md5EncryptionInit(requestData.Password)
md5TokenPwd := md5JiaMiPwd.Md5EncryptionAlgorithm()
// var oldAdmin OldSchollAdmin
// oldErr := overall.CONSTANT_DB_Master.Model(&models.SystemUser{}).Select("system_user.*,system_user_attribute.*").Joins("left join system_user_attribute on system_user.u_key = system_user_attribute.ua_id").Where("`u_name` = ? AND `u_password` = ?", requestData.Username, md5TokenPwd).First(&oldAdmin).Error
// if oldErr == nil {
// //原知行学院管理员账号登录
// }
//新的登录认证方式
var userCont models.ManCont
userErr := userCont.GetCont(map[string]interface{}{"number": requestData.Username, "password": md5TokenPwd})
if userErr != nil {
publicmethod.Result(2000, userErr, c)
return
}
if requestData.OpenId != "" {
var userInfo models.PersonArchives
userInfo.EiteCont(map[string]interface{}{"id": userCont.Id}, map[string]interface{}{"work_wechat": requestData.OpenId})
}
if userCont.State == 2 {
publicmethod.Result(1, userErr, c, "登陆失败! 该账号已经被禁用!")
return
}
if userCont.State == 3 {
publicmethod.Result(1, userErr, c, "登陆失败! 该账号不存在!")
return
}
var md5JiaMi publicmethod.Md5Encryption
md5JiaMi.Md5EncryptionInit(userAgent)
md5Token := md5JiaMi.Md5EncryptionAlgorithm()
var md5JiaMiNumber publicmethod.Md5Encryption
md5JiaMiNumber.Md5EncryptionInit(userCont.Number)
userKeyCode := md5JiaMiNumber.Md5EncryptionAlgorithm()
sha1Str := userKeyCode + userCont.Number + userCont.Password + md5Token
sha1Token := publicmethod.Sha1Encryption(sha1Str)
//返回值
saveData := publicmethod.MapOut[string]()
saveData["key"] = userKeyCode
saveData["token"] = sha1Token
saveData["userinfo"] = userCont
menuoper, jurisdiction := getRoleSeat(userCont.Role)
writeRedisData := map[string]interface{}{
"userkey": userKeyCode,
"key": userCont.Key,
"usernumber": userCont.Number,
"userpwd": userCont.Password,
"usertoken": sha1Token,
"jurisdiction": jurisdiction,
"menuOper": menuoper,
"wand": 118,
}
//API Token数据
redisFileKey := fmt.Sprintf("ScanCode:Authentication:LoginApi_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userKeyCode)
redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5)
redisClient.SetRedisTime(10800)
redisClient.HashMsetAdd(redisFileKey, writeRedisData)
//缓存写入个人信息
redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userCont.Number)
myCont := publicmethod.MapOut[string]()
myCont["id"] = userCont.Id
myCont["number"] = userCont.Number //员工工号
myCont["name"] = userCont.Name //姓名
myCont["icon"] = userCont.Icon //头像
myCont["hire_class"] = userCont.HireClass //雇佣类型(1:雇佣入职;2:再入职;)
myCont["emp_type"] = userCont.EmpType //用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职)
myCont["company"] = userCont.Company //入职公司
myCont["maindeparment"] = userCont.MainDeparment //主部门
myCont["sun_main_department"] = userCont.SunMainDeparment //二级主部门
myCont["deparment"] = userCont.Deparment //部门
myCont["admin_org"] = userCont.AdminOrg //所属行政组织
myCont["teamid"] = userCont.TeamId //班组
myCont["position"] = userCont.Position //职位
myCont["job_class"] = userCont.JobClass //职务分类
myCont["job_id"] = userCont.JobId //职务
myCont["job_leve"] = userCont.JobLeve //职务等级
myCont["wechat"] = userCont.Wechat //微信UserId
myCont["work_wechat"] = userCont.WorkWechat //企业微信UserId
myCont["state"] = userCont.State //状态(1:启用;2:禁用;3:删除)
myCont["key"] = userCont.Key //key
myCont["is_admin"] = userCont.IsAdmin //是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管
myCont["password"] = userCont.Password //密码
myCont["role"] = userCont.Role //角色
myCont["idcardno"] = userCont.Idcardno //身份证号
myCont["passportno"] = userCont.Passportno //护照号码
myCont["globalroaming"] = userCont.Globalroaming //国际区号
myCont["mobilephone"] = userCont.Mobilephone //手机号码
myCont["email"] = userCont.Email //电子邮件
myCont["gender"] = userCont.Gender //性别(1:男性;2:女性;3:中性)
myCont["birthday"] = userCont.Birthday //birthday
myCont["myfolk"] = userCont.Myfolk //民族
myCont["nativeplace"] = userCont.Nativeplace //籍贯
myCont["idcardstartdate"] = userCont.Idcardstartdate //身份证有效期开始
myCont["idcardenddate"] = userCont.Idcardenddate //身份证有效期结束
myCont["idcardaddress"] = userCont.Idcardaddress //身份证地址
myCont["idcardIssued"] = userCont.IdcardIssued //身份证签发机关
myCont["health"] = userCont.Health //健康状况(1:良好;2:一般;3:较弱,4:有生理缺陷;5:残废)
myCont["maritalstatus"] = userCont.Maritalstatus //婚姻状况(1:未婚;2:已婚;3:丧偶;4:离异)
myCont["internaltelephone"] = userCont.Internaltelephone //内线电话
myCont["currentresidence"] = userCont.Currentresidence //现居住地址
myCont["constellationing"] = userCont.Constellation //星座(1:白羊座;2:金牛座;3:双子座;4:巨蟹座;5:狮子座;6:处女座;7:天枰座;8:天蝎座;9:射手座;10:摩羯座;11:水瓶座;12:双鱼座)
myCont["isdoubleworker"] = userCont.Isdoubleworker //是否双职工(1:是;2:否)
myCont["isveterans"] = userCont.Isveterans //是否为退役军人(1:是;2:否)
myCont["veteransnumber"] = userCont.Veteransnumber //退役证编号
myCont["jobstartdate"] = userCont.Jobstartdate //参加工作日期
myCont["entrydate"] = userCont.Entrydate //入职日期
myCont["probationperiod"] = userCont.Probationperiod //试用期
myCont["planformaldate"] = userCont.Planformaldate //预计转正日期
myCont["political_outlook"] = userCont.PoliticalOutlook //政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员)
redisClient.HashMsetAdd(redisMyContKey, myCont)
publicmethod.Result(0, saveData, c)
}
//获取权限点位
func getRoleSeat(roleId string) (menuStr, buttonStr string) {
var roleInfo models.SystemRole
err := roleInfo.GetCont(map[string]interface{}{"r_id": roleId}, "r_menu_oper", "r_jurisdiction")
if err != nil {
return
}
menuStr = roleInfo.MenuOper
buttonStr = roleInfo.Jurisdiction
return
}
//退出登录
func (a *ApiMethod) SignOut(c *gin.Context) {
userKey := c.Request.Header.Get("user-key")
redisFileKey := fmt.Sprintf("ScanCode:Authentication:LoginApi_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userKey)
redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5)
userToken, isTrue := redisClient.HashGetAll(redisFileKey)
if isTrue == false {
publicmethod.Result(0, isTrue, c, "退出成功!")
return
}
// fmt.Printf("userToken----->%v\n", userToken)
_, err := publicmethod.GetUserRedisCont(userToken["usernumber"])
if err != nil {
redisClient.DelKey(redisFileKey)
publicmethod.Result(0, isTrue, c, "退出成功!")
return
}
redisClient.DelKey(redisFileKey)
redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userToken["usernumber"])
redisClient.DelKey(redisMyContKey)
publicmethod.Result(0, isTrue, c, "退出成功!")
}

187
.history/api/base/loginVerify/login_20220729082636.go

@ -0,0 +1,187 @@
package loginVerify
import (
"fmt"
"key_performance_indicators/middleware/grocerystore"
"key_performance_indicators/models"
"key_performance_indicators/overall"
"key_performance_indicators/overall/publicmethod"
"github.com/gin-gonic/gin"
)
func (a *ApiMethod) ScanCodeLogin(c *gin.Context) {
var requestData Login
c.ShouldBindJSON(&requestData)
if requestData.Username == "" {
publicmethod.Result(1, requestData, c, "请输入用户名!")
return
}
if requestData.Password == "" {
publicmethod.Result(1, requestData, c, "请输入密码!")
return
}
if requestData.Captcha == "" {
publicmethod.Result(1, requestData, c, "请输入验证码!")
return
}
// if store.Verify(requestData.CaptchaId, requestData.Captcha, true) != true {
// publicmethod.Result(1, requestData, c, "验证码不正确!")
// return
// }
userAgent := c.Request.Header.Get("User-Agent") //
// userAgent = "250"
var md5JiaMiPwd publicmethod.Md5Encryption
md5JiaMiPwd.Md5EncryptionInit(requestData.Password)
md5TokenPwd := md5JiaMiPwd.Md5EncryptionAlgorithm()
// var oldAdmin OldSchollAdmin
// oldErr := overall.CONSTANT_DB_Master.Model(&models.SystemUser{}).Select("system_user.*,system_user_attribute.*").Joins("left join system_user_attribute on system_user.u_key = system_user_attribute.ua_id").Where("`u_name` = ? AND `u_password` = ?", requestData.Username, md5TokenPwd).First(&oldAdmin).Error
// if oldErr == nil {
// //原知行学院管理员账号登录
// }
//新的登录认证方式
var userCont models.ManCont
userErr := userCont.GetCont(map[string]interface{}{"number": requestData.Username, "password": md5TokenPwd})
if userErr != nil {
publicmethod.Result(2000, userErr, c)
return
}
if requestData.OpenId != "" {
var userInfo models.PersonArchives
userInfo.EiteCont(map[string]interface{}{"id": userCont.Id}, map[string]interface{}{"work_wechat": requestData.OpenId})
}
if userCont.State == 2 {
publicmethod.Result(1, userErr, c, "登陆失败! 该账号已经被禁用!")
return
}
if userCont.State == 3 {
publicmethod.Result(1, userErr, c, "登陆失败! 该账号不存在!")
return
}
var md5JiaMi publicmethod.Md5Encryption
md5JiaMi.Md5EncryptionInit(userAgent)
md5Token := md5JiaMi.Md5EncryptionAlgorithm()
var md5JiaMiNumber publicmethod.Md5Encryption
md5JiaMiNumber.Md5EncryptionInit(userCont.Number)
userKeyCode := md5JiaMiNumber.Md5EncryptionAlgorithm()
sha1Str := userKeyCode + userCont.Number + userCont.Password + md5Token
sha1Token := publicmethod.Sha1Encryption(sha1Str)
//返回值
saveData := publicmethod.MapOut[string]()
saveData["key"] = userKeyCode
saveData["token"] = sha1Token
saveData["userinfo"] = userCont
menuoper, jurisdiction := getRoleSeat(userCont.Role)
writeRedisData := map[string]interface{}{
"userkey": userKeyCode,
"key": userCont.Key,
"usernumber": userCont.Number,
"userpwd": userCont.Password,
"usertoken": sha1Token,
"jurisdiction": jurisdiction,
"menuOper": menuoper,
"wand": 118,
}
//API Token数据
redisFileKey := fmt.Sprintf("ScanCode:Authentication:LoginApi_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userKeyCode)
redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5)
redisClient.SetRedisTime(10800)
redisClient.HashMsetAdd(redisFileKey, writeRedisData)
//缓存写入个人信息
redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userCont.Number)
myCont := publicmethod.MapOut[string]()
myCont["id"] = userCont.Id
myCont["number"] = userCont.Number //员工工号
myCont["name"] = userCont.Name //姓名
myCont["icon"] = userCont.Icon //头像
myCont["hire_class"] = userCont.HireClass //雇佣类型(1:雇佣入职;2:再入职;)
myCont["emp_type"] = userCont.EmpType //用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职)
myCont["company"] = userCont.Company //入职公司
myCont["maindeparment"] = userCont.MainDeparment //主部门
myCont["sun_main_department"] = userCont.SunMainDeparment //二级主部门
myCont["deparment"] = userCont.Deparment //部门
myCont["admin_org"] = userCont.AdminOrg //所属行政组织
myCont["teamid"] = userCont.TeamId //班组
myCont["position"] = userCont.Position //职位
myCont["job_class"] = userCont.JobClass //职务分类
myCont["job_id"] = userCont.JobId //职务
myCont["job_leve"] = userCont.JobLeve //职务等级
myCont["wechat"] = userCont.Wechat //微信UserId
myCont["work_wechat"] = userCont.WorkWechat //企业微信UserId
myCont["state"] = userCont.State //状态(1:启用;2:禁用;3:删除)
myCont["key"] = userCont.Key //key
myCont["is_admin"] = userCont.IsAdmin //是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管
myCont["password"] = userCont.Password //密码
myCont["role"] = userCont.Role //角色
myCont["idcardno"] = userCont.Idcardno //身份证号
myCont["passportno"] = userCont.Passportno //护照号码
myCont["globalroaming"] = userCont.Globalroaming //国际区号
myCont["mobilephone"] = userCont.Mobilephone //手机号码
myCont["email"] = userCont.Email //电子邮件
myCont["gender"] = userCont.Gender //性别(1:男性;2:女性;3:中性)
myCont["birthday"] = userCont.Birthday //birthday
myCont["myfolk"] = userCont.Myfolk //民族
myCont["nativeplace"] = userCont.Nativeplace //籍贯
myCont["idcardstartdate"] = userCont.Idcardstartdate //身份证有效期开始
myCont["idcardenddate"] = userCont.Idcardenddate //身份证有效期结束
myCont["idcardaddress"] = userCont.Idcardaddress //身份证地址
myCont["idcardIssued"] = userCont.IdcardIssued //身份证签发机关
myCont["health"] = userCont.Health //健康状况(1:良好;2:一般;3:较弱,4:有生理缺陷;5:残废)
myCont["maritalstatus"] = userCont.Maritalstatus //婚姻状况(1:未婚;2:已婚;3:丧偶;4:离异)
myCont["internaltelephone"] = userCont.Internaltelephone //内线电话
myCont["currentresidence"] = userCont.Currentresidence //现居住地址
myCont["constellationing"] = userCont.Constellation //星座(1:白羊座;2:金牛座;3:双子座;4:巨蟹座;5:狮子座;6:处女座;7:天枰座;8:天蝎座;9:射手座;10:摩羯座;11:水瓶座;12:双鱼座)
myCont["isdoubleworker"] = userCont.Isdoubleworker //是否双职工(1:是;2:否)
myCont["isveterans"] = userCont.Isveterans //是否为退役军人(1:是;2:否)
myCont["veteransnumber"] = userCont.Veteransnumber //退役证编号
myCont["jobstartdate"] = userCont.Jobstartdate //参加工作日期
myCont["entrydate"] = userCont.Entrydate //入职日期
myCont["probationperiod"] = userCont.Probationperiod //试用期
myCont["planformaldate"] = userCont.Planformaldate //预计转正日期
myCont["political_outlook"] = userCont.PoliticalOutlook //政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员)
redisClient.HashMsetAdd(redisMyContKey, myCont)
publicmethod.Result(0, saveData, c)
}
//获取权限点位
func getRoleSeat(roleId string) (menuStr, buttonStr string) {
var roleInfo models.SystemRole
err := roleInfo.GetCont(map[string]interface{}{"r_id": roleId}, "r_menu_oper", "r_jurisdiction")
if err != nil {
return
}
menuStr = roleInfo.MenuOper
buttonStr = roleInfo.Jurisdiction
return
}
//退出登录
func (a *ApiMethod) SignOut(c *gin.Context) {
userKey := c.Request.Header.Get("user-key")
redisFileKey := fmt.Sprintf("ScanCode:Authentication:LoginApi_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userKey)
redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5)
userToken, isTrue := redisClient.HashGetAll(redisFileKey)
if isTrue == false {
publicmethod.Result(0, isTrue, c, "退出成功!")
return
}
// fmt.Printf("userToken----->%v\n", userToken)
_, err := publicmethod.GetUserRedisCont(userToken["usernumber"])
if err != nil {
redisClient.DelKey(redisFileKey)
publicmethod.Result(0, isTrue, c, "退出成功!")
return
}
redisClient.DelKey(redisFileKey)
redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userToken["usernumber"])
redisClient.DelKey(redisMyContKey)
publicmethod.Result(0, isTrue, c, "退出成功!")
}

187
.history/api/base/loginVerify/login_20220729082639.go

@ -0,0 +1,187 @@
package loginVerify
import (
"fmt"
"key_performance_indicators/middleware/grocerystore"
"key_performance_indicators/models"
"key_performance_indicators/overall"
"key_performance_indicators/overall/publicmethod"
"github.com/gin-gonic/gin"
)
func (a *ApiMethod) ScanCodeLogin(c *gin.Context) {
var requestData Login
c.ShouldBindJSON(&requestData)
if requestData.Username == "" {
publicmethod.Result(1, requestData, c, "请输入用户名!")
return
}
if requestData.Password == "" {
publicmethod.Result(1, requestData, c, "请输入密码!")
return
}
if requestData.Captcha == "" {
publicmethod.Result(1, requestData, c, "请输入验证码!")
return
}
// if store.Verify(requestData.CaptchaId, requestData.Captcha, true) != true {
// publicmethod.Result(1, requestData, c, "验证码不正确!")
// return
// }
userAgent := c.Request.Header.Get("User-Agent") // 获取用户代理
// userAgent = "250"
var md5JiaMiPwd publicmethod.Md5Encryption
md5JiaMiPwd.Md5EncryptionInit(requestData.Password)
md5TokenPwd := md5JiaMiPwd.Md5EncryptionAlgorithm()
// var oldAdmin OldSchollAdmin
// oldErr := overall.CONSTANT_DB_Master.Model(&models.SystemUser{}).Select("system_user.*,system_user_attribute.*").Joins("left join system_user_attribute on system_user.u_key = system_user_attribute.ua_id").Where("`u_name` = ? AND `u_password` = ?", requestData.Username, md5TokenPwd).First(&oldAdmin).Error
// if oldErr == nil {
// //原知行学院管理员账号登录
// }
//新的登录认证方式
var userCont models.ManCont
userErr := userCont.GetCont(map[string]interface{}{"number": requestData.Username, "password": md5TokenPwd})
if userErr != nil {
publicmethod.Result(2000, userErr, c)
return
}
if requestData.OpenId != "" {
var userInfo models.PersonArchives
userInfo.EiteCont(map[string]interface{}{"id": userCont.Id}, map[string]interface{}{"work_wechat": requestData.OpenId})
}
if userCont.State == 2 {
publicmethod.Result(1, userErr, c, "登陆失败! 该账号已经被禁用!")
return
}
if userCont.State == 3 {
publicmethod.Result(1, userErr, c, "登陆失败! 该账号不存在!")
return
}
var md5JiaMi publicmethod.Md5Encryption
md5JiaMi.Md5EncryptionInit(userAgent)
md5Token := md5JiaMi.Md5EncryptionAlgorithm()
var md5JiaMiNumber publicmethod.Md5Encryption
md5JiaMiNumber.Md5EncryptionInit(userCont.Number)
userKeyCode := md5JiaMiNumber.Md5EncryptionAlgorithm()
sha1Str := userKeyCode + userCont.Number + userCont.Password + md5Token
sha1Token := publicmethod.Sha1Encryption(sha1Str)
//返回值
saveData := publicmethod.MapOut[string]()
saveData["key"] = userKeyCode
saveData["token"] = sha1Token
saveData["userinfo"] = userCont
menuoper, jurisdiction := getRoleSeat(userCont.Role)
writeRedisData := map[string]interface{}{
"userkey": userKeyCode,
"key": userCont.Key,
"usernumber": userCont.Number,
"userpwd": userCont.Password,
"usertoken": sha1Token,
"jurisdiction": jurisdiction,
"menuOper": menuoper,
"wand": 118,
}
//API Token数据
redisFileKey := fmt.Sprintf("ScanCode:Authentication:LoginApi_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userKeyCode)
redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5)
redisClient.SetRedisTime(10800)
redisClient.HashMsetAdd(redisFileKey, writeRedisData)
//缓存写入个人信息
redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userCont.Number)
myCont := publicmethod.MapOut[string]()
myCont["id"] = userCont.Id
myCont["number"] = userCont.Number //员工工号
myCont["name"] = userCont.Name //姓名
myCont["icon"] = userCont.Icon //头像
myCont["hire_class"] = userCont.HireClass //雇佣类型(1:雇佣入职;2:再入职;)
myCont["emp_type"] = userCont.EmpType //用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职)
myCont["company"] = userCont.Company //入职公司
myCont["maindeparment"] = userCont.MainDeparment //主部门
myCont["sun_main_department"] = userCont.SunMainDeparment //二级主部门
myCont["deparment"] = userCont.Deparment //部门
myCont["admin_org"] = userCont.AdminOrg //所属行政组织
myCont["teamid"] = userCont.TeamId //班组
myCont["position"] = userCont.Position //职位
myCont["job_class"] = userCont.JobClass //职务分类
myCont["job_id"] = userCont.JobId //职务
myCont["job_leve"] = userCont.JobLeve //职务等级
myCont["wechat"] = userCont.Wechat //微信UserId
myCont["work_wechat"] = userCont.WorkWechat //企业微信UserId
myCont["state"] = userCont.State //状态(1:启用;2:禁用;3:删除)
myCont["key"] = userCont.Key //key
myCont["is_admin"] = userCont.IsAdmin //是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管
myCont["password"] = userCont.Password //密码
myCont["role"] = userCont.Role //角色
myCont["idcardno"] = userCont.Idcardno //身份证号
myCont["passportno"] = userCont.Passportno //护照号码
myCont["globalroaming"] = userCont.Globalroaming //国际区号
myCont["mobilephone"] = userCont.Mobilephone //手机号码
myCont["email"] = userCont.Email //电子邮件
myCont["gender"] = userCont.Gender //性别(1:男性;2:女性;3:中性)
myCont["birthday"] = userCont.Birthday //birthday
myCont["myfolk"] = userCont.Myfolk //民族
myCont["nativeplace"] = userCont.Nativeplace //籍贯
myCont["idcardstartdate"] = userCont.Idcardstartdate //身份证有效期开始
myCont["idcardenddate"] = userCont.Idcardenddate //身份证有效期结束
myCont["idcardaddress"] = userCont.Idcardaddress //身份证地址
myCont["idcardIssued"] = userCont.IdcardIssued //身份证签发机关
myCont["health"] = userCont.Health //健康状况(1:良好;2:一般;3:较弱,4:有生理缺陷;5:残废)
myCont["maritalstatus"] = userCont.Maritalstatus //婚姻状况(1:未婚;2:已婚;3:丧偶;4:离异)
myCont["internaltelephone"] = userCont.Internaltelephone //内线电话
myCont["currentresidence"] = userCont.Currentresidence //现居住地址
myCont["constellationing"] = userCont.Constellation //星座(1:白羊座;2:金牛座;3:双子座;4:巨蟹座;5:狮子座;6:处女座;7:天枰座;8:天蝎座;9:射手座;10:摩羯座;11:水瓶座;12:双鱼座)
myCont["isdoubleworker"] = userCont.Isdoubleworker //是否双职工(1:是;2:否)
myCont["isveterans"] = userCont.Isveterans //是否为退役军人(1:是;2:否)
myCont["veteransnumber"] = userCont.Veteransnumber //退役证编号
myCont["jobstartdate"] = userCont.Jobstartdate //参加工作日期
myCont["entrydate"] = userCont.Entrydate //入职日期
myCont["probationperiod"] = userCont.Probationperiod //试用期
myCont["planformaldate"] = userCont.Planformaldate //预计转正日期
myCont["political_outlook"] = userCont.PoliticalOutlook //政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员)
redisClient.HashMsetAdd(redisMyContKey, myCont)
publicmethod.Result(0, saveData, c)
}
//获取权限点位
func getRoleSeat(roleId string) (menuStr, buttonStr string) {
var roleInfo models.SystemRole
err := roleInfo.GetCont(map[string]interface{}{"r_id": roleId}, "r_menu_oper", "r_jurisdiction")
if err != nil {
return
}
menuStr = roleInfo.MenuOper
buttonStr = roleInfo.Jurisdiction
return
}
//退出登录
func (a *ApiMethod) SignOut(c *gin.Context) {
userKey := c.Request.Header.Get("user-key")
redisFileKey := fmt.Sprintf("ScanCode:Authentication:LoginApi_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userKey)
redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5)
userToken, isTrue := redisClient.HashGetAll(redisFileKey)
if isTrue == false {
publicmethod.Result(0, isTrue, c, "退出成功!")
return
}
// fmt.Printf("userToken----->%v\n", userToken)
_, err := publicmethod.GetUserRedisCont(userToken["usernumber"])
if err != nil {
redisClient.DelKey(redisFileKey)
publicmethod.Result(0, isTrue, c, "退出成功!")
return
}
redisClient.DelKey(redisFileKey)
redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userToken["usernumber"])
redisClient.DelKey(redisMyContKey)
publicmethod.Result(0, isTrue, c, "退出成功!")
}

188
.history/api/base/loginVerify/login_20220729082930.go

@ -0,0 +1,188 @@
package loginVerify
import (
"fmt"
"key_performance_indicators/middleware/grocerystore"
"key_performance_indicators/models"
"key_performance_indicators/overall"
"key_performance_indicators/overall/publicmethod"
"github.com/gin-gonic/gin"
)
func (a *ApiMethod) ScanCodeLogin(c *gin.Context) {
var requestData Login
c.ShouldBindJSON(&requestData)
if requestData.Username == "" {
publicmethod.Result(1, requestData, c, "请输入用户名!")
return
}
if requestData.Password == "" {
publicmethod.Result(1, requestData, c, "请输入密码!")
return
}
if requestData.Captcha == "" {
publicmethod.Result(1, requestData, c, "请输入验证码!")
return
}
// if store.Verify(requestData.CaptchaId, requestData.Captcha, true) != true {
// publicmethod.Result(1, requestData, c, "验证码不正确!")
// return
// }
userAgent := c.Request.Header.Get("User-Agent") // 获取用户代理
// userAgent = "250"
var md5JiaMiPwd publicmethod.Md5Encryption
md5JiaMiPwd.Md5EncryptionInit(requestData.Password)
md5TokenPwd := md5JiaMiPwd.Md5EncryptionAlgorithm()
// var oldAdmin OldSchollAdmin
// oldErr := overall.CONSTANT_DB_Master.Model(&models.SystemUser{}).Select("system_user.*,system_user_attribute.*").Joins("left join system_user_attribute on system_user.u_key = system_user_attribute.ua_id").Where("`u_name` = ? AND `u_password` = ?", requestData.Username, md5TokenPwd).First(&oldAdmin).Error
// if oldErr == nil {
// //原知行学院管理员账号登录
// }
//新的登录认证方式
var userCont models.ManCont
userErr := userCont.GetCont(map[string]interface{}{"number": requestData.Username, "password": md5TokenPwd})
if userErr != nil {
publicmethod.Result(2000, userErr, c)
return
}
if requestData.OpenId != "" {
var userInfo models.PersonArchives
userInfo.EiteCont(map[string]interface{}{"id": userCont.Id}, map[string]interface{}{"work_wechat": requestData.OpenId})
}
if userCont.State == 2 {
publicmethod.Result(1, userErr, c, "登陆失败! 该账号已经被禁用!")
return
}
if userCont.State == 3 {
publicmethod.Result(1, userErr, c, "登陆失败! 该账号不存在!")
return
}
var md5JiaMi publicmethod.Md5Encryption
md5JiaMi.Md5EncryptionInit(userAgent)
md5Token := md5JiaMi.Md5EncryptionAlgorithm()
var md5JiaMiNumber publicmethod.Md5Encryption
md5JiaMiNumber.Md5EncryptionInit(userCont.Number)
userKeyCode := md5JiaMiNumber.Md5EncryptionAlgorithm()
sha1Str := userKeyCode + userCont.Number + userCont.Password + md5Token
sha1Token := publicmethod.Sha1Encryption(sha1Str)
//返回值
saveData := publicmethod.MapOut[string]()
saveData["key"] = userKeyCode
saveData["token"] = sha1Token
saveData["userinfo"] = userCont
menuoper, jurisdiction := getRoleSeat(userCont.Role)
writeRedisData := map[string]interface{}{
"userkey": userKeyCode,
"key": userCont.Key,
"usernumber": userCont.Number,
"userpwd": userCont.Password,
"usertoken": sha1Token,
"jurisdiction": jurisdiction,
"menuOper": menuoper,
"wand": 118,
}
//API Token数据
redisFileKey := fmt.Sprintf("ScanCode:Authentication:LoginApi_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userKeyCode)
redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5)
redisClient.SetRedisTime(10800)
redisClient.HashMsetAdd(redisFileKey, writeRedisData)
//缓存写入个人信息
redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userCont.Number)
myCont := publicmethod.MapOut[string]()
myCont["id"] = userCont.Id
myCont["number"] = userCont.Number //员工工号
myCont["name"] = userCont.Name //姓名
myCont["icon"] = userCont.Icon //头像
myCont["hire_class"] = userCont.HireClass //雇佣类型(1:雇佣入职;2:再入职;)
myCont["emp_type"] = userCont.EmpType //用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职)
myCont["company"] = userCont.Company //入职公司
myCont["maindeparment"] = userCont.MainDeparment //主部门
myCont["sun_main_department"] = userCont.SunMainDeparment //二级主部门
myCont["deparment"] = userCont.Deparment //部门
myCont["admin_org"] = userCont.AdminOrg //所属行政组织
myCont["teamid"] = userCont.TeamId //班组
myCont["position"] = userCont.Position //职位
myCont["job_class"] = userCont.JobClass //职务分类
myCont["job_id"] = userCont.JobId //职务
myCont["job_leve"] = userCont.JobLeve //职务等级
myCont["wechat"] = userCont.Wechat //微信UserId
myCont["work_wechat"] = userCont.WorkWechat //企业微信UserId
myCont["state"] = userCont.State //状态(1:启用;2:禁用;3:删除)
myCont["key"] = userCont.Key //key
myCont["is_admin"] = userCont.IsAdmin //是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管
myCont["password"] = userCont.Password //密码
myCont["role"] = userCont.Role //角色
myCont["idcardno"] = userCont.Idcardno //身份证号
myCont["passportno"] = userCont.Passportno //护照号码
myCont["globalroaming"] = userCont.Globalroaming //国际区号
myCont["mobilephone"] = userCont.Mobilephone //手机号码
myCont["email"] = userCont.Email //电子邮件
myCont["gender"] = userCont.Gender //性别(1:男性;2:女性;3:中性)
myCont["birthday"] = userCont.Birthday //birthday
myCont["myfolk"] = userCont.Myfolk //民族
myCont["nativeplace"] = userCont.Nativeplace //籍贯
myCont["idcardstartdate"] = userCont.Idcardstartdate //身份证有效期开始
myCont["idcardenddate"] = userCont.Idcardenddate //身份证有效期结束
myCont["idcardaddress"] = userCont.Idcardaddress //身份证地址
myCont["idcardIssued"] = userCont.IdcardIssued //身份证签发机关
myCont["health"] = userCont.Health //健康状况(1:良好;2:一般;3:较弱,4:有生理缺陷;5:残废)
myCont["maritalstatus"] = userCont.Maritalstatus //婚姻状况(1:未婚;2:已婚;3:丧偶;4:离异)
myCont["internaltelephone"] = userCont.Internaltelephone //内线电话
myCont["currentresidence"] = userCont.Currentresidence //现居住地址
myCont["constellationing"] = userCont.Constellation //星座(1:白羊座;2:金牛座;3:双子座;4:巨蟹座;5:狮子座;6:处女座;7:天枰座;8:天蝎座;9:射手座;10:摩羯座;11:水瓶座;12:双鱼座)
myCont["isdoubleworker"] = userCont.Isdoubleworker //是否双职工(1:是;2:否)
myCont["isveterans"] = userCont.Isveterans //是否为退役军人(1:是;2:否)
myCont["veteransnumber"] = userCont.Veteransnumber //退役证编号
myCont["jobstartdate"] = userCont.Jobstartdate //参加工作日期
myCont["entrydate"] = userCont.Entrydate //入职日期
myCont["probationperiod"] = userCont.Probationperiod //试用期
myCont["planformaldate"] = userCont.Planformaldate //预计转正日期
myCont["political_outlook"] = userCont.PoliticalOutlook //政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员)
redisClient.HashMsetAdd(redisMyContKey, myCont)
publicmethod.Result(0, saveData, c)
}
//获取权限点位
func getRoleSeat(roleId string) (menuStr, buttonStr string) {
var roleInfo models.SystemRole
err := roleInfo.GetCont(map[string]interface{}{"r_id": roleId}, "r_menu_oper", "r_jurisdiction")
if err != nil {
return
}
menuStr = roleInfo.MenuOper
buttonStr = roleInfo.Jurisdiction
return
}
//退出登录
func (a *ApiMethod) SignOut(c *gin.Context) {
userKey := c.Request.Header.Get("user-key")
redisFileKey := fmt.Sprintf("ScanCode:Authentication:LoginApi_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userKey)
redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5)
userToken, isTrue := redisClient.HashGetAll(redisFileKey)
if isTrue == false {
publicmethod.Result(0, isTrue, c, "退出成功!")
return
}
// fmt.Printf("userToken----->%v\n", userToken)
_, err := publicmethod.GetUserRedisCont(userToken["usernumber"])
if err != nil {
redisClient.DelKey(redisFileKey)
publicmethod.Result(0, isTrue, c, "退出成功!")
return
}
redisClient.DelKey(redisFileKey)
redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userToken["usernumber"])
redisClient.DelKey(redisMyContKey)
publicmethod.Result(0, isTrue, c, "退出成功!")
}

0
.history/api/myTest/entry_20220728105227.go

2
.history/api/myTest/entry_20220728105240.go

@ -0,0 +1,2 @@
package mytest

5
.history/api/myTest/entry_20220728131248.go

@ -0,0 +1,5 @@
package mytest
type ApiEntry struct{
}

5
.history/api/myTest/entry_20220728131253.go

@ -0,0 +1,5 @@
package mytest
type ApiEntry struct{
Test
}

7
.history/api/myTest/entry_20220728131257.go

@ -0,0 +1,7 @@
package mytest
import mytest "key_performance_indicators/apirouter/myTest"
type ApiEntry struct {
Test mytest.
}

7
.history/api/myTest/entry_20220728131258.go

@ -0,0 +1,7 @@
package mytest
import mytest "key_performance_indicators/apirouter/myTest"
type ApiEntry struct {
Test mytest.TestApi
}

7
.history/api/myTest/entry_20220728131321.go

@ -0,0 +1,7 @@
package mytest
import mytest "key_performance_indicators/apirouter/myTest"
type ApiEntry struct {
Test my
}

7
.history/api/myTest/entry_20220728131324.go

@ -0,0 +1,7 @@
package mytest
import mytest "key_performance_indicators/apirouter/myTest"
type ApiEntry struct {
Test mytest.TestApi
}

7
.history/api/myTest/entry_20220728131403.go

@ -0,0 +1,7 @@
package mytest
import mytest "key_performance_indicators/apirouter/myTest"
type ApiEntry struct {
Test my
}

7
.history/api/myTest/entry_20220728131405.go

@ -0,0 +1,7 @@
package mytest
import mytest "key_performance_indicators/apirouter/myTest"
type ApiEntry struct {
Test
}

7
.history/api/myTest/entry_20220728131417.go

@ -0,0 +1,7 @@
package mytest
import mytest "key_performance_indicators/apirouter/myTest"
type ApiEntry struct {
Test
}

7
.history/api/myTest/entry_20220728131419.go

@ -0,0 +1,7 @@
package mytest
import mytest "key_performance_indicators/apirouter/myTest"
type ApiEntry struct {
Test tes
}

7
.history/api/myTest/entry_20220728131425.go

@ -0,0 +1,7 @@
package mytest
import mytest "key_performance_indicators/apirouter/myTest"
type ApiEntry struct {
Test mytestroute
}

7
.history/api/myTest/entry_20220728131426.go

@ -0,0 +1,7 @@
package mytest
import mytest "key_performance_indicators/apirouter/myTest"
type ApiEntry struct {
Test mytestroute.
}

7
.history/api/myTest/entry_20220728131430.go

@ -0,0 +1,7 @@
package mytest
import mytest "key_performance_indicators/apirouter/myTest"
type ApiEntry struct {
Test mytestroute.mytestroute
}

7
.history/api/myTest/entry_20220728131433.go

@ -0,0 +1,7 @@
package mytest
import mytest "key_performance_indicators/apirouter/myTest"
type ApiEntry struct {
Test mytestroute.
}

5
.history/api/myTest/entry_20220728131437.go

@ -0,0 +1,5 @@
package mytest
type ApiEntry struct {
Test mytestroute.ApiMethod
}

6
.history/api/myTest/entry_20220728131449.go

@ -0,0 +1,6 @@
package mytest
type ApiEntry struct {
Test mytestroute.ApiMethod
}

7
.history/api/myTest/entry_20220728131502.go

@ -0,0 +1,7 @@
package mytest
import
type ApiEntry struct {
Test mytestroute.ApiMethod
}

7
.history/api/myTest/entry_20220728131506.go

@ -0,0 +1,7 @@
package mytest
import
type ApiEntry struct {
Test mytestroute.ApiMethod
}

7
.history/api/myTest/entry_20220728131512.go

@ -0,0 +1,7 @@
package mytest
import "api."
type ApiEntry struct {
Test mytestroute.ApiMethod
}

7
.history/api/myTest/entry_20220728131518.go

@ -0,0 +1,7 @@
package mytest
import ""
type ApiEntry struct {
Test mytestroute.ApiMethod
}

7
.history/api/myTest/entry_20220728131526.go

@ -0,0 +1,7 @@
package mytest
import "key_performance_indicators/api/"
type ApiEntry struct {
Test mytestroute.ApiMethod
}

7
.history/api/myTest/entry_20220728131528.go

@ -0,0 +1,7 @@
package mytest
import "key_performance_indicators/api/My"
type ApiEntry struct {
Test mytestroute.ApiMethod
}

7
.history/api/myTest/entry_20220728131533.go

@ -0,0 +1,7 @@
package mytest
import "key_performance_indicators/api/myt"
type ApiEntry struct {
Test mytestroute.ApiMethod
}

7
.history/api/myTest/entry_20220728131536.go

@ -0,0 +1,7 @@
package mytest
import "key_performance_indicators/api/myTest/"
type ApiEntry struct {
Test mytestroute.ApiMethod
}

7
.history/api/myTest/entry_20220728131545.go

@ -0,0 +1,7 @@
package mytest
import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
Test mytestroute.ApiMethod
}

7
.history/api/myTest/entry_20220728131546.go

@ -0,0 +1,7 @@
package mytest
import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
Test mytestroute.ApiMethod
}

7
.history/api/myTest/entry_20220728131554.go

@ -0,0 +1,7 @@
package mytest
import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
Test mytestroute.ApiMethod
}

7
.history/api/myTest/entry_20220728131601.go

@ -0,0 +1,7 @@
package mytest
import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
Test mytestroute.ApiMethod
}

7
.history/api/myTest/entry_20220728131744.go

@ -0,0 +1,7 @@
package mytest
// import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
Test mytestroute.ApiMethod
}

8
.history/api/myTest/entry_20220728131746.go

@ -0,0 +1,8 @@
package mytest
// import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
// Test mytestroute.ApiMethod
}

8
.history/api/myTest/entry_20220728131748.go

@ -0,0 +1,8 @@
package mytest
// import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
// Test mytestroute.ApiMethod
}

8
.history/api/myTest/entry_20220728131753.go

@ -0,0 +1,8 @@
package mytest
// import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
// Test mytestroute.ApiMethod
MapToStructApi maptostruct.ApiMethod
}

8
.history/api/myTest/entry_20220728131801.go

@ -0,0 +1,8 @@
package mytest
// import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
// Test mytestroute.ApiMethod
}

8
.history/api/myTest/entry_20220728131804.go

@ -0,0 +1,8 @@
package mytest
// import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
// Test mytestroute.ApiMethod
}

8
.history/api/myTest/entry_20220728131807.go

@ -0,0 +1,8 @@
package mytest
// import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
// Test mytestroute.ApiMethod
my
}

10
.history/api/myTest/entry_20220728131808.go

@ -0,0 +1,10 @@
package mytest
import mytest "key_performance_indicators/apirouter/myTest"
// import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
// Test mytestroute.ApiMethod
mytest
}

10
.history/api/myTest/entry_20220728131815.go

@ -0,0 +1,10 @@
package mytest
import mytest "key_performance_indicators/apirouter/myTest"
// import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
// Test mytestroute.ApiMethod
mytest.
}

8
.history/api/myTest/entry_20220728131817.go

@ -0,0 +1,8 @@
package mytest
// import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
// Test mytestroute.ApiMethod
}

8
.history/api/myTest/entry_20220728131824.go

@ -0,0 +1,8 @@
package mytest
// import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
// Test mytestroute.ApiMethod
my
}

8
.history/api/myTest/entry_20220728131827.go

@ -0,0 +1,8 @@
package mytest
// import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
// Test mytestroute.ApiMethod
}

8
.history/api/myTest/entry_20220728132012.go

@ -0,0 +1,8 @@
package mytest
// import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
// Test mytestroute.ApiMethod
t
}

8
.history/api/myTest/entry_20220728132014.go

@ -0,0 +1,8 @@
package mytest
// import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
// Test mytestroute.ApiMethod
test
}

8
.history/api/myTest/entry_20220728132015.go

@ -0,0 +1,8 @@
package mytest
// import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
// Test mytestroute.ApiMethod
testr
}

8
.history/api/myTest/entry_20220728132025.go

@ -0,0 +1,8 @@
package mytest
// import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
// Test mytestroute.ApiMethod
testroute.
}

10
.history/api/myTest/entry_20220728132027.go

@ -0,0 +1,10 @@
package mytest
import testroute "key_performance_indicators/api/myTest/testRoute"
// import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
// Test mytestroute.ApiMethod
testroute.ApiMethod
}

10
.history/api/myTest/entry_20220728132028.go

@ -0,0 +1,10 @@
package mytest
import testroute "key_performance_indicators/api/myTest/testRoute"
// import "key_performance_indicators/api/myTest/mytestroute"
type ApiEntry struct {
// Test mytestroute.ApiMethod
testroute.ApiMethod
}

9
.history/api/myTest/entry_20220728132032.go

@ -0,0 +1,9 @@
package mytest
import testroute "key_performance_indicators/api/myTest/testRoute"
type ApiEntry struct {
// Test mytestroute.ApiMethod
testroute.ApiMethod
}

9
.history/api/myTest/entry_20220728132035.go

@ -0,0 +1,9 @@
package mytest
import testroute "key_performance_indicators/api/myTest/testRoute"
type ApiEntry struct {
// Test mytestroute.ApiMethod
Test testroute.ApiMethod
}

7
.history/api/myTest/entry_20220728132036.go

@ -0,0 +1,7 @@
package mytest
import testroute "key_performance_indicators/api/myTest/testRoute"
type ApiEntry struct {
Test testroute.ApiMethod
}

7
.history/api/myTest/entry_20220728132039.go

@ -0,0 +1,7 @@
package mytest
import testroute "key_performance_indicators/api/myTest/testRoute"
type ApiEntry struct {
Test testroute.ApiMethod
}

10
.history/api/myTest/entry_20220728132049.go

@ -0,0 +1,10 @@
package mytest
import testroute "key_performance_indicators/api/myTest/testRoute"
type ApiEntry struct {
Test testroute.ApiMethod
}
var

10
.history/api/myTest/entry_20220728132052.go

@ -0,0 +1,10 @@
package mytest
import testroute "key_performance_indicators/api/myTest/testRoute"
type ApiEntry struct {
Test testroute.ApiMethod
}
var app

10
.history/api/myTest/entry_20220728132055.go

@ -0,0 +1,10 @@
package mytest
import testroute "key_performance_indicators/api/myTest/testRoute"
type ApiEntry struct {
Test testroute.ApiMethod
}
var AppApiEntry = new()

9
.history/api/myTest/entry_20220728132057.go

@ -0,0 +1,9 @@
package mytest
import testroute "key_performance_indicators/api/myTest/testRoute"
type ApiEntry struct {
Test testroute.ApiMethod
}
var AppApiEntry = new(ApiEntry)

0
.history/api/myTest/testRoute/testroute_20220728105311.go

1
.history/api/myTest/testRoute/testroute_20220728105316.go

@ -0,0 +1 @@
pa

1
.history/api/myTest/testRoute/testroute_20220728105323.go

@ -0,0 +1 @@
package mytset

1
.history/api/myTest/testRoute/testroute_20220728105330.go

@ -0,0 +1 @@
package mytest

2
.history/api/myTest/testRoute/testroute_20220728105333.go

@ -0,0 +1,2 @@
package mytest

2
.history/api/myTest/testRoute/testroute_20220728105444.go

@ -0,0 +1,2 @@
package mytestr

2
.history/api/myTest/testRoute/testroute_20220728105447.go

@ -0,0 +1,2 @@
package mytestroute

1
.history/api/myTest/testRoute/testroute_20220728131912.go

@ -0,0 +1 @@
package

0
.history/api/myTest/testRoute/testroute_20220728131914.go

1
.history/api/myTest/testRoute/testroute_20220728131924.go

@ -0,0 +1 @@
pa

1
.history/api/myTest/testRoute/testroute_20220728131927.go

@ -0,0 +1 @@
package

1
.history/api/myTest/testRoute/testroute_20220728131929.go

@ -0,0 +1 @@
package

1
.history/api/myTest/testRoute/testroute_20220728131953.go

@ -0,0 +1 @@
p

2
.history/api/myTest/testRoute/testroute_20220728131959.go

@ -0,0 +1,2 @@
package testroute

1
.history/api/myTest/testRoute/testroute_20220728132003.go

@ -0,0 +1 @@
package testroute

1
.history/api/myTest/testRoute/testroute_20220728132005.go

@ -0,0 +1 @@
package testroute

3
.history/api/myTest/testRoute/testroute_20220728132229.go

@ -0,0 +1,3 @@
package testroute
func

3
.history/api/myTest/testRoute/testroute_20220728132232.go

@ -0,0 +1,3 @@
package testroute
func ()

3
.history/api/myTest/testRoute/testroute_20220728132241.go

@ -0,0 +1,3 @@
package testroute
func (ApiMethod)

3
.history/api/myTest/testRoute/testroute_20220728132242.go

@ -0,0 +1,3 @@
package testroute
func (ApiMethod)

3
.history/api/myTest/testRoute/testroute_20220728132245.go

@ -0,0 +1,3 @@
package testroute
func (a*ApiMethod)

3
.history/api/myTest/testRoute/testroute_20220728132247.go

@ -0,0 +1,3 @@
package testroute
func (a *ApiMethod)

3
.history/api/myTest/testRoute/testroute_20220728132255.go

@ -0,0 +1,3 @@
package testroute
func (a *ApiMethod)MyTest()

3
.history/api/myTest/testRoute/testroute_20220728132257.go

@ -0,0 +1,3 @@
package testroute
func (a *ApiMethod)MyTest(c)

3
.history/api/myTest/testRoute/testroute_20220728132259.go

@ -0,0 +1,3 @@
package testroute
func (a *ApiMethod)MyTest(ctx )

5
.history/api/myTest/testRoute/testroute_20220728132302.go

@ -0,0 +1,5 @@
package testroute
import "github.com/gin-gonic/gin"
func (a *ApiMethod) MyTest(ctx *gin.Context)

7
.history/api/myTest/testRoute/testroute_20220728132308.go

@ -0,0 +1,7 @@
package testroute
import "github.com/gin-gonic/gin"
func (a *ApiMethod) MyTest(ctx *gin.Context) {
}

7
.history/api/myTest/testRoute/testroute_20220728132309.go

@ -0,0 +1,7 @@
package testroute
import "github.com/gin-gonic/gin"
func (a *ApiMethod) MyTest(ctx *gin.Context) {
}

7
.history/api/myTest/testRoute/testroute_20220728132322.go

@ -0,0 +1,7 @@
package testroute
import "github.com/gin-gonic/gin"
func (a *ApiMethod) MyTest(ctx *gin.Context) {
ctx.get
}

7
.history/api/myTest/testRoute/testroute_20220728132324.go

@ -0,0 +1,7 @@
package testroute
import "github.com/gin-gonic/gin"
func (a *ApiMethod) MyTest(ctx *gin.Context) {
ctx.Qu
}

7
.history/api/myTest/testRoute/testroute_20220728132325.go

@ -0,0 +1,7 @@
package testroute
import "github.com/gin-gonic/gin"
func (a *ApiMethod) MyTest(ctx *gin.Context) {
ctx.Query()
}

7
.history/api/myTest/testRoute/testroute_20220728132327.go

@ -0,0 +1,7 @@
package testroute
import "github.com/gin-gonic/gin"
func (a *ApiMethod) MyTest(ctx *gin.Context) {
ctx.Query("name")
}

7
.history/api/myTest/testRoute/testroute_20220728132332.go

@ -0,0 +1,7 @@
package testroute
import "github.com/gin-gonic/gin"
func (a *ApiMethod) MyTest(ctx *gin.Context) {
name := ctx.Query("name")
}

8
.history/api/myTest/testRoute/testroute_20220728132343.go

@ -0,0 +1,8 @@
package testroute
import "github.com/gin-gonic/gin"
func (a *ApiMethod) MyTest(ctx *gin.Context) {
name := ctx.Query("name")
age := ctx.Query("age")
}

8
.history/api/myTest/testRoute/testroute_20220728132344.go

@ -0,0 +1,8 @@
package testroute
import "github.com/gin-gonic/gin"
func (a *ApiMethod) MyTest(ctx *gin.Context) {
name := ctx.Query("name")
age := ctx.Query("age")
}

10
.history/api/myTest/testRoute/testroute_20220728132348.go

@ -0,0 +1,10 @@
package testroute
import "github.com/gin-gonic/gin"
func (a *ApiMethod) MyTest(ctx *gin.Context) {
name := ctx.Query("name")
age := ctx.Query("age")
}

10
.history/api/myTest/testRoute/testroute_20220728132353.go

@ -0,0 +1,10 @@
package testroute
import "github.com/gin-gonic/gin"
func (a *ApiMethod) MyTest(ctx *gin.Context) {
name := ctx.Query("name")
age := ctx.Query("age")
var
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save