From 40ab4e4a46541c774c65da3959537f019ffbd37b Mon Sep 17 00:00:00 2001 From: Jondy Zhao Date: Fri, 11 Dec 2020 10:59:43 +0800 Subject: [PATCH 1/3] Fix login issue --- src/connector.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/connector.js b/src/connector.js index 1827791..decdf99 100644 --- a/src/connector.js +++ b/src/connector.js @@ -4,13 +4,16 @@ import Vue from 'vue' import reqwest from './plugins/reqwest.js' import { _t } from './plugins/gettext.js' -const serverUrl = 'http://localhost:9092' - const ACCESS_TOKEN_KEY = 'ACCESS_TOKEN' const REFRESH_TOKEN_KEY = 'REFRESH_TOKEN' -const clientId = '0gvr1GFNpCy9fSpxsKHPdUPUu7ZSCQS76zc8kAgl' -const clientSecret = 'dazoA4IhCGrWrkh2rA02FE1qm3AVWdAz9qKqSZDLAD22xWiVYsEeMtq2BmqVY748U8Qw9jecBo9BHYYG3nZDgOUUwaEFjjDir1VX25ejnCvEcwdzV3Wt2Rxcnt45lxaN' +// const serverUrl = 'http://localhost:9092' +// const clientId = '0gvr1GFNpCy9fSpxsKHPdUPUu7ZSCQS76zc8kAgl' +// const clientSecret = 'dazoA4IhCGrWrkh2rA02FE1qm3AVWdAz9qKqSZDLAD22xWiVYsEeMtq2BmqVY748U8Qw9jecBo9BHYYG3nZDgOUUwaEFjjDir1VX25ejnCvEcwdzV3Wt2Rxcnt45lxaN' + +const serverUrl = 'https://codebang.dashingsoft.com' +const clientId = 'rgt9yKrM82ACFiKLW2aIwxYUCIUV8ggx2OH5hvu8' +const clientSecret = 'hiWi4Q8k4TR1aAF8PGtqjL7DiY15gBFXjYQ9UM5F3EV5mneJbo88LlXqst0PcfpYVhPQyKc1jjlICggI0otTjOv6zoP89Q0uBNoLsEqkRVmi2G4w5Snn9dBADHx7UxaT' // Fix this issue: // Do not access Object.prototype method ‘hasOwnProperty’ from target object no-prototype-builtins @@ -177,9 +180,9 @@ const make_multipart_data = function (args, files) { } export default new Vue({ - computed: { - isAuthenticated: function () { - return is_authenticated() + data: { + return { + isAuthenticated: false } }, methods: { @@ -249,6 +252,7 @@ export default new Vue({ const callback = function (success, result) { if (!success && !silent) this.showError(result.message) + this.isAuthenticated = is_authenticated() this.$emit('api-login', success, result) }.bind(this) get_token(username, password, callback) @@ -257,6 +261,7 @@ export default new Vue({ const callback = function (success, result) { if (!success && !silent) this.showError(result.message) + this.isAuthenticated = is_authenticated() this.$emit('api-logout', success, result) }.bind(this) revoke_token(callback) From 077292f050cac567dd06bf99d30da5326bc1d0db Mon Sep 17 00:00:00 2001 From: Jondy Zhao Date: Sat, 12 Dec 2020 10:16:10 +0800 Subject: [PATCH 2/3] Fix bug --- src/connector.js | 2 +- tools/lldb-proxy.py | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/connector.js b/src/connector.js index decdf99..66311f4 100644 --- a/src/connector.js +++ b/src/connector.js @@ -180,7 +180,7 @@ const make_multipart_data = function (args, files) { } export default new Vue({ - data: { + data() { return { isAuthenticated: false } diff --git a/tools/lldb-proxy.py b/tools/lldb-proxy.py index 0e82e88..6a6d3f1 100644 --- a/tools/lldb-proxy.py +++ b/tools/lldb-proxy.py @@ -43,6 +43,8 @@ class Debugger(object): def __init__(self): self.debugger = lldb.SBDebugger.Create() self.debugger.SetAsync(False) + self.interpreter = self.debugger.GetCommandInterpreter() + self.res = lldb.SBCommandReturnObject() self.target = None def handle_command(self, command): @@ -57,12 +59,16 @@ def handle_command(self, command): raise RuntimeError('No %s found' % name) m = getattr(obj, action) - if m is None: - raise RuntimeError('No method %s found' % action) + if m is not None: + return m(*args) - return m(*args) + if name == 'debugger': + # self.debugger.HandleCommand(command) + self.res.clear() + self.interpreter.HandleCommand(action, self.res) + return self.res.Succeeded() - # self.debugger.HandleCommand(command) + raise RuntimeError('No method %s found for %s' % (action, name)) def _add_breakpoint(self, bp=None): main_bp = self.target.BreakpointCreateByName( From a8ab3a59abccf8f9daeeb761d72f291ae2ffac5d Mon Sep 17 00:00:00 2001 From: Jondy Zhao Date: Sat, 12 Dec 2020 10:30:51 +0800 Subject: [PATCH 3/3] Add vue.config.js --- vue.config.js | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 vue.config.js diff --git a/vue.config.js b/vue.config.js new file mode 100644 index 0000000..89c6e5f --- /dev/null +++ b/vue.config.js @@ -0,0 +1,3 @@ +module.exports = { + publicPath: "/app/" +}