southnote-mini-sdk 1.0.21 → 1.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/app.js +1 -22
  2. package/assets/file/badwords.js +1 -63008
  3. package/assets/file/rules.js +1 -38
  4. package/components/bottomSheet/bottomSheet.js +1 -473
  5. package/components/experience-item/experience-item.js +1 -105
  6. package/components/grid-item/grid-item.js +1 -8
  7. package/components/post-item/post-item.js +1 -1086
  8. package/components/wiki-renderer/wiki-renderer.js +1 -636
  9. package/components/wiki-tabs/wiki-tabs.js +1 -52
  10. package/index.js +1 -49
  11. package/package.json +2 -22
  12. package/pages/addGame/addGame.js +1 -454
  13. package/pages/addSubject/addSubject.js +1 -199
  14. package/pages/commonLogin/commonLogin.js +1 -269
  15. package/pages/copyOfficial/copyOfficial.js +1 -25
  16. package/pages/demo/demo.js +1 -23
  17. package/pages/game/game.js +1 -1305
  18. package/pages/home/home.js +1 -665
  19. package/pages/lottery-winners/lottery-winners.js +1 -60
  20. package/pages/message/messageCommentsAndAt/messageCommentsAndAt.js +1 -178
  21. package/pages/message/messageEntire/messageEntire.js +1 -112
  22. package/pages/message/messageLikeAndCollect/messageLikeAndCollect.js +1 -147
  23. package/pages/message/messageNewFans/messageNewFans.js +1 -139
  24. package/pages/officialWebview/officialWebview.js +1 -13
  25. package/pages/post/post.js +1 -1856
  26. package/pages/post-editor/post-editor.js +1 -465
  27. package/pages/postDialog/postDialog.js +1 -560
  28. package/pages/report-category/report-category.js +1 -29
  29. package/pages/report-form/report-form.js +1 -65
  30. package/pages/sevenDaySignDetail/sevenDaySignDetail.js +1 -273
  31. package/pages/topic/topic.js +1 -266
  32. package/pages/user/user.js +1 -939
  33. package/pages/userDatum/userDatum.js +1 -24
  34. package/pages/userGameLib/userGameLib.js +1 -105
  35. package/pages/webview/webview.js +1 -25
  36. package/pages/wheelActivivty/wheelActivivty.js +1 -492
  37. package/pages/wiki/wiki.js +1 -138
  38. package/request/JKRequest.js +1 -177
  39. package/services/home.js +1 -603
  40. package/utils/auth.js +1 -17
  41. package/utils/base64.js +1 -67
  42. package/utils/compressImage.js +1 -41
  43. package/utils/exp.js +1 -49
  44. package/utils/formatPost.js +1 -18
  45. package/utils/parseContent.js +1 -191
  46. package/utils/query-select.js +1 -9
  47. package/utils/sensitive.js +1 -82
