@jx3box/jx3box-common-ui 5.5.25 → 5.5.26

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/.editorconfig ADDED
@@ -0,0 +1,13 @@
1
+ # http://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ indent_size = 4
6
+ indent_style = space
7
+ end_of_line = lf
8
+ charset = utf-8
9
+ trim_trailing_whitespace = true
10
+ insert_final_newline = true
11
+
12
+ [*.md]
13
+ trim_trailing_whitespace = false
package/.prettierrc ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "tabWidth": 4,
3
+ "useTabs": false,
4
+ "endOfLine": "lf",
5
+ "printWidth": 120,
6
+ "semi": true,
7
+ "singleQuote": false,
8
+ "quoteProps": "as-needed",
9
+ "jsxSingleQuote": false,
10
+ "trailingComma": "es5",
11
+ "bracketSpacing": true,
12
+ "bracketSameLine": false,
13
+ "jsxBracketSameLine": false,
14
+ "arrowParens": "always",
15
+ "requirePragma": false,
16
+ "insertPragma": false,
17
+ "proseWrap": "preserve",
18
+ "htmlWhitespaceSensitivity": "css",
19
+ "vueIndentScriptAndStyle": false,
20
+ "embeddedLanguageFormatting": "auto"
21
+ }
@@ -3,6 +3,7 @@
3
3
  .clearfix;
4
4
  .db;
5
5
  .mb(10px);
6
+ .pr;
6
7
  }
7
8
  .u-avatar {
8
9
  .fl;
@@ -10,12 +11,19 @@
10
11
  .size(68px);
11
12
  }
12
13
  .u-name {
13
- .lh(2);
14
+ .lh(1.6);
14
15
  .bold;
15
16
  color: @darkblue;
16
17
  &:hover {
17
18
  color: #f39;
18
19
  }
20
+ .break(2);
21
+ }
22
+ .u-info{
23
+ .h(68px);
24
+ display: flex;
25
+ flex-direction: column;
26
+ justify-content: center;
19
27
  }
20
28
  .u-bio {
21
29
  .mb(10px);
@@ -24,6 +32,46 @@
24
32
  color: #888;
25
33
  padding: 0 5px;
26
34
  }
35
+ .u-extend {
36
+ display: flex;
37
+ }
38
+ .u-level {
39
+ padding: 2px 15px;
40
+ .fz(12px, 14px);
41
+ color: #fff;
42
+ background-color: #aad2fd;
43
+ border-radius: 2px;
44
+ }
45
+ .u-vip {
46
+ .ml(5px);
47
+ .db;
48
+ .i-icon-vip {
49
+ .db;
50
+ vertical-align: baseline;
51
+ padding: 2px 6px;
52
+ .fz(12px, 14px);
53
+ font-style: normal;
54
+ border-radius: 2px;
55
+ background-color: #ddd;
56
+ color: #fff;
57
+ &.on {
58
+ background-color: #6f42c1;
59
+ }
60
+ }
61
+ }
62
+ .u-superauthor {
63
+ margin-left: 4px;
64
+ display: inline-block;
65
+ vertical-align: -2px;
66
+ img {
67
+ width: 16px;
68
+ }
69
+ }
70
+ .u-tips {
71
+ .db;
72
+ color: #555;
73
+ font-size: 12px;
74
+ }
27
75
  .u-link {
28
76
  border-top: 1px dashed #eee;
29
77
  border-bottom: 1px dashed #eee;
@@ -109,11 +157,11 @@
109
157
  .db;
110
158
  background-color: #f2f6fc;
111
159
  .mb(6px);
112
- &:hover{
160
+ &:hover {
113
161
  background-color: #e6f0fb;
114
162
  // color:@color-link;
115
163
  }
116
- padding:2px 0;
164
+ padding: 2px 0;
117
165
  }
118
166
  .u-team-logo {
119
167
  .size(26px);
@@ -125,30 +173,6 @@
125
173
  color: #555;
126
174
  }
127
175
  }
