Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
mmc-stl-vue2
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
mmc-stl-vue2
Commits
33a87a95
提交
33a87a95
authored
9月 13, 2023
作者:
翁进城
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更改版本号为0.2.0
上级
5fe43bc7
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
22 行增加
和
34 行删除
+22
-34
package.json
vue2/package.json
+2
-1
demo.js
vue2/src/views/groundStation/demo.js
+15
-30
demo.vue
vue2/src/views/groundStation/demo.vue
+5
-3
没有找到文件。
vue2/package.json
浏览文件 @
33a87a95
{
"name"
:
"vue2"
,
"version"
:
"0.
1
.0"
,
"version"
:
"0.
2
.0"
,
"private"
:
true
,
"scripts"
:
{
"dev"
:
"vue-cli-service serve"
,
...
...
@@ -9,6 +9,7 @@
},
"dependencies"
:
{
"core-js"
:
"^3.8.3"
,
"js-base64"
:
"^3.7.5"
,
"mqtt"
:
"^4.3.6"
,
"vue"
:
"^2.6.14"
,
"vue-router"
:
"^3.5.2"
,
...
...
vue2/src/views/groundStation/demo.js
浏览文件 @
33a87a95
...
...
@@ -2,6 +2,9 @@ export default `
<template>
<div>
<el-form>
<el-form-item label="地面站地址">
<el-input v-model="url"></el-input>
</el-form-item>
<el-form-item label="账号">
<el-input v-model="account"></el-input>
</el-form-item>
...
...
@@ -31,12 +34,14 @@ export default `
</template>
<script>
import { Base64 } from "js-base64"
export default {
name: "GroundStation",
data() {
return {
account: "
juchut
",
password: "
dG1qMDQwNyNuZXcuMQ==
",
account: "
wjc
",
password: "
123456
",
deviceHardId: "",
userInfo: {
username: "",
...
...
@@ -45,6 +50,7 @@ export default {
// 'task-id': 1448
},
callbackText: "",
url: "wss://test.tmj.mmcuav.cn/websocket"
};
},
computed: {
...
...
@@ -60,46 +66,25 @@ export default {
async login() {
let formData = new FormData();
formData.append("userAccount", this.account);
formData.append("password",
this.password
);
let res1 = await fetch("/crm/
account/
login", {
formData.append("password",
Base64.encode(this.password)
);
let res1 = await fetch("/crm/login", {
method: "post",
headers: {
"Content-Type": "application/json
",
// "Content-Type": "multipart/form-data
",
},
body: JSON.stringify({
username: this.account,
password: this.password,
}),
body: formData,
});
let data1 = await res1.json();
if (data1.code == 200) {
this.userInfo.username = data1.data.username;
}
let res2 = await fetch("/crm/account/loginInfo", {
method: "post",
headers: {
token: data1.data.token,
"Content-Type": "application/json",
},
body: JSON.stringify({
loginInfo: {
appId: "40004",
token: data1.data.token,
},
}),
});
let data2 = await res2.json();
if (data2.code == 200) {
this.userInfo.token = data2.data.token + data2.data.flyingSessionId;
this.userInfo.username = data1.data.userName;
this.userInfo.token = data1.data.token;
}
},
async connect() {
try {
await this.$store.dispatch("MMCGroundStation/init", {
url:
"ws://121.43.58.140:30105"
,
url:
this.url
,
userInfo: this.userInfo,
});
} catch (e) {
...
...
vue2/src/views/groundStation/demo.vue
浏览文件 @
33a87a95
...
...
@@ -33,12 +33,14 @@
</
template
>
<
script
>
import
{
Base64
}
from
"js-base64"
export
default
{
name
:
"GroundStation"
,
data
()
{
return
{
account
:
"
mmc111
"
,
password
:
"
MTIzNDU2
"
,
account
:
"
wjc
"
,
password
:
"
123456
"
,
deviceHardId
:
""
,
userInfo
:
{
username
:
""
,
...
...
@@ -63,7 +65,7 @@ export default {
async
login
()
{
let
formData
=
new
FormData
();
formData
.
append
(
"userAccount"
,
this
.
account
);
formData
.
append
(
"password"
,
this
.
password
);
formData
.
append
(
"password"
,
Base64
.
encode
(
this
.
password
)
);
let
res1
=
await
fetch
(
"/crm/login"
,
{
method
:
"post"
,
headers
:
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论