Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
marketing
Overview
Overview
Details
Activity
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
marketing-web
marketing
Commits
5b58168f
Commit
5b58168f
authored
Sep 10, 2021
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复模块报错bug
parent
3b6e2463
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
18 deletions
+16
-18
limiting.js
src/utils/limiting.js
+16
-18
No files found.
src/utils/limiting.js
View file @
5b58168f
import
{
requests
}
from
'@/service/api/index'
;
import
globalConfig
from
'@/config/index'
;
import
Vue
from
'vue'
;
import
store
from
'@/store/index'
;
export
default
config
=>
{
const
{
createApp
}
=
config
;
window
.
onload
=
async
function
()
{
try
{
const
fullLoading
=
Vue
.
prototype
.
$loading
({
lock
:
true
});
// 获取用户企业id
let
loginUserRes
=
await
requests
(
'/api-auth/get-login-user-info'
,
{
requestProject
:
'gic-web'
,
f
:
1
});
let
enterpriseId
=
loginUserRes
.
result
.
enterpriseId
;
store
.
commit
(
'updateEnterpriseId'
,
enterpriseId
);
// 更新企业id
const
couponEnable
=
await
requests
(
'/api-marketing/opt-coupon-enable'
,
{
requestProject
:
'marketing'
});
store
.
commit
(
'updateAppletEnable'
,
couponEnable
.
result
||
false
);
// result: true,能改 false不能
store
.
commit
(
'updateLimitCodeList'
,
loginUserRes
.
result
.
limitCodeList
);
store
.
commit
(
'updateSuperAdmin'
,
loginUserRes
.
result
.
superAdmin
);
store
.
commit
(
'updateDepartAuth'
,
loginUserRes
.
result
.
departAuth
);
store
.
commit
(
'updateUserId'
,
loginUserRes
.
result
.
userId
);
window
.
onload
=
function
()
{
const
fullLoading
=
Vue
.
prototype
.
$loading
({
lock
:
true
});
// 获取用户企业id
const
getUserInfo
=
requests
(
'/api-auth/get-login-user-info'
,
{
requestProject
:
'gic-web'
,
f
:
1
}).
then
(
data
=>
{
const
result
=
data
.
result
||
{};
store
.
commit
(
'updateEnterpriseId'
,
result
.
enterpriseId
);
// 更新企业id
store
.
commit
(
'updateLimitCodeList'
,
result
.
limitCodeList
);
store
.
commit
(
'updateSuperAdmin'
,
result
.
superAdmin
);
store
.
commit
(
'updateDepartAuth'
,
result
.
departAuth
);
store
.
commit
(
'updateUserId'
,
result
.
userId
);
});
const
getCouponEnable
=
requests
(
'/api-marketing/opt-coupon-enable'
,
{
requestProject
:
'marketing'
}).
then
(
data
=>
{
store
.
commit
(
'updateAppletEnable'
,
data
.
result
||
false
);
// result: true,能改 false不能
});
Promise
.
all
([
getUserInfo
,
getCouponEnable
]).
finally
(()
=>
{
createApp
();
fullLoading
.
close
();
}
catch
(
error
)
{
// 未登录
window
.
location
.
href
=
globalConfig
.
api
+
'gic-web/'
;
}
});
};
};
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