|
|
|
@ -22,6 +22,7 @@ |
|
|
|
<input type="text" name="status" placeholder="请输入服务器状态" v-model="scinfo.status"> |
|
|
|
</div> |
|
|
|
<div class="stitem"> |
|
|
|
<input type="hidden" name="id" v-model="scinfo.id"> |
|
|
|
<button type="submit">保存</button> |
|
|
|
</div> |
|
|
|
<div class="stitem"> |
|
|
|
@ -99,7 +100,7 @@ export default { |
|
|
|
savesc(){ |
|
|
|
let form = this.$refs.form |
|
|
|
let formData={ |
|
|
|
id: this.scid, |
|
|
|
id: form.id.value, |
|
|
|
scname: form.scname.value, |
|
|
|
addr: form.addr.value, |
|
|
|
port: form.port.value, |
|
|
|
@ -112,11 +113,11 @@ export default { |
|
|
|
|
|
|
|
// 将fromdata 转成二进制 |
|
|
|
let binary = scproto.encodeServiceInfo(formData) |
|
|
|
// console.log(binary,"binary") |
|
|
|
console.log(binary,"binary") |
|
|
|
//二进制转为base64 |
|
|
|
let base64 = btoa(String.fromCharCode.apply(null, new Uint8Array(binary))) |
|
|
|
// let base64 = this.uint8ArrayToBase64(binary) |
|
|
|
// console.log(base64) |
|
|
|
console.log(base64) |
|
|
|
// let base64 =btoa(unescape(encodeURIComponent(binary))) |
|
|
|
// arraybuffer转为base64 |
|
|
|
|
|
|
|
|