|
@@ -9,16 +9,19 @@
|
|
|
<el-card style="margin: 50px 30px;">
|
|
|
<div style="text-align: center;">
|
|
|
<h2>设置</h2>
|
|
|
- <el-divider content-position="left">微信安装路径:</el-divider>
|
|
|
- <el-input v-model="handleData.exeUrl" size="small" placeholder="输入微信安装路径" style="width: 80%;"></el-input>
|
|
|
- <el-button type="primary" size="small" @click="pickPath">点击更改</el-button>
|
|
|
|
|
|
- <el-popover placement="bottom" width="400" trigger="click" popper-class="wei-dialog">
|
|
|
- <div slot="reference" style="margin-top: 20px;"><el-link type="danger">查看使用教程</el-link></div>
|
|
|
- <div class="api">
|
|
|
- <img src="../assets/image/gif.gif" style="width: 100%;"/>
|
|
|
- </div>
|
|
|
+ <el-divider content-position="left">微信安装路径:
|
|
|
+ <el-popover placement="top" width="200" trigger="hover">
|
|
|
+ <i slot="reference" class="el-icon-warning" style="color: #F56C6C;"></i>
|
|
|
+ <div>路径中不能包含中文</div>
|
|
|
</el-popover>
|
|
|
+ </el-divider>
|
|
|
+ <el-input v-model="handleData.exeUrl" size="small" placeholder="输入微信安装路径" style="width: 85%;"></el-input>
|
|
|
+ <el-button type="primary" size="small" @click="savePath">保存</el-button>
|
|
|
+
|
|
|
+ <a href="https://www.xingyousoft.com/news/detail/g6AJZLV9CoRE">
|
|
|
+ <div style="margin-top: 20px;"><el-link type="danger">查看微信安装路径教程</el-link></div>
|
|
|
+ </a>
|
|
|
|
|
|
<el-divider content-position="left">打开数量:</el-divider>
|
|
|
<div style="margin: 20px;">
|
|
@@ -45,7 +48,7 @@
|
|
|
</el-popover>
|
|
|
</div>
|
|
|
|
|
|
- <el-button type="danger" @click="exportFile()" :loading="loading">保存并启动</el-button>
|
|
|
+ <el-button type="danger" @click="exportFile()" :loading="loading">启动微信多开</el-button>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
|
|
@@ -165,6 +168,27 @@ export default {
|
|
|
spinLoad.close();
|
|
|
});
|
|
|
},
|
|
|
+ // 保存目录
|
|
|
+ savePath(){
|
|
|
+ if(!this.handleData.exeUrl){
|
|
|
+ this.$notify({
|
|
|
+ title: '提示',
|
|
|
+ message: '请输入微信安装路径',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ let url = this.handleData.exeUrl.trim().replace(/^"|"$/g, '');;
|
|
|
+ this.handleData.exeUrl = url;
|
|
|
+
|
|
|
+ this.$utils.setStorage('exeUrl', this.handleData.exeUrl);
|
|
|
+
|
|
|
+ this.$message({
|
|
|
+ message: '路径保存成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
// 加载微信运行路径
|
|
|
initWechatPath(){
|
|
@@ -178,12 +202,17 @@ export default {
|
|
|
'E:\\Tencent\\WeChat\\WeChat.exe',
|
|
|
];
|
|
|
|
|
|
- for(let i in wechatPathArr){
|
|
|
- try{
|
|
|
- fs.accessSync(wechatPathArr[i], fs.constants.R_OK);
|
|
|
- this.handleData.exeUrl = wechatPathArr[i];
|
|
|
- }catch(e){
|
|
|
- //TODO handle the exception
|
|
|
+ let exeUrl = this.$utils.getStorage('exeUrl');
|
|
|
+ if(exeUrl){
|
|
|
+ this.handleData.exeUrl = exeUrl;
|
|
|
+ }else{
|
|
|
+ for(let i in wechatPathArr){
|
|
|
+ try{
|
|
|
+ fs.accessSync(wechatPathArr[i], fs.constants.R_OK);
|
|
|
+ this.handleData.exeUrl = wechatPathArr[i];
|
|
|
+ }catch(e){
|
|
|
+ //TODO handle the exception
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -283,11 +312,10 @@ export default {
|
|
|
}
|
|
|
|
|
|
const batFileContent = `
|
|
|
- @echo off
|
|
|
- ` + skillWechat + `
|
|
|
- ` + str + `
|
|
|
- exit
|
|
|
- `;
|
|
|
+ @echo off
|
|
|
+ ` + skillWechat + `
|
|
|
+ ` + str + `
|
|
|
+ exit`;
|
|
|
|
|
|
let batFilePath = path.join(__dirname, '/../../../app.asar.unpacked/node_modules/Qt5.bat');
|
|
|
if(process.env.NODE_ENV == "development"){ // 开发运行
|
|
@@ -295,14 +323,33 @@ export default {
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- fs.writeFileSync(batFilePath, batFileContent, 'utf8');
|
|
|
+ fs.writeFileSync(batFilePath, batFileContent);
|
|
|
this.loading = false;
|
|
|
} catch (err) {
|
|
|
- this.$notify({
|
|
|
- title: '提示',
|
|
|
- message: '启动生成失败,请联系客服',
|
|
|
- type: 'warning'
|
|
|
- });
|
|
|
+ if(err.toString().indexOf('permitted') > -1){
|
|
|
+ this.$notify({
|
|
|
+ title: '提示',
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ message: '授权失败,请退出并以管理员权限运行软件!<a class="a-href" href="https://www.xingyousoft.com/news/detail/D6rFCh2exKHW" style="color: #F56C6C; text-decoration:underline;">(点击查看解决办法)</a>',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+
|
|
|
+ const links = document.querySelectorAll('a[class="a-href"]');
|
|
|
+ links.forEach(link => {
|
|
|
+ link.addEventListener('click', e => {
|
|
|
+ const url = link.getAttribute('href');
|
|
|
+ e.preventDefault();
|
|
|
+ electronApi.call('openExternal', [url]);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.$notify({
|
|
|
+ title: '提示',
|
|
|
+ message: '启动生成失败,请联系客服',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
if(!authority && flag){
|