@jx3box/jx3box-common-ui 8.9.22 → 8.9.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "8.9.22",
3
+ "version": "8.9.23",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/service/cms.js CHANGED
@@ -77,5 +77,10 @@ function setUserMeta(key,data) {
77
77
  return $cms().post(`/api/cms/user/my/meta?key=${key}`, data);
78
78
  }
79
79
 
80
+ // 刷新凭证
81
+ function refreshAuth() {
82
+ return $cms().post(`/api/cms/user/account/email/refresh`);
83
+ }
84
+
80
85
  export { getPostAuthors, uploadImage, upload, getDecoration, getDecorationJson, checkTeamMember,
81
- getSliders,getSlider, getCollection, getTopicBucket, getConfig, getUserMeta, setUserMeta };
86
+ getSliders,getSlider, getCollection, getTopicBucket, getConfig, getUserMeta, setUserMeta, refreshAuth };
@@ -40,6 +40,7 @@ import { showAvatar } from "@jx3box/jx3box-common/js/utils";
40
40
  import dayjs from "dayjs";
41
41
  import User from "@jx3box/jx3box-common/js/user";
42
42
  import { __Links } from "@jx3box/jx3box-common/data/jx3box.json";
43
+ import { refreshAuth } from "../../service/cms"
43
44
  export default {
44
45
  name: "alternate",
45
46
  data() {
@@ -131,7 +132,7 @@ export default {
131
132
  type: "warning",
132
133
  })
133
134
  .then(() => {
134
- User.update(item).then(() => {
135
+ User.update(item).then(async () => {
135
136
  localStorage.setItem(
136
137
  "jx3box-alternate-" + item.uid,
137
138
  JSON.stringify({
@@ -139,6 +140,7 @@ export default {
139
140
  created_at: Number(localStorage.getItem("created_at")),
140
141
  })
141
142
  );
143
+ await refreshAuth();
142
144
  location.reload();
143
145
  this.visible = false;
144
146
  });