@@ -1,177 +1 @@
1
- export function jkRequest(params) {
2
- return new Promise((resolve, reject) => {
3
- wx.request({
4
- ...params,
5
- success: (res) => {
6
- resolve(res.data)
7
- },
8
- fail: (err) => {
9
- reject(err)
10
- }
11
- })
12
- })
13
- }
14
-
15
- class JKRequest {
16
- constructor(baseURL) {
17
- this.baseURL = baseURL
18
- }
19
- request(params) {
20
- let {
21
- url,
22
- data = {},
23
- showLoading = false
24
- } = params;
25
-
26
-
27
- // 当接口为 passwdLogin 时,改用另一套域名
28
- if (url.includes("passwdLogin") || url.includes("phoneLogin")) {
29
- url = "https://usercenter.whalegame.cn/api/account/" + url
30
- } else if (url.includes("sendSMS")) {
31
- url = "https://usercenter.whalegame.cn/api/" + url
32
- } else {
33
- url = this.baseURL + url
34
-
35
- // 如果不是 usercenter 域名下的接口,且已登录,则自动拼接 user_id 和 token
36
- const appuid = wx.getStorageSync('appuid');
37
- const token = wx.getStorageSync('token');
38
- if (appuid && token) {
39
- data = {
40
- ...data,
41
- user_id: appuid,
42
- token: token,
43
- client: '4',
44
- appId: 'BlueBook'
45
- };
46
- }
47
- }
48
-
49
- // 显示 loading
50
- if (showLoading) {
51
-
52
- wx.showLoading({
53
- title: '加载中...',
54
- mask: true
55
- });
56
- }
57
-
58
- return new Promise((resolve, reject) => {
59
- wx.request({
60
- ...params,
61
- url,
62
- data,
63
- success: (res) => {
64
- if (showLoading) wx.hideLoading()
65
- if (res.data.code !== 0) {
66
- if (res.data.code === 2001) {
67
- // token失效处理 清空token
68
- wx.removeStorageSync('appuid')
69
- wx.removeStorageSync('token')
70
- }
71
- return wx.showToast({
72
- title: res.data.msg,
73
- icon: 'none',
74
- duration: 2000
75
- })
76
- }
77
- // 替换所有 http -> https
78
- const safeData = replaceHttpWithHttps(res.data)
79
- // console.log("原始数据:", res.data)
80
- // console.log("替换后数据:", safeData)
81
- resolve(safeData)
82
- },
83
- fail: (err) => {
84
- if (showLoading) wx.hideLoading()
85
- wx.showToast({
86
- title: err,
87
- icon: 'none',
88
- duration: 2000
89
- })
90
-
91
- reject(err)
92
- },
93
- complete: () => {
94
- // 隐藏 loading
95
- // wx.hideLoading()
96
- }
97
- })
98
- })
99
- }
100
- get(params) {
101
- return this.request({
102
- ...params,
103
- method: "get"
104
- })
105
- }
106
- post(params) {
107
- return this.request({
108
- ...params,
109
- method: "post"
110
- })
111
- }
112
- // formdata
113
- postForm(params) {
114
- return this.request({
115
- ...params,
116
- method: "POST",
117
- header: {
118
- 'Content-Type': 'application/json',
119
- ...(params.header || {})
120
- }
121
- })
122
- }
123
-
124
-
125
- }
126
-
127
-
128
- // 工具函数:递归替换所有 http:// 为 https://
129
- function replaceHttpWithHttps(data) {
130
- if (typeof data === 'string') {
131
- return data.replace(/http:\/\//g, 'https://')
132
- } else if (Array.isArray(data)) {
133
- return data.map(item => replaceHttpWithHttps(item))
134
- } else if (typeof data === 'object' && data !== null) {
135
- const newObj = {}
136
- for (const key in data) {
137
- newObj[key] = replaceHttpWithHttps(data[key])
138
- }
139
- return newObj
140
- }
141
- return data
142
- }
143
-
144
-
145
- /**
146
- * 递归替换所有 http:// 开头的图片 URL 为固定的 HTTPS 测试地址
147
- * @param {any} data - 任意类型(对象、数组、字符串等)
148
- * @param {string} placeholderUrl - 要替换成的 HTTPS 测试图片地址
149
- */
150
- function replaceHttpImagesWithPlaceholder(data, placeholderUrl = "https://image.southbook.cn/assets/test/test.jpg") {
151
- if (typeof data === "string") {
152
- // 匹配 http:// 开头且以图片后缀结尾的 URL
153
- if (/^http:\/\/.*\.(jpg|jpeg|png|gif|webp|bmp)$/i.test(data)) {
154
- return placeholderUrl
155
- }
156
- return data
157
- } else if (Array.isArray(data)) {
158
- // 数组:递归处理每一项
159
- return data.map(item => replaceHttpImagesWithPlaceholder(item, placeholderUrl))
160
- } else if (typeof data === "object" && data !== null) {
161
- // 对象:递归处理每个键
162
- const newObj = {}
163
- for (const key in data) {
164
- newObj[key] = replaceHttpImagesWithPlaceholder(data[key], placeholderUrl)
165
- }
166
- return newObj
167
- }
168
- // 其他类型直接返回
169
- return data
170
- }
171
-
172
-
173
-
174
- // 测试环境
175
- // export const JKRequestInstance = new JKRequest("https://testsouthnote.whalegame.cn/api/blueBook/")
176
- // 生产环境
177
- export const JKRequestInstance = new JKRequest("https://southnote.whalegame.cn/api/blueBook/")
1
+ function _0x19f3(){const _0x68c6e=['mZmZAxjbEKPN','mti4y2fMwLr1','vef6zfy','BNPWEvu','qu13q0W','ndyWotq0nvvfwxvltW','y29Kzq','AgLKzuXVywrPBMC','tM9swfm','yxbWDwLK','mZK2nZzYCKPHCNO','zgf0yq','CMvTB3zLu3rVCMfNzvn5BMm','A2fgzfq','Cg9ZDezVCM0','zg1gzw8','CeP5swq','rNj1uKm','Ahr0Chm6lY91C2vYy2vUDgvYlNDOywXLz2fTzs5JBI9HCgKVywnJB3vUDc8','ndGXmZe4tejxBeTZ','C0fqD1q','BwfW','BM9Uzq','Ahr0Chm6lY9PBwfNzs5ZB3v0AgjVB2SUy24VyxnZzxrZl3rLC3qVDgvZDc5QCgC','C3rYAw5N','uvrUy1G','Ahr0Chm6lY8','5yQG6l295lITlI4U','mJqYmtyWmJDWCvvqELO','tuLxDLy','Dg9Rzw4','CMvWBgfJzq','thHUD3e','AgvHzgvY','C2HVD1rVyxn0','ndy1mNrfBvr1yW','Aw5JBhvKzxm','B1DIrei','z2v0u3rVCMfNzvn5BMm','B2jQzwn0','ou1WBKTlwq','C2vUzfnnuW','Cg9ZDa','z2v0','nKLuDMzfEq','D1b0tem','CMvXDwvZDa','mtC5mZe2ogzZD1jUrq','CgfZC3DKtg9NAw4','BxnN','zwDHExK','uNfSqwO','DgvZDa','mta3ndG4odbwEM5yuKK','CgHVBMvmB2DPBG','v0HZs3q','yMfZzvvsta','B0LwquG','AxnbCNjHEq'];_0x19f3=function(){return _0x68c6e;};return _0x19f3();}const _0x50357a=_0x575d;(function(_0x10c008,_0x165c28){const _0x8f3ece=_0x575d,_0x2c6d6b=_0x10c008();while(!![]){try{const _0x4b337b=-parseInt(_0x8f3ece(0x111))/0x1+-parseInt(_0x8f3ece(0x12d))/0x2+-parseInt(_0x8f3ece(0xfe))/0x3*(parseInt(_0x8f3ece(0x121))/0x4)+parseInt(_0x8f3ece(0x103))/0x5*(parseInt(_0x8f3ece(0x12a))/0x6)+parseInt(_0x8f3ece(0x108))/0x7*(parseInt(_0x8f3ece(0xff))/0x8)+-parseInt(_0x8f3ece(0x126))/0x9*(parseInt(_0x8f3ece(0x133))/0xa)+parseInt(_0x8f3ece(0x11a))/0xb;if(_0x4b337b===_0x165c28)break;else _0x2c6d6b['push'](_0x2c6d6b['shift']());}catch(_0x45a437){_0x2c6d6b['push'](_0x2c6d6b['shift']());}}}(_0x19f3,0x9a557));export function jkRequest(_0x3c392a){const _0x1cfd50={'oWbDB':function(_0x2cbce7,_0x163dbd){return _0x2cbce7(_0x163dbd);}};return new Promise((_0x3ddf1d,_0x5f0fcf)=>{const _0x366c01=_0x575d,_0x9a2a60={'dmFeo':function(_0x260357,_0x28a754){const _0x191511=_0x575d;return _0x1cfd50[_0x191511(0x123)](_0x260357,_0x28a754);}};wx[_0x366c01(0x12c)]({..._0x3c392a,'success':_0x42e8f5=>{const _0x1434f7=_0x366c01;_0x9a2a60[_0x1434f7(0x10d)](_0x3ddf1d,_0x42e8f5[_0x1434f7(0x109)]);},'fail':_0x5f2daa=>{const _0x2a774e=_0x366c01;_0x9a2a60[_0x2a774e(0x10d)](_0x5f0fcf,_0x5f2daa);}});});}class JKRequest{constructor(_0x1bed62){const _0x550cc7=_0x575d;this[_0x550cc7(0x136)]=_0x1bed62;}[_0x50357a(0x12c)](_0x1ca705){const _0x47639a=_0x50357a,_0x52fcce={'sexFk':function(_0xc1ac43,_0x2d123b){return _0xc1ac43!==_0x2d123b;},'nzpyU':function(_0x8c0174,_0x5a37af){return _0x8c0174===_0x5a37af;},'NoRXS':_0x47639a(0x11c),'VJiQo':_0x47639a(0x114),'RqlAj':function(_0x488090,_0x3e1090){return _0x488090(_0x3e1090);},'gHDbC':function(_0x4d704f,_0x4daba3){return _0x4d704f(_0x4daba3);},'hdkRC':_0x47639a(0x12e),'URIJY':function(_0x30e0ad,_0x526746){return _0x30e0ad+_0x526746;},'CHKkH':_0x47639a(0x110),'ZxXat':'https://usercenter.whalegame.cn/api/','AMwCL':'appuid','TAzdV':function(_0xb3cb3e,_0x4de5be){return _0xb3cb3e&&_0x4de5be;},'Lxnwq':_0x47639a(0x119)};let {url:_0x42c73a,data:data={},showLoading:showLoading=![]}=_0x1ca705;if(_0x42c73a['includes'](_0x52fcce['hdkRC'])||_0x42c73a[_0x47639a(0x122)](_0x47639a(0x134)))_0x42c73a=_0x52fcce['URIJY'](_0x52fcce['CHKkH'],_0x42c73a);else{if(_0x42c73a['includes'](_0x47639a(0x127)))_0x42c73a=_0x52fcce['ZxXat']+_0x42c73a;else{_0x42c73a=_0x52fcce['URIJY'](this[_0x47639a(0x136)],_0x42c73a);const _0x2eb097=wx[_0x47639a(0x124)](_0x52fcce[_0x47639a(0x102)]),_0x42cc30=wx[_0x47639a(0x124)](_0x52fcce['NoRXS']);_0x52fcce[_0x47639a(0x100)](_0x2eb097,_0x42cc30)&&(data={...data,'user_id':_0x2eb097,'token':_0x42cc30,'client':'4','appId':'BlueBook'});}}return showLoading&&wx['showLoading']({'title':_0x52fcce[_0x47639a(0x11e)],'mask':!![]}),new Promise((_0x3a152f,_0xbf94b8)=>{const _0x4fbca4=_0x47639a,_0x4a6b00={'QTncX':function(_0x1e5392,_0x26b5fc){return _0x52fcce['gHDbC'](_0x1e5392,_0x26b5fc);}};wx[_0x4fbca4(0x12c)]({..._0x1ca705,'url':_0x42c73a,'data':data,'success':_0x487fd4=>{const _0xb09db3=_0x4fbca4;if(showLoading)wx['hideLoading']();if(_0x52fcce['sexFk'](_0x487fd4['data'][_0xb09db3(0x104)],0x0))return _0x52fcce[_0xb09db3(0x101)](_0x487fd4[_0xb09db3(0x109)][_0xb09db3(0x104)],0x7d1)&&(wx[_0xb09db3(0x10a)](_0xb09db3(0x107)),wx[_0xb09db3(0x10a)](_0x52fcce[_0xb09db3(0x106)])),wx[_0xb09db3(0x120)]({'title':_0x487fd4['data'][_0xb09db3(0x12f)],'icon':_0x52fcce['VJiQo'],'duration':0x7d0});const _0x4440c0=_0x52fcce[_0xb09db3(0x131)](replaceHttpWithHttps,_0x487fd4[_0xb09db3(0x109)]);_0x3a152f(_0x4440c0);},'fail':_0x20dec4=>{const _0x2c2d1b=_0x4fbca4;if(showLoading)wx[_0x2c2d1b(0x105)]();wx['showToast']({'title':_0x20dec4,'icon':_0x2c2d1b(0x114),'duration':0x7d0}),_0x4a6b00[_0x2c2d1b(0x117)](_0xbf94b8,_0x20dec4);},'complete':()=>{}});});}[_0x50357a(0x129)](_0x1debe7){const _0x20e7ea=_0x50357a,_0x9025b9={'FruRC':'get'};return this[_0x20e7ea(0x12c)]({..._0x1debe7,'method':_0x9025b9[_0x20e7ea(0x10f)]});}[_0x50357a(0x128)](_0x51b2c1){const _0x22237b=_0x50357a;return this['request']({..._0x51b2c1,'method':_0x22237b(0x128)});}[_0x50357a(0x10c)](_0x220992){const _0x3d4023=_0x50357a,_0xab209e={'zSSgv':'POST','MIWvV':'application/json'};return this[_0x3d4023(0x12c)]({..._0x220992,'method':_0xab209e['zSSgv'],'header':{'Content-Type':_0xab209e[_0x3d4023(0x11b)],..._0x220992[_0x3d4023(0x11f)]||{}}});}}function replaceHttpWithHttps(_0x329510){const _0x4f29b1=_0x50357a,_0x324ac2={'egayy':function(_0x49c3f7,_0x40e46e){return _0x49c3f7===_0x40e46e;},'oIVAH':_0x4f29b1(0x118),'sAPwT':function(_0x5501b5,_0x3832ce){return _0x5501b5!==_0x3832ce;},'pJyId':function(_0x30a099,_0x4e642e){return _0x30a099(_0x4e642e);}};if(_0x324ac2[_0x4f29b1(0x130)](typeof _0x329510,_0x4f29b1(0x116)))return _0x329510[_0x4f29b1(0x11d)](/http:\/\//g,_0x324ac2[_0x4f29b1(0x137)]);else{if(Array[_0x4f29b1(0xfd)](_0x329510))return _0x329510[_0x4f29b1(0x113)](_0x549671=>replaceHttpWithHttps(_0x549671));else{if(typeof _0x329510===_0x4f29b1(0x125)&&_0x324ac2[_0x4f29b1(0x112)](_0x329510,null)){const _0x5666f8={};for(const _0x47e9e3 in _0x329510){_0x5666f8[_0x47e9e3]=_0x324ac2[_0x4f29b1(0x10e)](replaceHttpWithHttps,_0x329510[_0x47e9e3]);}return _0x5666f8;}}}return _0x329510;}function _0x575d(_0xb6932d,_0x68ef8f){_0xb6932d=_0xb6932d-0xfd;const _0x19f374=_0x19f3();let _0x575d9b=_0x19f374[_0xb6932d];if(_0x575d['jqfiiL']===undefined){var _0x4de0c6=function(_0x265362){const _0x6ba5e7='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2313e5='',_0x22c720='';for(let _0x5047fc=0x0,_0x2a65f4,_0x52741d,_0x132ab3=0x0;_0x52741d=_0x265362['charAt'](_0x132ab3++);~_0x52741d&&(_0x2a65f4=_0x5047fc%0x4?_0x2a65f4*0x40+_0x52741d:_0x52741d,_0x5047fc++%0x4)?_0x2313e5+=String['fromCharCode'](0xff&_0x2a65f4>>(-0x2*_0x5047fc&0x6)):0x0){_0x52741d=_0x6ba5e7['indexOf'](_0x52741d);}for(let _0x2e1c0b=0x0,_0x19db54=_0x2313e5['length'];_0x2e1c0b<_0x19db54;_0x2e1c0b++){_0x22c720+='%'+('00'+_0x2313e5['charCodeAt'](_0x2e1c0b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x22c720);};_0x575d['GYhgmm']=_0x4de0c6,_0x575d['womusK']={},_0x575d['jqfiiL']=!![];}const _0x5ba81e=_0x19f374[0x0],_0x3cde52=_0xb6932d+_0x5ba81e,_0x248ed3=_0x575d['womusK'][_0x3cde52];return!_0x248ed3?(_0x575d9b=_0x575d['GYhgmm'](_0x575d9b),_0x575d['womusK'][_0x3cde52]=_0x575d9b):_0x575d9b=_0x248ed3,_0x575d9b;}function replaceHttpImagesWithPlaceholder(_0x24e2c5,_0x4592be=_0x50357a(0x115)){const _0x2130a3=_0x50357a,_0xc110f5={'WHsKt':function(_0x3d18ab,_0x19a151){return _0x3d18ab===_0x19a151;},'kxVZO':_0x2130a3(0x116),'kaFdT':'object','wPtLC':function(_0x5c8167,_0x12eaa5,_0x33edb9){return _0x5c8167(_0x12eaa5,_0x33edb9);}};if(_0xc110f5[_0x2130a3(0x135)](typeof _0x24e2c5,_0xc110f5['kxVZO'])){if(/^http:\/\/.*\.(jpg|jpeg|png|gif|webp|bmp)$/i[_0x2130a3(0x132)](_0x24e2c5))return _0x4592be;return _0x24e2c5;}else{if(Array[_0x2130a3(0xfd)](_0x24e2c5))return _0x24e2c5[_0x2130a3(0x113)](_0x5cd4fd=>replaceHttpImagesWithPlaceholder(_0x5cd4fd,_0x4592be));else{if(_0xc110f5['WHsKt'](typeof _0x24e2c5,_0xc110f5[_0x2130a3(0x10b)])&&_0x24e2c5!==null){const _0x3256e6={};for(const _0x293885 in _0x24e2c5){_0x3256e6[_0x293885]=_0xc110f5[_0x2130a3(0x12b)](replaceHttpImagesWithPlaceholder,_0x24e2c5[_0x293885],_0x4592be);}return _0x3256e6;}}}return _0x24e2c5;}export const JKRequestInstance=new JKRequest('https://southnote.whalegame.cn/api/blueBook/');