File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,13 +110,13 @@ export default function () {
110110 rel = "noreferrer"
111111 onClick = { changeAvatar }
112112 >
113- < img
114- className = "profile-avatar"
115- src = {
116- user . avatar ||
117- `https://seccdn.libravatar.org/avatar/ ${ user . mailMd5 } ?s=220&r=X&d=mm`
118- }
119- />
113+ { user && user . avatar && (
114+ < img
115+ className = "profile-avatar"
116+ src = { user . avatar }
117+ alt = { t ( 'avatar' ) }
118+ />
119+ ) }
120120 </ a >
121121 </ p >
122122 < h2 > { user . display_name } </ h2 >
Original file line number Diff line number Diff line change @@ -38,13 +38,6 @@ export interface UserInfo {
3838 */
3939 avatar : string ;
4040
41- /**
42- * 用户邮箱 MD5
43- *
44- * MD5 of User email
45- */
46- mailMd5 : string ;
47-
4841 /**
4942 * 用户对象 ID
5043 *
Original file line number Diff line number Diff line change 11const jwt = require ( 'jsonwebtoken' ) ;
22const speakeasy = require ( 'speakeasy' ) ;
3- const helper = require ( 'think-helper' ) ;
43
54const BaseRest = require ( './rest.js' ) ;
65
@@ -60,7 +59,6 @@ module.exports = class extends BaseRest {
6059 return this . success ( {
6160 ...user [ 0 ] ,
6261 password : null ,
63- mailMd5 : helper . md5 ( user [ 0 ] . email . toLowerCase ( ) ) ,
6462 token : jwt . sign ( user [ 0 ] . email , this . config ( 'jwtKey' ) ) ,
6563 } ) ;
6664 }
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ const path = require('node:path');
22const qs = require ( 'node:querystring' ) ;
33
44const jwt = require ( 'jsonwebtoken' ) ;
5- const helper = require ( 'think-helper' ) ;
65
76module . exports = class extends think . Logic {
87 constructor ( ...args ) {
@@ -141,7 +140,6 @@ module.exports = class extends think.Logic {
141140 avatarUrl = avatarProxy + '?url=' + encodeURIComponent ( avatarUrl ) ;
142141 }
143142 userInfo . avatar = avatarUrl ;
144- userInfo . mailMd5 = helper . md5 ( userInfo . email ) ;
145143 this . ctx . state . userInfo = userInfo ;
146144 this . ctx . state . token = token ;
147145 }
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ module.exports = class extends Base {
1616 * @apiSuccess (200) {String} data.display_name user nick name
1717 * @apiSuccess (200) {String} data.email user email address
1818 * @apiSuccess (200) {String} data.github user github account name
19- * @apiSuccess (200) {String} data.mailMd5 user mail md5
2019 * @apiSuccess (200) {String} data.objectId user id
2120 * @apiSuccess (200) {String} data.type user type, administrator or guest
2221 * @apiSuccess (200) {String} data.url user link
You can’t perform that action at this time.
0 commit comments