Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
梁建民
/
h5
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d438e211
authored
Sep 23, 2019
by
梁建民
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
js
parent
2eeb1b51
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
src/store/modules/download/index.js
view/app.js
src/store/modules/download/index.js
View file @
d438e211
...
...
@@ -39,7 +39,7 @@ const actions = {
});
},
downloadFile
({
commit
},
payload
)
{
downloadFile
:
function
({
commit
},
payload
)
{
var
param
=
{
data_id
:
payload
.
id
...
...
@@ -53,6 +53,14 @@ const actions = {
if
(
data
.
err_code
==
0
)
{
window
.
location
.
href
=
data
.
data
[
0
].
file_url
;
}
else
if
(
data
.
err_code
==
1
)
{
Toast
({
message
:
data
.
err_msg
,
duration
:
2000
});
setTimeout
(
function
()
{
window
.
location
.
href
=
'/v3/login?referer=%2fh5%2fview%2f%23%2fdownoad&from=download'
},
2000
);
}
else
{
Toast
({
message
:
data
.
err_msg
,
...
...
view/app.js
View file @
d438e211
...
...
@@ -3857,7 +3857,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue_
/***/
(
function
(
module
,
__webpack_exports__
,
__webpack_require__
)
{
"use strict"
;
eval
(
"__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/_vue@2.6.10@vue/dist/vue.runtime.esm.js\");\n/* harmony import */ var vant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vant */ \"./node_modules/_vant@2.0.1@vant/es/index.js\");\n/* harmony import */ var _api_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../api/index */ \"./src/api/index.js\");\n/* harmony import */ var _util_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../util/index */ \"./src/util/index.js\");\n\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_0__[\"default\"].use(vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"]);\nvar state = {\n loading: false,\n getfileuploadbanner: [],\n articleShowData: []\n};\nvar mutations = {\n getfileuploadbanner: function getfileuploadbanner(state, payload) {\n state.getfileuploadbanner = payload.data;\n },\n articleShowData: function articleShowData(state, payload) {\n state.articleShowData = payload.data;\n }\n};\nvar actions = {\n getfileuploadbanner: function getfileuploadbanner(_ref, payload) {\n var commit = _ref.commit;\n var params = _util_index__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getParams();\n _api_index__WEBPACK_IMPORTED_MODULE_2__[\"services\"].getfileuploadbanner(params).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n commit({\n type: 'getfileuploadbanner',\n data: data.data.data\n });\n }\n }).catch(function (err) {});\n },\n downloadFile: function downloadFile(_ref2, payload) {\n var commit = _ref2.commit;\n var param = {\n data_id: payload.id\n };\n var params = _util_index__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getParams(param);\n _api_index__WEBPACK_IMPORTED_MODULE_2__[\"services\"].downloadFile(params).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n window.location.href = data.data[0].file_url;\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n }\n }).catch(function (err) {});\n },\n articleShowData: function articleShowData(_ref3, payload) {\n var commit = _ref3.commit;\n var params = _util_index__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getParams();\n _api_index__WEBPACK_IMPORTED_MODULE_2__[\"services\"].articleShowData(params).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n commit({\n type: 'articleShowData',\n data: data.data\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n }\n }).catch(function (err) {});\n }\n};\nvar getters = {};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n state: state,\n mutations: mutations,\n actions: actions,\n getters: getters\n});\n\n//# sourceURL=webpack:///./src/store/modules/download/index.js?"
);
eval
(
"__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/_vue@2.6.10@vue/dist/vue.runtime.esm.js\");\n/* harmony import */ var vant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vant */ \"./node_modules/_vant@2.0.1@vant/es/index.js\");\n/* harmony import */ var _api_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../api/index */ \"./src/api/index.js\");\n/* harmony import */ var _util_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../util/index */ \"./src/util/index.js\");\n\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_0__[\"default\"].use(vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"]);\nvar state = {\n loading: false,\n getfileuploadbanner: [],\n articleShowData: []\n};\nvar mutations = {\n getfileuploadbanner: function getfileuploadbanner(state, payload) {\n state.getfileuploadbanner = payload.data;\n },\n articleShowData: function articleShowData(state, payload) {\n state.articleShowData = payload.data;\n }\n};\nvar actions = {\n getfileuploadbanner: function getfileuploadbanner(_ref, payload) {\n var commit = _ref.commit;\n var params = _util_index__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getParams();\n _api_index__WEBPACK_IMPORTED_MODULE_2__[\"services\"].getfileuploadbanner(params).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n commit({\n type: 'getfileuploadbanner',\n data: data.data.data\n });\n }\n }).catch(function (err) {});\n },\n downloadFile: function downloadFile(_ref2, payload) {\n var commit = _ref2.commit;\n var param = {\n data_id: payload.id\n };\n var params = _util_index__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getParams(param);\n _api_index__WEBPACK_IMPORTED_MODULE_2__[\"services\"].downloadFile(params).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n window.location.href = data.data[0].file_url;\n } else
if (data.err_code == 1) {\n Object(vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n setTimeout(function () {\n window.location.href = '/v3/login?referer=%2fh5%2fview%2f%23%2fdownoad&from=download';\n }, 2000);\n } else
{\n Object(vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n }\n }).catch(function (err) {});\n },\n articleShowData: function articleShowData(_ref3, payload) {\n var commit = _ref3.commit;\n var params = _util_index__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getParams();\n _api_index__WEBPACK_IMPORTED_MODULE_2__[\"services\"].articleShowData(params).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n commit({\n type: 'articleShowData',\n data: data.data\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n }\n }).catch(function (err) {});\n }\n};\nvar getters = {};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n state: state,\n mutations: mutations,\n actions: actions,\n getters: getters\n});\n\n//# sourceURL=webpack:///./src/store/modules/download/index.js?"
);
/***/
}),
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