128
-
129
- .u-vip {
130
- margin-left: 4px;
131
- .i-icon-vip{
132
- .dbi;vertical-align: baseline;
133
- padding:2px 5px;
134
- .fz(12px,14px);
135
- font-style: normal;
136
- border-radius: 2px;
137
- background-color:#ddd;
138
- color:#fff;
139
- &.on{
140
- background-color: #6f42c1;
141
- }
142
- }
143
- }
144
- .u-superauthor {
145
- margin-left: 4px;
146
- display: inline-block;
147
- vertical-align: -2px;
148
- img {
149
- width: 16px;
150
- }
151
- }
152
176
  }
153
177
 
154
178
  .c-sidebar-left .c-author {
package/jsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "compilerOptions": {
3
+ "baseUrl": ".",
4
+ "paths": {
5
+ "@/*": ["./src/*"]
6
+ }
7
+ },
8
+ "exclude": ["node_modules"]
9
+ }
package/package.json CHANGED
@@ -1,68 +1,70 @@
1
1
  {
2
- "name": "@jx3box/jx3box-common-ui",
3
- "version": "5.5.25",
4
- "description": "JX3BOX UI",
5
- "main": "index.js",
6
- "scripts": {
7
- "dev": "env DEV_SERVER=true vue-cli-service serve",
8
- "serve": "vue-cli-service serve",
9
- "build": "vue-cli-service build",
10
- "lint": "vue-cli-service lint",
11
- "inspect": "vue inspect > output.js",
12
- "update": "npm --registry https://registry.npmjs.org install @jx3box/jx3box-common@latest @jx3box/jx3box-data@latest @jx3box/jx3box-editor@latest @jx3box/jx3box-comment-ui@latest",
13
- "header": "vue-cli-service build --target lib --name newheader src/Header.vue && cp public/index.html dist/newheader.html"
2
+ "name": "@jx3box/jx3box-common-ui",
3
+ "version": "5.5.26",
4
+ "description": "JX3BOX UI",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "dev": "cross-env DEV_SERVER=true vue-cli-service serve",
8
+ "serve": "vue-cli-service serve",
9
+ "build": "vue-cli-service build",
10
+ "lint": "vue-cli-service lint",
11
+ "inspect": "vue inspect > output.js",
12
+ "update": "npm --registry https://registry.npmjs.org install @jx3box/jx3box-common@latest @jx3box/jx3box-data@latest @jx3box/jx3box-editor@latest @jx3box/jx3box-comment-ui@latest",
13
+ "header": "vue-cli-service build --target lib --name newheader src/Header.vue && cp public/index.html dist/newheader.html"
14
+ },
15
+ "eslintConfig": {
16
+ "root": true,
17
+ "env": {
18
+ "node": true
14
19
  },
15
- "eslintConfig": {
16
- "root": true,
17
- "env": {
18
- "node": true
19
- },
20
- "extends": [
21
- "plugin:vue/essential"
22
- ],
23
- "rules": {},
24
- "parserOptions": {
25
- "parser": "babel-eslint"
26
- }
27
- },
28
- "browserslist": [
29
- "> 1%",
30
- "last 2 versions"
20
+ "extends": [
21
+ "plugin:vue/essential"
31
22
  ],
32
- "dependencies": {
33
- "@jx3box/jx3box-comment-ui": "^1.6.8",
34
- "@jx3box/jx3box-common": "^7.0.21",
35
- "@jx3box/jx3box-data": "^1.8.3",
36
- "@jx3box/jx3box-editor": "^1.2.6",
37
- "axios": "^0.26.1",
38
- "element-ui": "^2.13.2",
39
- "jquery": "^3.5.1",
40
- "lodash": "^4.17.15",
41
- "qrcode.vue": "^1.7.0",
42
- "url": "^0.11.0",
43
- "vue": "^2.6.11"
44
- },
45
- "devDependencies": {
46
- "@babel/plugin-proposal-optional-chaining": "^7.14.5",
47
- "@vue/cli-plugin-babel": "~4.3.0",
48
- "@vue/cli-plugin-eslint": "~4.3.0",
49
- "@vue/cli-plugin-vuex": "^4.0.0",
50
- "@vue/cli-service": "~4.3.0",
51
- "babel-eslint": "^10.1.0",
52
- "core-js": "^3.6.5",
53
- "csslab": "^4.0.3",
54
- "eslint": "^6.7.2",
55
- "eslint-plugin-vue": "^6.2.2",
56
- "less": "^3.0.4",
57
- "less-loader": "^5.0.0",
58
- "style-resources-loader": "^1.3.3",
59
- "vue-cli-plugin-element": "~1.0.1",
60
- "vue-svg-inline-loader": "^1.4.6",
61
- "vue-template-compiler": "^2.6.11",
62
- "weixin-js-sdk": "^1.6.0"
63
- },
64
- "repository": {
65
- "type": "git",
66
- "url": "git+https://github.com/JX3BOX/jx3box-common-ui.git"
23
+ "rules": {},
24
+ "parserOptions": {
25
+ "parser": "babel-eslint"
67
26
  }
27
+ },
28
+ "browserslist": [
29
+ "> 1%",
30
+ "last 2 versions"
31
+ ],
32
+ "dependencies": {
33
+ "@jx3box/jx3box-comment-ui": "^1.6.8",
34
+ "@jx3box/jx3box-common": "^7.0.21",
35
+ "@jx3box/jx3box-data": "^1.8.6",
36
+ "@jx3box/jx3box-editor": "^1.2.6",
37
+ "axios": "^0.26.1",
38
+ "dayjs": "^1.11.0",
39
+ "element-ui": "^2.13.2",
40
+ "jquery": "^3.5.1",
41
+ "lodash": "^4.17.15",
42
+ "qrcode.vue": "^1.7.0",
43
+ "url": "^0.11.0",
44
+ "vue": "^2.6.11"
45
+ },
46
+ "devDependencies": {
47
+ "@babel/plugin-proposal-optional-chaining": "^7.14.5",
48
+ "@vue/cli-plugin-babel": "~4.3.0",
49
+ "@vue/cli-plugin-eslint": "~4.3.0",
50
+ "@vue/cli-plugin-vuex": "^4.0.0",
51
+ "@vue/cli-service": "~4.3.0",
52
+ "babel-eslint": "^10.1.0",
53
+ "core-js": "^3.6.5",
54
+ "cross-env": "^7.0.3",
55
+ "csslab": "^4.0.3",
56
+ "eslint": "^6.7.2",
57
+ "eslint-plugin-vue": "^6.2.2",
58
+ "less": "^3.0.4",
59
+ "less-loader": "^5.0.0",
60
+ "style-resources-loader": "^1.3.3",
61
+ "vue-cli-plugin-element": "~1.0.1",
62
+ "vue-svg-inline-loader": "^1.4.6",
63
+ "vue-template-compiler": "^2.6.11",
64
+ "weixin-js-sdk": "^1.6.0"
65
+ },
66
+ "repository": {
67
+ "type": "git",
68
+ "url": "git+https://github.com/JX3BOX/jx3box-common-ui.git"
69
+ }
68
70
  }
package/service/author.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import axios from "axios";
2
2
  import { __imgPath } from "@jx3box/jx3box-common/data/jx3box.json";
3
- import { $next, $cms, $team } from "@jx3box/jx3box-common/js/https.js";
3
+ import { $next, $cms, $team, $pay } from "@jx3box/jx3box-common/js/https.js";
4
4
 
5
5
  function getUserInfo(uid) {
6
6
  return $cms({ mute: true })
@@ -10,6 +10,14 @@ function getUserInfo(uid) {
10
10
  });
11
11
  }
12
12
 
13
+ function getMyInfo(){
14
+ return $cms({ mute: true })
15
+ .get(`/api/cms/user/my/info`)
16
+ .then(res => {
17
+ return res.data.data
18
+ })
19
+ }
20
+
13
21
  function getUserPosts(uid) {
14
22
  return $cms({ mute: true })
15
23
  .get(`/api/cms/posts/user/${uid}/latest`)
@@ -56,8 +64,8 @@ function getSuperAuthor(uid) {
56
64
  return $cms().get('/api/cms/user/is_super_author/' + uid)
57
65
  }
58
66
 
59
- function getIdentity(uid) {
60
- return $cms().get(`/api/cms/user/${uid}/identity`)
67
+ function userSignIn(){
68
+ return $pay({ mute: true }).get(`/api/personal/task/everyday/sign-in`)
61
69
  }
62
70
 
63
71
  export {
@@ -68,5 +76,6 @@ export {
68
76
  getFrames,
69
77
  getUserPublicTeams,
70
78
  getSuperAuthor,
71
- getIdentity
79
+ getMyInfo,
80
+ userSignIn,
72
81
  };
package/src/Author.vue CHANGED
@@ -1,56 +1,38 @@
1
1
  <template>
2
2
  <div class="c-author" v-if="data">
3
3
  <div class="u-author">
4
- <Avatar
5
- class="u-avatar"
6
- :uid="uid"
7
- :url="data.user_avatar"
8
- :size="68"
9
- :frame="data.user_avatar_frame"
10
- />
11
- <a class="u-name" :href="authorLink(uid)">
12
- <span>{{ data.display_name }}</span>
4
+ <Avatar class="u-avatar" :uid="uid" :url="data.user_avatar" :size="68" :frame="data.user_avatar_frame" />
5
+ <div class="u-info">
6
+ <a class="u-name" :href="authorLink(uid)">
7
+ <span>{{ data.display_name.slice(0, 12) }}</span>
8
+ <el-tooltip class="item" effect="dark" content="签约作者" placement="top" v-if="isSuperAuthor">
9
+ <a class="u-superauthor" href="/dashboard/#/cooperation" target="_blank">
10
+ <img :src="super_author_icon" alt="superauthor" />
11
+ </a>
12
+ </el-tooltip>
13
13
  </a>
14
- <el-tooltip
15
- class="item"
16
- effect="dark"
17
- content="签约作者"
18
- placement="top"
19
- v-if="isSuperAuthor"
20
- >
21
- <a class="u-superauthor" href="/dashboard/#/cooperation" target="_blank">
22
- <img :src="super_author_icon" alt="superauthor" />
23
- </a>
24
- </el-tooltip>
25
- <el-tooltip
26
- class="item"
27
- effect="dark"
28
- :content="vipTypeTitle"
29
- placement="top"
30
- v-if="isPRO || isVIP"
31
- >
32
- <a class="u-vip" href="/vip/premium?from=sidebar_author" target="_blank">
33
- <i class="i-icon-vip on">{{ vipType }}</i>
34
- </a>
35
- </el-tooltip>
14
+ <div class="u-extend">
15
+ <el-tooltip class="item u-level" effect="dark" placement="top">
16
+ <div slot="content">
17
+ <span class="u-tips">经验值:{{ data.experience }}</span>
18
+ </div>
19
+ <span>Lv.{{ level }}</span>
20
+ </el-tooltip>
21
+ <el-tooltip class="item" effect="dark" :content="vipTypeTitle" placement="top" v-if="isVip">
22
+ <a class="u-vip" href="/vip/premium?from=sidebar_author" target="_blank">
23
+ <i class="i-icon-vip on">{{ vipType }}</i>
24
+ </a>
25
+ </el-tooltip>
26
+ </div>
27
+ </div>
36
28
  </div>
37
29
  <div class="u-bio">{{ data.user_bio }}</div>
38
30
  <div class="u-link" v-if="hasLink">
39
- <a
40
- v-if="data.weibo_name"
41
- class="u-weibo"
42
- :href="weiboLink(data.weibo_id)"
43
- target="_blank"
44
- >
31
+ <a v-if="data.weibo_name" class="u-weibo" :href="weiboLink(data.weibo_id)" target="_blank">
45
32
  <img svg-inline src="../assets/img/author/weibo.svg" />
46
33
  {{ data.weibo_name }}
47
34
  </a>
48
- <a
49
- v-if="data.github_name"
50
- class="u-github"
51
- :href="githubLink(data.github_name)"
52
- target="_blank"
53
- >
35
+ <a v-if="data.github_name" class="u-github" :href="githubLink(data.github_name)" target="_blank">
54
36
  <img svg-inline src="../assets/img/author/github.svg" />
55
37
  {{ data.github_name }}
56
38
  </a>
@@ -87,9 +69,9 @@
87
69
  <i class="el-icon-school"></i>
88
70
  <span>所属团队</span>
89
71
  </div>
90
- <a class="u-team" v-for="(item,i) in teams" :key="i" :href="teamLink(item.team_id)" target="_blank">
72
+ <a class="u-team" v-for="(item, i) in teams" :key="i" :href="teamLink(item.team_id)" target="_blank">
91
73
  <img class="u-team-logo" :src="showTeamLogo(item.team_logo)" />
92
- <span class="u-team-name">{{item.team_name}}@{{item.team_server}}</span>
74
+ <span class="u-team-name">{{ item.team_name }}@{{ item.team_server }}</span>
93
75
  </a>
94
76
  </div>
95
77
  <Authorposts :uid="uid" />
@@ -100,27 +82,16 @@
100
82
  const liveStatusMap = ["等待开播", "直播中", "直播结束"];
101
83
  import Avatar from "./author/Avatar.vue";
102
84
  import Authorposts from "./author/Authorposts.vue";
103
- import {
104
- authorLink,
105
- tvLink,
106
- getLink,
107
- getThumbnail,
108
- } from "@jx3box/jx3box-common/js/utils";
85
+ import { authorLink, tvLink, getLink, getThumbnail } from "@jx3box/jx3box-common/js/utils";
109
86
  import { __server, __imgPath } from "@jx3box/jx3box-common/data/jx3box.json";
110
- import {
111
- getUserInfo,
112
- getDouyu,
113
- getUserMedals,
114
- getUserPublicTeams,
115
- getSuperAuthor,
116
- getIdentity,
117
- } from "../service/author";
87
+ import { getUserInfo, getDouyu, getUserMedals, getUserPublicTeams } from "../service/author";
118
88
  import { user as medal_map } from "@jx3box/jx3box-common/data/medals.json";
119
89
  import User from "@jx3box/jx3box-common/js/user";
90
+ import { __userLevel } from "@jx3box/jx3box-common/data/jx3box.json";
120
91
  export default {
121
92
  name: "Author",
122
93
  props: ["uid"],
123
- data: function () {
94
+ data: function() {
124
95
  return {
125
96
  data: "",
126
97
  tv: "",
@@ -133,50 +104,52 @@ export default {
133
104
  // team_server : "蝶恋花"
134
105
  // }
135
106
  ],
136
- isSuperAuthor: false,
137
- isPRO: false,
138
107
  isVIP: false,
139
108
  };
140
109
  },
141
110
  computed: {
142
- tv_type: function () {
111
+ tv_type: function() {
143
112
  return this.data && this.data.tv_type;
144
113
  },
145
- tv_id: function () {
114
+ tv_id: function() {
146
115
  return (this.data && this.data.tv_id) || 0;
147
116
  },
148
- tv_img: function () {
117
+ tv_img: function() {
149
118
  return __imgPath + "image/tv/" + this.tv_type + ".png";
150
119
  },
151
- tv_link: function () {
120
+ tv_link: function() {
152
121
  return tvLink(this.tv_type, this.tv_id) || "";
153
122
  },
154
- tv_status: function () {
123
+ tv_status: function() {
155
124
  return (this.tv && this.tv.show_status == 1) || false;
156
125
  },
157
- super_author_icon: function () {
126
+ super_author_icon: function() {
158
127
  return __imgPath + "image/user/" + "superauthor.svg";
159
128
  },
160
- hasLink: function () {
161
- return (
162
- this.data.weibo_name ||
163
- this.data.github_name ||
164
- this.data.tuilan_id ||
165
- this.data.tv_id
166
- );
129
+ hasLink: function() {
130
+ return this.data.weibo_name || this.data.github_name || this.data.tuilan_id || this.data.tv_id;
167
131
  },
168
- hasTrophy: function () {
132
+ hasTrophy: function() {
169
133
  return this.medals.length;
170
134
  },
171
- vipType: function () {
172
- return this.isPRO ? "PRO" : "PRE";
135
+ vipType: function() {
136
+ return this.data?.is_pro ? "PRO" : "PRE";
137
+ },
138
+ vipTypeTitle: function() {
139
+ return this.data?.is_pro ? "专业版会员" : "高级版会员";
140
+ },
141
+ isVip: function() {
142
+ return this.data?.is_pro || this.data?.is_pre;
143
+ },
144
+ isSuperAuthor: function() {
145
+ return this.data?.sign;
173
146
  },
174
- vipTypeTitle: function () {
175
- return this.isPRO ? "专业版会员" : "高级版会员";
147
+ level: function() {
148
+ return User.getLevel(this.data?.experience);
176
149
  },
177
150
  },
178
151
  methods: {
179
- loadData: function () {
152
+ loadData: function() {
180
153
  return getUserInfo(this.uid)
181
154
  .then((data) => {
182
155
  this.data = data;
@@ -184,11 +157,9 @@ export default {
184
157
  .then(() => {
185
158
  this.loadMedals();
186
159
  this.loadTeams();
187
- this.checkSuperAuthor();
188
- this.loadIdentity();
189
160
  });
190
161
  },
191
- loadTV: function () {
162
+ loadTV: function() {
192
163
  if (this.tv_type == "douyu") {
193
164
  if (!this.tv_id || isNaN(this.tv_id)) return;
194
165
  getDouyu(this.tv_id).then((data) => {
@@ -196,59 +167,44 @@ export default {
196
167
  });
197
168
  }
198
169
  },
199
- loadMedals: function () {
170
+ loadMedals: function() {
200
171
  getUserMedals(this.uid).then((data) => {
201
172
  this.medals = data;
202
173
  });
203
174
  },
204
- loadTeams: function () {
175
+ loadTeams: function() {
205
176
  getUserPublicTeams(this.uid).then((data) => {
206
177
  this.teams = data && data.slice(0, 5);
207
178
  });
208
179
  },
209
- async checkVIP() {
210
- this.isPRO = await User.isPRO();
211
- this.isVIP = await User.isVIP();
212
- },
213
- checkSuperAuthor: function () {
214
- getSuperAuthor(this.uid).then((res) => {
215
- this.isSuperAuthor = res.data.data;
216
- });
217
- },
218
- loadIdentity: function () {
219
- getIdentity(this.uid).then((res) => {
220
- this.isPRO = res.data.data.isPRO;
221
- this.isVIP = res.data.data.isPRE;
222
- });
223
- },
224
180
 
225
181
  // filters
226
- showMedalIcon: function (val) {
182
+ showMedalIcon: function(val) {
227
183
  return __imgPath + "image/medals/user/" + val + ".gif";
228
184
  },
229
- showMedalDesc : function (item){
230
- return item.medal_desc || medal_map[item.medal]
185
+ showMedalDesc: function(item) {
186
+ return item.medal_desc || medal_map[item.medal];
231
187
  },
232
188
  authorLink,
233
- weiboLink: function (val) {
189
+ weiboLink: function(val) {
234
190
  return "https://weibo.com/" + val;
235
191
  },
236
- githubLink: function (val) {
192
+ githubLink: function(val) {
237
193
  return "https://github.com/" + val;
238
194
  },
239
- teamLink: function (team_id) {
195
+ teamLink: function(team_id) {
240
196
  return getLink("org", team_id);
241
197
  },
242
- showTeamLogo: function (val) {
198
+ showTeamLogo: function(val) {
243
199
  return getThumbnail(val, 32);
244
200
  },
245
201
  },
246
202
  watch: {
247
- uid: function () {
203
+ uid: function() {
248
204
  this.loadData();
249
205
  },
250
206
  },
251
- mounted: function () {
207
+ mounted: function() {
252
208
  this.uid && this.loadData();
253
209
  },
254
210
  components: {
@@ -119,7 +119,10 @@ import {
119
119
  } from "@jx3box/jx3box-common/data/jx3box.json";
120
120
  import panel from "../../assets/data/panel.json";
121
121
  import { getMsg, getMenu } from "../../service/header";
122
- import { getSuperAuthor } from "../../service/author";
122
+ import { getMyInfo, userSignIn } from "../../service/author";
123
+ import dayjs from 'dayjs';
124
+ import isToday from 'dayjs/plugin/isToday';
125
+ dayjs.extend(isToday);
123
126
  export default {
124
127
  props: [],
125
128
  data: function () {
@@ -201,6 +204,12 @@ export default {
201
204
  return __imgPath + "image/user/" + "superauthor.svg";
202
205
  },
203
206
  },
207
+ watch: {
208
+ fold(val) {
209
+ if (!val) {
210
+ }
211
+ }
212
+ },
204
213
  methods: {
205
214
  // 消息
206
215
  checkMSG: function () {
@@ -242,6 +251,31 @@ export default {
242
251
  });
243
252
  });
244
253
  },
254
+ // 签到
255
+ signIn: function (){
256
+ try {
257
+ let user_last_login = localStorage.getItem('user_last_login');
258
+ user_last_login = user_last_login && JSON.parse(user_last_login) || ''
259
+
260
+ if (user_last_login && dayjs(user_last_login).isToday()) {
261
+ console.log('已签到')
262
+ } else {
263
+ userSignIn().then(res => {
264
+ this.$message({
265
+ type: 'success',
266
+ message: '签到成功',
267
+ customClass: 'c-header-signin'
268
+ })
269
+ localStorage.setItem('user_last_login', JSON.stringify(dayjs()))
270
+ }).catch(err => {
271
+ localStorage.setItem('user_last_login', JSON.stringify(dayjs()))
272
+ console.log(dayjs.tz.guess())
273
+ }).finally(() => {})
274
+ }
275
+ } catch(e) {
276
+ console.log(e)
277
+ }
278
+ },
245
279
 
246
280
  // 资产
247
281
  loadAsset: function () {
@@ -249,10 +283,10 @@ export default {
249
283
  this.asset = data;
250
284
  });
251
285
  },
252
- checkSuperAuthor: function () {
253
- getSuperAuthor(this.user?.uid).then((res) => {
254
- this.isSuperAuthor = res.data.data;
255
- });
286
+ loadMyInfo: function () {
287
+ getMyInfo().then(res => {
288
+ this.isSuperAuthor = !!res.sign
289
+ })
256
290
  },
257
291
 
258
292
  // 初始化
@@ -262,7 +296,8 @@ export default {
262
296
  this.checkMSG();
263
297
  this.loadPanel();
264
298
  this.loadAsset();
265
- this.checkSuperAuthor();
299
+ this.loadMyInfo()
300
+ this.signIn()
266
301
  }
267
302
  },
268
303
 
@@ -284,4 +319,4 @@ export default {
284
319
  },
285
320
  components: {},
286
321
  };
287
- </script>
322
+ </script>
package/vue.config.js CHANGED
@@ -57,6 +57,12 @@ module.exports = {
57
57
  "/api/wiki": {
58
58
  target: "https://helper.jx3box.com",
59
59
  },
60
+ "/api/personal": {
61
+ target: "https://pay.jx3box.com",
62
+ onProxyReq: function(request) {
63
+ request.setHeader("origin", "");
64
+ },
65
+ },
60
66
  "/api": {
61
67
  target: "https://next.jx3box.com",
62
68
  onProxyReq: function(request) {