mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-06-04 13:30:32 +08:00
33 lines
600 B
JavaScript
33 lines
600 B
JavaScript
const { getSettings, saveSettings } = require("../../utils/config");
|
|
|
|
Page({
|
|
data: {
|
|
baseUrl: "",
|
|
apiKey: ""
|
|
},
|
|
|
|
onShow() {
|
|
const settings = getSettings();
|
|
this.setData({
|
|
baseUrl: settings.baseUrl,
|
|
apiKey: settings.apiKey
|
|
});
|
|
},
|
|
|
|
onBaseUrlInput(event) {
|
|
this.setData({ baseUrl: event.detail.value });
|
|
},
|
|
|
|
onApiKeyInput(event) {
|
|
this.setData({ apiKey: event.detail.value });
|
|
},
|
|
|
|
save() {
|
|
saveSettings({
|
|
baseUrl: this.data.baseUrl,
|
|
apiKey: this.data.apiKey
|
|
});
|
|
wx.showToast({ title: "Saved", icon: "success" });
|
|
}
|
|
});
|