| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- // 获取图片路径
- export function getImageSrc(className, imageName) {
- var protocol = window.location.protocol;
- // console.log('protocol:' + protocol);
- var host = window.location.host;
- // console.log('host:' + host);
- var localhostPath = protocol + '//' + host;
- var accountId = localStorage.getItem('#accountId') || 0;
- if (imageName == null) {
- return null;
- }
- if (imageName != null && imageName[0] == '/') {
- return localhostPath + '/Files/' + accountId + '/Images/' + className + imageName;
- } else {
- return localhostPath + '/Files/' + accountId + '/Images/' + className + '/' + imageName;
- }
- }
-
-
- // 获取略缩图图片路径
- export function getThumbnailImageSrc(className, imageName) {
- var protocol = window.location.protocol;
- // console.log('protocol:' + protocol);
- var host = window.location.host;
- // console.log('host:' + host);
- var localhostPath = protocol + '//' + host;
- //测试用
- //var localhostPath = 'http://127.0.0.1:83';
- console.log('localhostPath:' + localhostPath);
- var accountId = localStorage.getItem('#accountId');
- if (imageName == null) {
- return null;
- }
- if (imageName != null && imageName[0] == '/') {
- return localhostPath + '/Files/' + accountId + '/Images/' + className + '/thumbnail' + imageName;
- } else {
- return localhostPath + '/Files/' + accountId + '/Images/' + className + '/thumbnail/' + imageName;
- }
- }
|