user.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. package entity
  2. import (
  3. "encoding/json"
  4. "fmt"
  5. "log"
  6. "strconv"
  7. "strings"
  8. "sync"
  9. "time"
  10. "github.com/zeromicro/go-zero/core/logx"
  11. MC "app.yhyue.com/moapp/jybase/common"
  12. "app.yhyue.com/moapp/jybase/redis"
  13. )
  14. const (
  15. RedisCode = "newother"
  16. RedisMenuKey = "jy_workdesktopmenu_%s_%s_%s"
  17. UserPowerRedisKey = "jy_userpowerredis_%s_%d_%s"
  18. UserRegisterTime = "jy_userregistertime_%s"
  19. UserPowerEndTime = "jy_user_power_end_time_%s"
  20. CheckEntKK = "check_ent_kk_%s"
  21. )
  22. type UserInfo struct {
  23. Capitals map[string]int
  24. Permissions map[string]int
  25. Lock *sync.Mutex
  26. }
  27. var (
  28. CapitalRetention = "capital_retention"
  29. OverallLock = &sync.Mutex{}
  30. UserInfoMap = map[int64]*UserInfo{}
  31. UserRolePowers = map[string][]string{}
  32. )
  33. /*
  34. *待调整 调整为存redis
  35. *测试用例放的地方不对 待调整
  36. */
  37. // AutoUserPowerInfo 用户权限 初始化
  38. func (m *WorkDesktopMenu) AutoUserPowerInfo() map[string]int {
  39. /*
  40. * 商机管理--》新版商机管理vs老版商机管理
  41. * 大会员--》bigmember_service
  42. * 超级订阅--》新版超级订阅vs老版超级订阅
  43. * 免费用户--》新免费用户
  44. */
  45. /*
  46. * P278 用户身份切换
  47. * 用户权益 通过 权益中台rpc获取
  48. * 用户资源 通过 资源中台rpc获取
  49. */
  50. var UserPowerMap = map[string]int{}
  51. //redis newother 查询是否存在用户功能信息
  52. userPowerRedisKey := fmt.Sprintf(UserPowerRedisKey, m.AppId, time.Now().Day(), m.UserId)
  53. bytes, err := redis.GetBytes(RedisCode, userPowerRedisKey)
  54. if err == nil && len(*bytes) > 0 {
  55. if err = json.Unmarshal(*bytes, &UserPowerMap); err == nil {
  56. return UserPowerMap
  57. }
  58. }
  59. //数据库查询 、资源中台获取、权益中台获取 查询用户信息
  60. var (
  61. registerTime int64
  62. powerEndTime int64
  63. )
  64. //以上获取不到的信息 再自主查库
  65. userInfoRpc := UserInfoRpc{
  66. AppId: m.AppId,
  67. UserId: m.UserId,
  68. BaseUserId: m.NewUserId,
  69. EntId: m.EntId,
  70. EntUserId: m.EntUserId,
  71. AccountId: m.AccountId,
  72. EntAccountId: m.EntAccountId,
  73. PositionType: m.PositionType,
  74. PositionId: m.PositionId,
  75. MgoUserId: m.MgoUserId,
  76. }
  77. logx.Info(m.MgoUserId, m.PositionId, "------------------userInfoRpc-------------------------:", userInfoRpc)
  78. //权益中台获取权益
  79. userPowers := userInfoRpc.GetUserPowers()
  80. if userPowers != nil {
  81. logx.Info(userInfoRpc.MgoUserId, "------------userPowers:", userPowers)
  82. //注册时间
  83. registerTime = userPowers.Free.Registedate
  84. //大会员
  85. member := userPowers.Member
  86. //超级订阅
  87. vip := userPowers.Vip
  88. //企业信息
  89. entInfo := userPowers.Ent
  90. //商机管理
  91. entNiche := userPowers.Entniche
  92. //免费用户
  93. free := userPowers.Free
  94. if member.Status > 0 || ConfigJson.BigMemberOff {
  95. if member.Status > 0 {
  96. UserPowerMap["0"] = int(member.Status)
  97. UserPowerMap[strconv.Itoa(50+int(member.Status))] = 1
  98. //此处 如果 member.Status >7,和 下面58 会有冲突
  99. //人员行为统计菜单-1、购买大会员且创建了企业的管理员;2、新版商机管理管理员;3、商机管理服务管理员
  100. UserPowerMap["50"] = 1 //
  101. if entInfo.EntRoleId == 1 {
  102. UserPowerMap["58"] = 1 //企业管理员
  103. } else if entInfo.EntRoleId == 2 {
  104. UserPowerMap["59"] = 1 // 部门管理员
  105. }
  106. powerEndTime = member.EndTime
  107. }
  108. //大会员用户购买的服务 也有可能是非大会员用户 购买这些服务
  109. if member.MemberPowerList != nil && len(member.MemberPowerList) > 0 {
  110. for _, mp := range member.MemberPowerList {
  111. UserPowerMap[strconv.FormatInt(mp, 10)] = MC.If(member.Status > 0, int(member.Status), 1).(int)
  112. }
  113. }
  114. }
  115. if vip.Status > 0 {
  116. //
  117. if powerEndTime < vip.EndTime {
  118. powerEndTime = vip.EndTime
  119. }
  120. UserPowerMap["200"] = int(vip.Status)
  121. UserPowerMap["201"] = int(vip.Upgrade)
  122. //
  123. if vip.Upgrade > 0 && member.Status < 1 {
  124. UserPowerMap["202"] = int(vip.Status)
  125. }
  126. if entInfo.EntRoleId == 1 {
  127. UserPowerMap["203"] = 1 //企业管理员
  128. } else if entInfo.EntRoleId == 2 {
  129. UserPowerMap["204"] = 1 //部门管理员
  130. }
  131. }
  132. //企业信息
  133. if m.EntId > 0 {
  134. UserPowerMap["702"] = 1
  135. //机构中心 由企业 且 是企业版
  136. //m.PositionType 肯定大于 0; 702 和 901 是同样的权限。
  137. if m.PositionType > 0 {
  138. UserPowerMap["901"] = 1
  139. }
  140. //P386
  141. switch entInfo.EntRoleId {
  142. case 1: //企业管理员
  143. UserPowerMap["902"] = 1
  144. case 2: //部门管理员
  145. UserPowerMap["903"] = 1
  146. }
  147. }
  148. if entNiche.Status > 0 && entNiche.IsEntPower > 0 {
  149. //entInfo.EntRoleId 1:企业管理员 2:部门管理员
  150. //管理员 entInfo.EntRoleId>0 并不一定 entNiche.IsEntPower==1,entNiche.IsEntPower==0 也有权限(已废除)
  151. //管理员he员工被分配后 entNiche.IsEntPower==1否则没有权限
  152. //if entNiche.IsEntPower > 0 || entInfo.EntRoleId > 0{//(已废除)
  153. //商机管理服务 P259需求
  154. //有商机管理服务 不会再有商机管理订阅菜单
  155. //商机管理服务,上次陈老师说叫“企业管理服务”,不然和商机管理产品容易混淆-- 杨蘭 2022/12/14
  156. switch entNiche.PowerSource {
  157. case 0:
  158. switch entNiche.IsNew {
  159. case 1: //新版商机管理
  160. UserPowerMap["110"] = 1
  161. switch entInfo.EntRoleId {
  162. case 2: //部门管理员
  163. UserPowerMap["111"] = 1
  164. case 1: //企业管理员
  165. UserPowerMap["112"] = 1
  166. }
  167. case 0: //老版商机管理
  168. UserPowerMap["100"] = 1
  169. switch entInfo.EntRoleId {
  170. case 2: //部门管理员
  171. UserPowerMap["101"] = 1
  172. case 1: //企业管理员
  173. UserPowerMap["102"] = 1
  174. }
  175. //老版商机管理: model:1-统一订阅,2-个人订阅
  176. if entNiche.Model == 1 {
  177. UserPowerMap["103"] = 1
  178. } else if entNiche.Model == 2 {
  179. UserPowerMap["104"] = 1
  180. }
  181. }
  182. case 1:
  183. //客户管理服务(商机管理服务) [前提:大会员、超级订阅、医械通用户]---免费用户也可以用 (需求调整来自刘苗:产品已确认)
  184. UserPowerMap["600"] = 1
  185. switch entInfo.EntRoleId {
  186. case 2: //部门管理员
  187. UserPowerMap["602"] = 1
  188. case 1: //企业管理员
  189. UserPowerMap["601"] = 1
  190. }
  191. //}
  192. }
  193. }
  194. if free.IsFree {
  195. UserPowerMap["300"] = 1
  196. if free.IsUpgrade {
  197. //新免费用户
  198. UserPowerMap["301"] = MC.If(free.IsUpgrade, 1, 0).(int)
  199. }
  200. //P386
  201. switch entInfo.EntRoleId {
  202. case 1: //企业管理员
  203. UserPowerMap["302"] = 1
  204. case 2: //部门管理员
  205. UserPowerMap["303"] = 1
  206. }
  207. }
  208. //----------其他-----------
  209. //广东移动DICT
  210. if entInfo.PrivateGD {
  211. UserPowerMap["400"] = 1
  212. }
  213. //人员行为统计菜单-1、购买大会员且创建了企业的管理员;2、新版商机管理管理员;3、商机管理服务管理员
  214. //必须是企业管理员-&-购买了企业级应用服务
  215. //企业级服务 权限管理(只有企业管理员有权限)
  216. entService := entInfo.BuyMember > 0 || entInfo.BuyVip > 0 || entInfo.Services //P386: 只要购买了企业级产品 且是企业管理员 就有>> 权限管理
  217. if entService {
  218. if entInfo.EntRoleId == 1 {
  219. UserPowerMap["700"] = 1
  220. } else if entInfo.EntRoleId == 2 {
  221. //企业级服务 部门管理员
  222. UserPowerMap["703"] = 1
  223. }
  224. }
  225. //企业级服务 企业订阅--
  226. //1、存在未到期的购买主体为“企业”切购买产品为大会员或者超级订阅的部门管理员或企业管理员;c > 0
  227. //2、存在未到期的老版或者新版商机管理的企业管理员或部门管理员(非商机管理服务)。entnicheIsNew > -1 && powerSource == 0
  228. if entInfo.EntSubscribe > 0 {
  229. UserPowerMap["701"] = 1
  230. }
  231. //领域化产品权限
  232. //第一版:必须是大会员或者超级订阅用户 且留资 留资表:capital_retention;source = 'medical_domain',未留资提示留资信息
  233. //第二版:调资源中台rpc获取用户是否有使用领域化产品的权限 无权限则去购买
  234. //需求调整:
  235. //1:是否是大会员或者超级订阅用户 否:提示购买到超级订阅购买页; 是>-2
  236. //2:判断用户是否留资 否:提示用去留资;是:>-3
  237. //3:资源中台获取用户权限码判断是否有权限 否:提示用户去联系客服
  238. userRegisterTimeKey := fmt.Sprintf(UserRegisterTime, m.UserId)
  239. redis.Put(RedisCode, userRegisterTimeKey, strconv.Itoa(int(registerTime)), int(registerTime))
  240. if member.Status > 0 || vip.Status > 0 {
  241. userPowerEndTimeKey := fmt.Sprintf(UserPowerEndTime, m.UserId)
  242. redis.Put(RedisCode, userPowerEndTimeKey, strconv.Itoa(int(powerEndTime)), int(powerEndTime))
  243. UserPowerMap["500"] = 1
  244. }
  245. }
  246. //资源中台获取权限
  247. powerList := userInfoRpc.GetUserResources()
  248. if len(powerList) > 0 {
  249. for _, plv := range powerList {
  250. UserPowerMap[plv] = 1
  251. }
  252. }
  253. //其他权益数据库查询
  254. func(mgoUserId string) {
  255. //伙伴计划是否加入(移动端我的伙伴计划菜单)
  256. if count := Mysql.CountBySql(`select count(*) from dis_partner where uid=? and type=2`, mgoUserId); count > 0 {
  257. UserPowerMap["801"] = 1
  258. } else {
  259. UserPowerMap["800"] = 1
  260. }
  261. }(m.MgoUserId)
  262. //缓存
  263. if UserPowerMap != nil {
  264. bytes, err := json.Marshal(UserPowerMap)
  265. if err == nil && len(bytes) > 0 {
  266. redis.PutBytes(RedisCode, userPowerRedisKey, &bytes, ConfigJson.InternalTime)
  267. }
  268. }
  269. return UserPowerMap
  270. }
  271. // ClearUserPowerFunc clear One userId>positionId 职位id
  272. func ClearUserPowerFunc(positionId, appId string) bool {
  273. if positionId == "" {
  274. return false
  275. }
  276. for _, v := range strings.Split(positionId, ",") {
  277. for _, vv := range []string{"PC", "APP", "WX"} {
  278. //用户菜单缓存
  279. redis.Del(RedisCode, fmt.Sprintf(RedisMenuKey, appId, vv, v))
  280. }
  281. //用户权限缓存
  282. redis.Del(RedisCode, fmt.Sprintf(UserPowerRedisKey, appId, time.Now().Day(), v))
  283. //企业关联缓存
  284. entCacheKey := redis.GetStr(RedisCode, fmt.Sprintf(CheckEntKK, positionId))
  285. if ecks := strings.Split(entCacheKey, ","); len(ecks) > 0 {
  286. for _, ev := range ecks {
  287. if ev != "" {
  288. redis.Del(RedisCode, ev)
  289. }
  290. }
  291. }
  292. redis.Del(RedisCode, fmt.Sprintf(CheckEntKK, positionId))
  293. }
  294. return true
  295. }
  296. // UserRolePowerInit 用户角色权限初始化
  297. func UserRolePowerInit(strs []string) {
  298. if len(strs) > 0 {
  299. jyUserRoleData := BaseMysql.SelectBySql(`SELECT id,name FROM jyfunction WHERE status = 1`)
  300. if jyUserRoleData != nil && len(*jyUserRoleData) > 0 {
  301. for _, jv := range *jyUserRoleData {
  302. for _, v := range strs {
  303. if strings.Contains(MC.ObjToString(jv["name"]), v) {
  304. UserRolePowers[v] = append(UserRolePowers[v], strconv.Itoa(MC.IntAll(jv["id"])))
  305. }
  306. }
  307. }
  308. }
  309. }
  310. }
  311. /*
  312. 菜单弹窗逻辑
  313. 如果需要留资
  314. 默认:
  315. 1、先判断是否已留资
  316. 2、再判断是否有权限
  317. 医械通:
  318. 1、不符合可以留资申请开通权限的用户
  319. 1、免费用户
  320. 2、超级订阅用户、大会员用户到期时间是否超过3个月
  321. (1、2:弹窗-医械通上线啦)
  322. 2、符合可以留资申请开通的用户
  323. 1、未留资
  324. (1:弹窗-完善基本信息)
  325. 2、已留资未开通
  326. 3、已留资且开通
  327. (2、3:弹窗-恭喜留资成功)
  328. */
  329. /*
  330. 1、判断是否满足超级订阅用户或大会员用户 且到期时间超过90天(配置);
  331. 1.1、否:权限=0;提示上线啦
  332. 1.2、是:是否留资
  333. 1.2.1、否:权限=0;提示留资
  334. 1.2.2、是:是否开通权限
  335. 1.2.2.1、否:权限=0;提示恭喜留资成功,客服联系
  336. 1.2.2.2、是:权限=1
  337. */
  338. /*存在超级订阅 或 大会员到期 而医械通未到期的情况*/
  339. // CheckCapitalResources 是否需要留资 且权限验证--弹窗处理
  340. // b 一级权限(超级订阅、大会员等)
  341. // p 二级权限(请求资源中台:医械通等)
  342. func (m *WorkDesktopMenu) CheckCapitalResources(menu *JYMenu, b, p bool, pUrl string) (title, content, confirmUrl, confirmText, appType, openType string, isShowCancel, usable bool) {
  343. var defaultPopupFunc = func(powerIds ...string) {
  344. dpKey := m.Platform
  345. if len(powerIds) > 0 {
  346. dpKey = powerIds[0]
  347. }
  348. title = ConfigJson.DefaultPopup[dpKey].Title
  349. content = ConfigJson.DefaultPopup[dpKey].Content
  350. confirmUrlArr := strings.Split(ConfigJson.DefaultPopup[dpKey].ConfirmUrl, "__")
  351. if len(confirmUrlArr) > 1 {
  352. confirmUrl = MC.InterfaceToStr(MC.If(m.Platform == "PC", confirmUrlArr[1], confirmUrlArr[0]))
  353. }
  354. confirmText = ConfigJson.DefaultPopup[dpKey].ConfirmText
  355. isShowCancel = ConfigJson.DefaultPopup[dpKey].IsShowCancel
  356. appType = ConfigJson.DefaultPopup[dpKey].AppType
  357. openType = ConfigJson.DefaultPopup[dpKey].OpenType
  358. }
  359. OverallLock.Lock()
  360. userInfo := UserInfoMap[m.NewUserId]
  361. if userInfo == nil {
  362. userInfo = &UserInfo{}
  363. userInfo.Lock = &sync.Mutex{}
  364. userInfo.Capitals = map[string]int{}
  365. userInfo.Permissions = map[string]int{}
  366. UserInfoMap[m.NewUserId] = userInfo
  367. }
  368. OverallLock.Unlock()
  369. userInfo.Lock.Lock()
  370. defer userInfo.Lock.Unlock()
  371. var (
  372. defaultPopup = false //默认弹窗
  373. capitalBool = func() bool {
  374. //用户是否需要留资
  375. if menu.CapitalCode != "" {
  376. capitalBool := false
  377. for _, cv := range strings.Split(menu.CapitalCode, ",") {
  378. if userInfo.Capitals[cv] <= 0 {
  379. if c := BaseMysql.CountBySql(`SELECT COUNT(id) FROM `+CapitalRetention+` WHERE source = ? AND position_id = ? AND appid = ?`, cv, m.PositionId, m.AppId); c > 0 {
  380. userInfo.Capitals[cv] = 1
  381. } else {
  382. userInfo.Capitals[cv] = -1
  383. }
  384. }
  385. if userInfo.Capitals[cv] > 0 {
  386. capitalBool = true
  387. break
  388. }
  389. }
  390. return capitalBool
  391. }
  392. return true
  393. }()
  394. )
  395. usable = func() bool {
  396. switch menu.Authority {
  397. case 0:
  398. return b && p && capitalBool
  399. case 1:
  400. return b || p || capitalBool
  401. case 2:
  402. return b || p && capitalBool
  403. case 3:
  404. return b && p || capitalBool
  405. case 4:
  406. return b && capitalBool || p
  407. default:
  408. return false
  409. }
  410. }()
  411. //企业信息验证
  412. if menu.CheckEnt > 0 {
  413. checkEntBool := false
  414. var GetCheckEntInfo = func(menuId, entId, deptId, positionId int64) (menuEntInfo MenuEntInfo) {
  415. checkEntKey := fmt.Sprintf("check_ent_key_%d_%d_%d", menuId, entId, deptId)
  416. cb, ce := redis.GetBytes(RedisCode, checkEntKey)
  417. if ce == nil && len(*cb) > 0 {
  418. ce = json.Unmarshal(*cb, &menuEntInfo)
  419. if ce == nil && menuEntInfo.EntId > 0 {
  420. return
  421. }
  422. }
  423. menuEnt := BaseMysql.FindOne("base_service.work_menu_ent", map[string]interface{}{
  424. "menu_id": menuId,
  425. "ent_id": entId,
  426. }, "", "create_date DESC ")
  427. if menuEnt != nil && (*menuEnt) != nil {
  428. mb, err := json.Marshal(*menuEnt)
  429. if err == nil && len(mb) > 0 {
  430. err = json.Unmarshal(mb, &menuEntInfo)
  431. if err == nil {
  432. err = redis.PutBytes(RedisCode, checkEntKey, &mb, 4*60*60)
  433. // 缓存key
  434. ceks := redis.GetStr(RedisCode, fmt.Sprintf(CheckEntKK, strconv.FormatInt(positionId, 10)))
  435. if !strings.Contains(ceks, checkEntKey) {
  436. ceks = fmt.Sprintf("%s,%s", ceks, checkEntKey)
  437. redis.Put(RedisCode, fmt.Sprintf(CheckEntKK, strconv.FormatInt(positionId, 10)), ceks, 5*60*60)
  438. }
  439. }
  440. }
  441. if err != nil {
  442. log.Println("获取 work_menu_ent 信息 异常:", entId, menuId, m.Phone)
  443. }
  444. }
  445. return
  446. }
  447. mei := GetCheckEntInfo(int64(menu.Id), m.EntId, m.EntDeptId, m.PositionId)
  448. if mei.EntId > 0 {
  449. var moldFunc = func() {
  450. switch mei.Mold {
  451. case 0:
  452. checkEntBool = true
  453. default:
  454. log.Println("工作菜单企业关联信息表 是否显示菜单:", mei.Mold, mei.EntId)
  455. }
  456. }
  457. switch mei.Target {
  458. case 1:
  459. if deptIds := strings.Split(mei.DeptId, ","); len(deptIds) > 0 {
  460. for _, deptId := range deptIds {
  461. vi, _ := strconv.ParseInt(deptId, 10, 64)
  462. if vi == m.EntDeptId {
  463. moldFunc()
  464. }
  465. }
  466. }
  467. default:
  468. moldFunc()
  469. }
  470. }
  471. switch menu.CheckEnt {
  472. default:
  473. usable = usable && checkEntBool
  474. case 2:
  475. usable = usable || checkEntBool
  476. }
  477. return
  478. }
  479. //P630人脉管理
  480. //用户 有权限 不再判断 弹窗提示信息
  481. //菜单在当前平台没有权限
  482. if usable && menu.Url == "" && pUrl == "" {
  483. usable = false
  484. defaultPopupFunc()
  485. return
  486. }
  487. // 需要特殊处理的菜单 弹窗提示信息
  488. /*
  489. 菜单弹窗逻辑
  490. 如果需要留资
  491. 默认:
  492. 1、先判断是否已留资
  493. 2、再判断是否有权限
  494. 医械通:
  495. 1、不符合可以留资申请开通权限的用户
  496. 1、免费用户
  497. 2、超级订阅用户、大会员用户到期时间是否超过3个月
  498. (1、2:弹窗-医械通上线啦)
  499. 2、符合可以留资申请开通的用户
  500. 1、未留资
  501. (1:弹窗-完善基本信息)
  502. 2、已留资未开通
  503. 3、已留资且开通
  504. (2、3:弹窗-恭喜留资成功)
  505. */
  506. if PopupIdMap[menu.Id] || PopupIdMap[menu.ParentId] {
  507. // 超级订阅 or 大会员
  508. if b {
  509. userPowerEndTimeKey := fmt.Sprintf(UserPowerEndTime, m.UserId)
  510. powerEndTime, _ := strconv.ParseInt(redis.GetStr(RedisCode, userPowerEndTimeKey), 10, 64)
  511. //超级订阅 大会员到期时间 是否 大于 90天
  512. if powerEndTime == 0 || powerEndTime-time.Now().Unix() < ConfigJson.MedicalFieldTimespan {
  513. //即使是超级订阅或大会员 也没有权限
  514. defaultPopup = true
  515. }
  516. }
  517. // 免费用户 或者 不满足条件的超级订阅or大会员用户
  518. if (!b || defaultPopup) && ConfigJson.DefaultPopup[menu.PowerIds].Title != "" {
  519. defaultPopupFunc(menu.PowerIds)
  520. } else if !capitalBool { //未留资的用户
  521. //留资弹窗信息
  522. title = menu.CapitalInfo.Title
  523. content = menu.CapitalInfo.Content
  524. confirmUrl = menu.CapitalInfo.ConfirmUrl
  525. confirmText = menu.CapitalInfo.ConfirmText
  526. isShowCancel = menu.CapitalInfo.IsShowCancel
  527. appType = menu.CapitalInfo.AppType
  528. openType = menu.CapitalInfo.OpenType
  529. } else {
  530. title = menu.AdditionalInfo[m.Platform].Title
  531. content = menu.AdditionalInfo[m.Platform].Content
  532. confirmUrl = menu.AdditionalInfo[m.Platform].ConfirmUrl
  533. confirmText = menu.AdditionalInfo[m.Platform].ConfirmText
  534. isShowCancel = menu.AdditionalInfo[m.Platform].IsShowCancel
  535. appType = menu.AdditionalInfo[m.Platform].AppType
  536. openType = menu.AdditionalInfo[m.Platform].OpenType
  537. }
  538. } else { //默认
  539. // 留资
  540. if !capitalBool {
  541. //留资弹窗信息
  542. title = menu.CapitalInfo.Title
  543. content = menu.CapitalInfo.Content
  544. confirmUrl = menu.CapitalInfo.ConfirmUrl
  545. confirmText = menu.CapitalInfo.ConfirmText
  546. isShowCancel = menu.CapitalInfo.IsShowCancel
  547. appType = menu.CapitalInfo.AppType
  548. openType = menu.CapitalInfo.OpenType
  549. } else {
  550. title = menu.AdditionalInfo[m.Platform].Title
  551. content = menu.AdditionalInfo[m.Platform].Content
  552. confirmUrl = menu.AdditionalInfo[m.Platform].ConfirmUrl
  553. confirmText = menu.AdditionalInfo[m.Platform].ConfirmText
  554. isShowCancel = menu.AdditionalInfo[m.Platform].IsShowCancel
  555. appType = menu.AdditionalInfo[m.Platform].AppType
  556. openType = menu.AdditionalInfo[m.Platform].OpenType
  557. }
  558. }
  559. return
  560. }