Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. /**
  2. * 支持:135,96,365,小蚂蚁编辑器
  3. */
  4.  
  5. ;(function () {
  6. var host = location.host
  7. var isDomain = function (t) {
  8. return host.indexOf(t) !== -1
  9. }
  10. var showOk = function (t) {
  11. return alert('平台:' + t + ' 插件加载成功')
  12. }
  13. if (isDomain('96weixin')) {
  14. $('ul').on('click', 'li[data-id]', function () {
  15. $(this).data('vip', 0).data('free', 0)
  16. })
  17. $('#user_vip').data('vip', 3)
  18. showOk('96weixin !')
  19. } else if (isDomain('135editor')) {
  20. $('body').on('click', '.vip-style', function () {
  21. $(this).removeClass('vip-style')
  22. })
  23. showOk('135editor')
  24. } else if (isDomain('365editor')) {
  25. if (typeof vm === 'undefined') {
  26. return alert('365editor FAILED')
  27. }
  28. vm.userInfo.IsVip = topnavInfo.userInfo.IsVip = 1
  29. vm.userInfo.VipType = topnavInfo.userInfo.VipType = 3
  30. showOk('365editor')
  31. } else if (isDomain('xiumi')) {
  32. return alert('暂不支持秀米')
  33. } else if (isDomain('xmyeditor')) {
  34. var usertext = localStorage.getItem('userinfo')
  35. if (!usertext) return
  36. var user = JSON.parse(usertext)
  37. user.group_id = 3
  38. user.expire_time = (Date.now() / 1000) + 30 * 24 * 3600
  39. localStorage.setItem('userinfo', JSON.stringify(user))
  40. var ajax = $.ajax
  41. var findHtml = function (id, callback) {
  42. $.get('/home/Oftenstyle/searchs?cateid=0&order=default&page=1&keyword=' + id, function (text) {
  43. var html = $(text).find('.left_RightBottomD1').data('html')
  44. if (!html) {
  45. return alert('数据获取错误')
  46. }
  47. callback({code: 200, demo_code: html})
  48. })
  49. }
  50. $.ajax = function (a, b, c, d) {
  51. if (a && a.url) {
  52. if (a.url === '/home/Oftenstyle/collectOrUse' || a.url === '/home/template/collectOrUse') {
  53. return findHtml(a.data.id, function (data) {
  54. return a.success(data)
  55. })
  56. } else if (a.url.indexOf('getStyleInfo') !== -1) {
  57. return findHtml(a.data.id, function (data) {
  58. return a.success(data)
  59. })
  60. }
  61. }
  62. return ajax(a, b, c, d)
  63. }
  64. return showOk('小蚂蚁')
  65. } else {
  66. return alert('暂不支持这个平台')
  67. }
  68. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement