We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 71af5b6 commit 3e5bfceCopy full SHA for 3e5bfce
1 file changed
lib/interface.ts
@@ -3,6 +3,7 @@ import { merge } from 'lodash';
3
import { UserAdmin, UserActive } from './enums';
4
import dayjs from 'dayjs';
5
import { generate } from './password-hash';
6
+import {config} from './config';
7
8
/**
9
* 记录信息的mixin
@@ -45,7 +46,12 @@ export let UserInterface = {
45
46
avatar: {
47
// 用户默认生成图像,为null
48
type: Sequelize.STRING({ length: 500 }),
- comment: '头像url'
49
+ comment: '头像url',
50
+ get() {
51
+ // @ts-ignore
52
+ return config.getItem('siteDomain') + 'assets/' + this.getDataValue('avatar');
53
+ }
54
+
55
},
56
admin: {
57
type: Sequelize.TINYINT,
0 commit comments