artalk 2.2.0 → 2.2.1

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.
package/dist/Artalk.es.js CHANGED
@@ -3084,14 +3084,6 @@ function POST(ctx, url, data) {
3084
3084
  return json.data || {};
3085
3085
  });
3086
3086
  }
3087
- function GET(ctx, url, data) {
3088
- return __async(this, null, function* () {
3089
- const json = yield Fetch(ctx, url + (data ? `?${new URLSearchParams(data)}` : ""), {
3090
- method: "GET"
3091
- });
3092
- return json.data || {};
3093
- });
3094
- }
3095
3087
  function ToFormData(object) {
3096
3088
  const formData = new FormData();
3097
3089
  Object.keys(object).forEach((key) => formData.append(key, String(object[key])));
@@ -3208,7 +3200,7 @@ class Api {
3208
3200
  }
3209
3201
  loginStatus() {
3210
3202
  return __async(this, null, function* () {
3211
- const data = yield GET(this.ctx, `${this.baseURL}/login-status`);
3203
+ const data = yield POST(this.ctx, `${this.baseURL}/login-status`);
3212
3204
  return data || { is_login: false };
3213
3205
  });
3214
3206
  }
@@ -3351,19 +3343,19 @@ class Api {
3351
3343
  }
3352
3344
  captchaGet() {
3353
3345
  return __async(this, null, function* () {
3354
- const data = yield GET(this.ctx, `${this.baseURL}/captcha/refresh`);
3346
+ const data = yield POST(this.ctx, `${this.baseURL}/captcha/refresh`);
3355
3347
  return data.img_data || "";
3356
3348
  });
3357
3349
  }
3358
3350
  captchaCheck(value) {
3359
3351
  return __async(this, null, function* () {
3360
- const data = yield GET(this.ctx, `${this.baseURL}/captcha/check`, { value });
3352
+ const data = yield POST(this.ctx, `${this.baseURL}/captcha/check`, { value });
3361
3353
  return data.img_data || "";
3362
3354
  });
3363
3355
  }
3364
3356
  captchaStatus() {
3365
3357
  return __async(this, null, function* () {
3366
- const data = yield GET(this.ctx, `${this.baseURL}/captcha/status`);
3358
+ const data = yield POST(this.ctx, `${this.baseURL}/captcha/status`);
3367
3359
  return data || { is_pass: false };
3368
3360
  });
3369
3361
  }
@@ -5371,7 +5363,7 @@ class ListLite extends Component {
5371
5363
  }
5372
5364
  this.data = data;
5373
5365
  const feMinVersion = ((_a = data.api_version) == null ? void 0 : _a.fe_min_version) || "0.0.0";
5374
- if (this.ctx.conf.versionCheck && this.versionCheck("\u524D\u7AEF", feMinVersion, "2.2.0"))
5366
+ if (this.ctx.conf.versionCheck && this.versionCheck("\u524D\u7AEF", feMinVersion, "2.2.1"))
5375
5367
  return;
5376
5368
  if (this.ctx.conf.versionCheck && this.versionCheck("\u540E\u7AEF", backendMinVersion, (_b = data.api_version) == null ? void 0 : _b.version))
5377
5369
  return;
@@ -5693,7 +5685,7 @@ class List extends ListLite {
5693
5685
  if (this.ctx.conf.listSort) {
5694
5686
  this.initDropdown();
5695
5687
  }
5696
- this.$el.querySelector(".atk-copyright").innerHTML = `Powered By <a href="https://artalk.js.org" target="_blank" title="Artalk v${"2.2.0"}">Artalk</a>`;
5688
+ this.$el.querySelector(".atk-copyright").innerHTML = `Powered By <a href="https://artalk.js.org" target="_blank" title="Artalk v${"2.2.1"}">Artalk</a>`;
5697
5689
  this.ctx.on("list-reload", () => this.fetchComments(0));
5698
5690
  this.ctx.on("list-refresh-ui", () => this.refreshUI());
5699
5691
  this.ctx.on("list-import", (data) => this.importComments(data));