HomePageDirective.js 611 Bytes
Newer Older
1 2 3 4
import Utils from '../utils/Utils'
import BaseDirective from './BaseDirective'

class HomePageDirective extends BaseDirective {
邹绪超's avatar
邹绪超 committed
5
    static name = "返回首页"
6 7 8 9 10 11 12
    match () {
        const {text} = this
        if(/首页/.test(text)) {
            return true
        }
        return false
    }
13 14 15
    async excute ({
        sendMsg = function() {}
    }) {
16
        if(!window.globalConfig.homepage) {
17
            return sendMsg("没有配置首页")
18 19
        }
        Utils.openMenu({url : window.globalConfig.homepage})
20
        return sendMsg("返回首页成功")
21 22 23 24
    } 
}

export default HomePageDirective