Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CRM
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
华国豪
CRM
Commits
b91549d3
Commit
b91549d3
authored
Apr 28, 2023
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
c88a8075
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
1 deletion
+51
-1
index.js
src/plugins/index.js
+51
-1
No files found.
src/plugins/index.js
View file @
b91549d3
...
@@ -14,7 +14,8 @@ export default {
...
@@ -14,7 +14,8 @@ export default {
//CRM API
//CRM API
let
domainUrl
=
""
;
let
domainUrl
=
""
;
// domainUrl = "http://192.168.10.46:8500";
// domainUrl = "http://192.168.10.46:8500";
domainUrl
=
"http://192.168.10.9:8098"
;
// domainUrl = "http://192.168.10.9:8098";
domainUrl
=
"http://192.168.10.266"
;
// domainUrl = "http://crm.oytour.com"
// domainUrl = "http://crm.oytour.com"
//domainUrl = "http://localhost:5003";
//domainUrl = "http://localhost:5003";
let
locationName
=
window
.
location
.
hostname
;
let
locationName
=
window
.
location
.
hostname
;
...
@@ -41,6 +42,7 @@ export default {
...
@@ -41,6 +42,7 @@ export default {
PostUrl
:
domainUrl
,
PostUrl
:
domainUrl
,
//旅游ERPApi地址
//旅游ERPApi地址
ERPApiUrl
:
domainPostUrl
+
"/api/common/post"
,
ERPApiUrl
:
domainPostUrl
+
"/api/common/post"
,
ERPApiUrlFile
:
domainPostUrl
+
"/api/file/GetFileFromWebApi"
,
javaUrl
:
locationName
.
indexOf
(
'testb2b'
)
==
-
1
?
"http://efficient.oytour.com"
:
locationName
.
indexOf
(
'testb2b.oytour.com'
)
!==
-
1
?
"http://47.96.12.235:9001"
:
"http://192.168.10.215:9000"
,
javaUrl
:
locationName
.
indexOf
(
'testb2b'
)
==
-
1
?
"http://efficient.oytour.com"
:
locationName
.
indexOf
(
'testb2b.oytour.com'
)
!==
-
1
?
"http://47.96.12.235:9001"
:
"http://192.168.10.215:9000"
,
ViittoFileUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
||
locationName
.
indexOf
(
'testb2b.oytour.com'
)
!==
-
1
?
"http://staticfile.oytour.com"
:
'http://192.168.10.214:8130'
,
ViittoFileUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
||
locationName
.
indexOf
(
'testb2b.oytour.com'
)
!==
-
1
?
"http://staticfile.oytour.com"
:
'http://192.168.10.214:8130'
,
UploadUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
||
locationName
.
indexOf
(
'testb2b.oytour.com'
)
!==
-
1
?
"http://uploadfile.oytour.com"
:
"http://192.168.10.214:8120"
,
UploadUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
||
locationName
.
indexOf
(
'testb2b.oytour.com'
)
!==
-
1
?
"http://uploadfile.oytour.com"
:
"http://192.168.10.214:8120"
,
...
@@ -351,5 +353,53 @@ export default {
...
@@ -351,5 +353,53 @@ export default {
console
.
log
(
"GetLocalFile"
,
res
);
console
.
log
(
"GetLocalFile"
,
res
);
});
});
}
}
//erp下载文件
Vue
.
prototype
.
GetLocalFile2
=
function
(
cmd
,
msg
,
fileName
,
callBack
)
{
if
(
msg
==
null
||
msg
==
""
)
{
msg
=
{}
}
var
apiurl
=
this
.
domainManager
().
ERPApiUrlFile
;
var
timestamp
=
(
new
Date
()).
valueOf
();
var
token
=
""
;
var
key
=
""
;
if
(
this
.
getLocalStorage
()
!=
null
)
{
token
=
this
.
getLocalStorage
().
token
;
key
=
this
.
getLocalStorage
().
SecretKey
;
}
var
encodeMsg
=
encodeURIComponent
(
JSON
.
stringify
(
msg
)).
toLowerCase
();
var
md5Str
=
md5
(
`cmd=
${
cmd
}
&msg=
${
encodeMsg
}
×tamp=
${
timestamp
}
&token=
${
token
}
&key=
${
key
}
`
);
var
postData
=
{
"cmd"
:
cmd
,
"msg"
:
msg
,
"timestamp"
:
timestamp
,
"token"
:
token
,
"sign"
:
md5Str
}
this
.
$http
.
post
(
apiurl
,
postData
,
{
headers
:
{
'Content-Type'
:
'application/json'
,
'Referer-Viitto'
:
this
.
$route
.
path
,
},
responseType
:
'blob'
}).
then
((
res
)
=>
{
let
blob
=
new
Blob
([
res
.
data
],
{
type
:
"application/vnd.ms-excel"
})
let
url
=
URL
.
createObjectURL
(
blob
);
let
link
=
document
.
createElement
(
'a'
);
link
.
href
=
url
;
link
.
setAttribute
(
"download"
,
fileName
);
document
.
body
.
appendChild
(
link
);
link
.
click
();
if
(
callBack
)
{
var
result
=
{
Code
:
1
};
callBack
(
result
);
}
}).
catch
(
function
(
res
)
{
console
.
log
(
"GetLocalFile"
,
res
);
});
}
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment