feat(web): 使用模块化js 增加账号改密、注销
This commit is contained in:
@@ -23,23 +23,20 @@
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
<script src="assets/sdk/sdk.js"></script>
|
||||
<script src="assets/component/constants.js"></script>
|
||||
<script src="assets/component/common.js"></script>
|
||||
<script src="assets/component/pages/overview-tab.js"></script>
|
||||
<script src="assets/component/pages/user-tab.js"></script>
|
||||
<script>
|
||||
<script type="module">
|
||||
import {information} from './assets/component/constants.js'
|
||||
import {userChangePasswordDialog} from './assets/component/pages/user/dialog-user-change-password'
|
||||
import {tabUser} from './assets/component/pages/tab-user.js'
|
||||
import {tabOverview} from './assets/component/pages/tab-overview.js'
|
||||
import {apiGet} from "./assets/component/common.js";
|
||||
|
||||
(function () {
|
||||
let amis = amisRequire('amis/embed')
|
||||
let amisJSON = {
|
||||
id: 'header-service',
|
||||
className: 'h-full',
|
||||
type: 'service',
|
||||
api: {
|
||||
method: 'get',
|
||||
url: '${base}/user/state',
|
||||
headers: {
|
||||
token: '${token}'
|
||||
},
|
||||
},
|
||||
api: apiGet('${base}/user/state'),
|
||||
onEvent: {
|
||||
fetchInited: {
|
||||
actions: [
|
||||
@@ -48,6 +45,7 @@
|
||||
actionType: 'url',
|
||||
args: {
|
||||
url: '/login.html',
|
||||
blank: false,
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -66,10 +64,14 @@
|
||||
trigger: 'hover',
|
||||
buttons: [
|
||||
{
|
||||
label: '个人资料',
|
||||
label: '修改密码',
|
||||
...userChangePasswordDialog(),
|
||||
},
|
||||
{
|
||||
label: '退出登陆',
|
||||
actionType: 'ajax',
|
||||
api: apiGet('${base}/user/logout'),
|
||||
reload: 'header-service',
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -80,14 +82,13 @@
|
||||
type: 'tabs',
|
||||
tabsMode: 'vertical',
|
||||
tabs: [
|
||||
userTab(),
|
||||
overviewTab(),
|
||||
tabOverview(),
|
||||
tabUser(),
|
||||
]
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
let debug = false
|
||||
amis.embed(
|
||||
'#root',
|
||||
amisJSON,
|
||||
@@ -98,10 +99,10 @@
|
||||
},
|
||||
{
|
||||
theme: 'antd',
|
||||
enableAMISDebug: debug,
|
||||
enableAMISDebug: information.debug,
|
||||
},
|
||||
);
|
||||
if (debug) {
|
||||
if (information.debug) {
|
||||
console.log('Source', amisJSON)
|
||||
}
|
||||
})()
|
||||
|
||||
Reference in New Issue
Block a user