提交 | 用户 | 时间
|
1ac2bc
|
1 |
/** |
懒 |
2 |
* Copyright 2018-2020 stylefeng & fengshuonan (sn93@qq.com) |
|
3 |
* <p> |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* <p> |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* <p> |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
*/ |
|
16 |
package cn.stylefeng.guns.sys.core.util; |
|
17 |
|
|
18 |
import cn.stylefeng.guns.base.auth.context.LoginContextHolder; |
|
19 |
import cn.stylefeng.guns.sys.core.listener.ConfigListener; |
|
20 |
|
|
21 |
/** |
|
22 |
* 获取默认图片地址 |
|
23 |
* |
|
24 |
* @author fengshuonan |
|
25 |
* @date 2018-10-30-5:50 PM |
|
26 |
*/ |
|
27 |
public class DefaultImages { |
|
28 |
|
|
29 |
/** |
|
30 |
* 默认的登录页面背景 |
|
31 |
* |
|
32 |
* @author fengshuonan |
|
33 |
* @Date 2018/10/30 5:51 PM |
|
34 |
*/ |
|
35 |
public static String loginBg() { |
|
36 |
return ConfigListener.getConf().get("contextPath") + "/assets/common/images/login-register.jpg"; |
|
37 |
} |
|
38 |
|
|
39 |
/** |
|
40 |
* 默认的用户图片的base64编码 |
|
41 |
* |
|
42 |
* @author fengshuonan |
|
43 |
* @Date 2018/10/30 5:51 PM |
|
44 |
*/ |
|
45 |
public static String defaultAvatarUrl() { |
|
46 |
if (LoginContextHolder.getContext().oauth2Flag()) { |
|
47 |
return ConfigListener.getConf().get("contextPath") + "/oauth/avatar"; |
|
48 |
} else { |
|
49 |
return ConfigListener.getConf().get("contextPath") + "/system/previewAvatar"; |
|
50 |
} |
|
51 |
} |
|
52 |
|
|
53 |
/** |
|
54 |
* 默认的404错误页面背景 |
|
55 |
* |
|
56 |
* @author fengshuonan |
|
57 |
* @Date 2018/10/30 5:51 PM |
|
58 |
*/ |
|
59 |
public static String error404() { |
|
60 |
return ConfigListener.getConf().get("contextPath") + "/assets/common/images/error-bg.jpg"; |
|
61 |
} |
|
62 |
} |